What Good Looks Like: A Major Version Nobody Complained About
This is a hypothetical walkthrough of a release that went right. "Package R" is an invented HTTP client library moving from 2.x to 3.0. No real project or person is described. The value is in the sequence: each step is ordinary, and together they turn a breaking release into a routine upgrade for most users.
Months before: decide what breaks, once
The maintainers collect every breaking change they want into a single tracking issue: renaming the timeout option to timeoutMs, removing callback-style APIs in favour of promises, and raising the minimum runtime. Bundling them into one major avoids the fatigue of three majors in a year. Anything that is not ready by the cut-off waits for the next major rather than delaying this one.
One or two minors before: warn in the code
In 2.8.0, the old names still work but emit a one-time warning:
if (opts.timeout !== undefined) {
warnOnce("R_TIMEOUT", "`timeout` is deprecated; use `timeoutMs`. Removed in 3.0.");
opts.timeoutMs ??= opts.timeout;
}
Warnings carry a stable code so users can search for it and, in a test environment, turn warnings into failures. Because they fire only once per process, they are noticeable without flooding logs. The changelog for 2.8.0 lists each deprecation with its replacement.
At release: give people a map
- A migration guide ordered by how many users each change affects, with a before-and-after snippet for every item.
- A codemod for the mechanical renames, so a large codebase can be updated in one command and reviewed as a single diff.
- A clear first line in the changelog: "3.0.0 contains breaking changes; read the migration guide first."
- Release candidates (
3.0.0-rc.1) published under a separate dist-tag such asnext, sonpm install package-rkeeps giving users 2.x until the final release.
npm publish --tag next # for 3.0.0-rc.1
npm dist-tag add package-r@3.0.0 latest # on the final release
After release: keep the old line breathing
The maintainers state, in the README, how long 2.x will receive security fixes, and they keep a v2 maintenance branch from which patch releases can be cut. Users who cannot migrate immediately are not forced into a choice between an unpatched dependency and a rushed migration. When the support window ends, a final 2.x release is deprecated with a message pointing at the migration guide.
Signs it went well
None of these are measured numbers; they are the qualitative signals a maintainer would look for:
- Upgrade questions in the issue tracker are about edge cases, not about the main renames.
- Issues reporting "my build broke" reference the migration guide rather than discovering the change cold.
- Downstream packages widen their ranges to
^2.8.0 || ^3.0.0without needing a code change, because the deprecation period let them adopt the new names early.
For the hands-on version of the migration-guide step, see writing a major version migration guide, and for warning design, deprecation warnings.