Patch, Minor or Major? Quick Tips for Picking the Next Number
The release is ready and someone asks the question that stalls it: what version is this? These tips are for that moment. Each is short, with the reason behind it, and together they cover most of the cases that cause debate in pull request comments.
Start from the user's point of view
- Ask "could correct code that worked yesterday fail today?" If yes, it is major. Why: semver is a promise about consumers' code, not about how big your diff is.
- A large refactor with no visible change is a patch. Why: users cannot see internal rewrites, so the number should not alarm them.
- A one-line removal of an exported function is a major. Why: size of change and size of impact are unrelated.
- New optional parameter or new export: minor. Why: existing calls still work, and the new capability is worth signalling.
Handle the grey areas consistently
- Fixing a bug people rely on. Technically a patch, but if the old behaviour was widely depended on, consider shipping the fix in a major or behind an option. Why: "it was a bug" does not help a user whose build broke.
- Dropping support for an old runtime. Most libraries treat this as major. Why: users on that runtime can no longer install the new version and keep working.
- Tightening TypeScript types. Can break compiling code even when runtime behaviour is unchanged; decide a policy and write it down. Why: consistency matters more than which rule you pick.
- Raising a dependency's minimum major. Major if that dependency's types or objects pass through your API; often minor otherwise. Why: exposure is what makes it breaking.
Use pre-releases and 0.x deliberately
- Use
2.0.0-rc.1style pre-releases for a big major. Why: they sort before2.0.0and most range syntaxes skip them unless asked. - On npm, publish pre-releases under a dist-tag such as
next. Why: otherwise the pre-release becomeslatestfor everyone. - In 0.x, treat minor as breaking. Why: npm's caret and Cargo's default requirements both do, so your users' tools already assume it.
- Leave 0.x once people use the package in production. Why: staying on 0.x forever withholds a stability signal users need.
Make the decision faster next time
Write a three-row table in your contributing guide that maps change types to bump levels, and ask contributors to state the bump in their pull request description. If you use Conventional Commits or Changesets, the tooling will propose the bump; a human should still sanity-check it before release.
| Change in this release | Bump |
|---|---|
| Only fixes and docs | Patch |
| Any new public capability, no removals | Minor |
| Any removal, rename or incompatible behaviour change | Major |
For the underlying rules, read semantic versioning explained; for harder cases, see semver edge cases.