If you’ve seen version numbers like 1.2.3
or 4.5.6-beta
, and wondered what all those numbers mean — you're in the right place.
This is your no-jargon, easy-to-digest guide to Semantic Versioning — or SemVer.
What is Semantic Versioning?
Semantic Versioning is a standard for naming versions of your software. It uses three numbers:
MAJOR.MINOR.PATCH
Basic Format
1.2.3
↑ ↑ ↑
│ │ └─ PATCH
│ └─── MINOR
└───── MAJOR
Now let’s break it down — as if you’re explaining it to your non-techy cousin.
The Numbers
1. MAJOR version (1.x.x
)
- When you break things.
- Not compatible with old versions.
- You remove or change a function’s behavior in a way that older code will break.
Example:
You go from 1.2.3
➜ 2.0.0
"Whoa, we broke something!"
2. MINOR version (x.1.x
)
- When you add features, but nothing breaks.
- Compatible with old versions.
Example:
You go from 1.2.3
➜ 1.3.0
"Hey, we added something new, but old stuff still works!"
3. PATCH version (x.x.3
)
- When you fix bugs or make tiny changes.
- No new features. Just repairs.
Example:
You go from 1.2.3
➜ 1.2.4
"Oops, we squashed a bug!"
Pre-release Tags (Optional)
Sometimes you’re not ready to release a final version. So you tag it:
1.0.0-alpha
— very early preview1.0.0-beta
— almost ready, still testing1.0.0-rc.1
— release candidate (final test)
Build Metadata
You can add extra info after a +
, like a date or commit hash.
Example:
1.0.0+20240618
This doesn’t affect how it’s compared to other versions. It’s just info.
Real-World Examples
- Fixed a small typo
1.0.0
➜1.0.1
- Added new feature (non-breaking)
1.0.1
➜1.1.0
- Removed a function (breaking change)
1.1.0
➜2.0.0
- Released test version for feedback
2.0.0
➜2.0.0-beta
Cheat Sheet for Dummies
- Bug fix = PATCH
- New feature = MINOR
- Breaking change = MAJOR
- Not final version = Add suffix like
-beta
,-rc.1
Conclusion
- Don’t just change
1.0.0
to5.0.0
because it looks cooler. Stick to meaning! - Semantic Versioning helps users, developers, and tools understand how big the change is.
- You’re not just naming a version — you’re setting expectations.
Now go and bump that version like a pro.
TL;DR
Semantic Versioning is just a smart way to say:
“Did we fix a bug? Add a feature? Or break something?”
Comments
Post a Comment