How semantic versioning works, and why version numbers still break things
Many open-source projects use semantic versioning (SemVer): version numbers in the form MAJOR.MINOR.PATCH, like 2.4.1.
The rules in brief
- PATCH (2.4.1): backward-compatible bug fixes.
- MINOR (2.4.0): new features that don't break existing usage.
- MAJOR (2.0.0): breaking changes.
- 0.x versions: initial development; anything may change.
- Pre-release labels like
-beta.1signal unstable versions.
Package managers use these rules for version ranges. A range like ^2.4.1 typically means "any 2.x version from 2.4.1 up," trusting that minor and patch updates are safe.
Why updates still break things
- What counts as breaking is fuzzy. A bug fix can break someone relying on the buggy behavior.
- Accidental breakage: maintainers miss that a change affects public behavior.
- Transitive dependencies: your direct dependency is fine, but one of its dependencies isn't.
- Performance or output changes that aren't technically API changes.
- Long-lived 0.x projects where every release can break.
Defensive habits
- Use lockfiles so builds use exact, tested versions.
- Update dependencies regularly in small steps, with tests running.
- Read changelogs before major upgrades.
- Use tools that open automated update pull requests so changes are reviewed and tested.
Alternatives
Some projects prefer calendar versioning (CalVer), using dates, which signals freshness rather than compatibility.
Maintainers, how do you decide what counts as breaking? Users, has a minor version ever broken your build?
Comments · 4
It was useful to learn why the caret in package files matters. "^2.4.1" lets minor and patch updates through, which is how an update sometimes breaks a project that wasn't touched.
Lock files are the unsung hero. Pin your dependencies in your build and upgrade deliberately, otherwise Friday-afternoon surprises will find you.
Why do some projects ignore SemVer and just keep bumping numbers? Is it just a different style?
Some projects use calendar versioning or just bump on release for marketing reasons. It's a convention, not a law, so check each project's own policy.