01Why big-bang upgrades fail

The tempting plan is a long-lived upgrade branch that jumps straight to the latest version. In practice that branch drifts further from main every day, merge conflicts pile up, and the team ends up pausing feature work to land it.

On a live accounting SaaS we went from Angular 16 to 21 while the product kept shipping. The difference wasn't a clever tool. It was treating each major version as its own small release, merged to main and deployed before starting the next.

If you haven't run an Angular upgrade before, it helps to know what ng update does. It bumps the Angular packages in package.json, then runs the migration scripts that ship with each new version. Those scripts rewrite your code for that version's breaking changes. Angular's release guide is explicit about the order: to cross several majors, "perform each update one major version at a time". Jump from 16 straight to 22 and you skip five sets of migrations, which leaves you doing their work by hand.

02The playbook

  1. 01

    One major version per step

    ng update @angular/core@17 @angular/cli@17, fix, test, ship. Then 18. Angular's migrations are written for one-version jumps; skipping them means doing their work by hand.

  2. 02

    Check Node and TypeScript first

    Each major has its own supported ranges. Angular 20 needs TypeScript 5.8 and Node 20.19, 22.12 or 24. Angular 22 moves to TypeScript 6.0 and Node 22.22, 24.15 or 26. Bump CI images and local tooling before running ng update, not after the build fails.

  3. 03

    Upgrade dependencies with the framework

    Component libraries, CDK and tooling move in lockstep with Angular. Check each library's supported range before every step, not after the build breaks.

  4. 04

    Run the optional schematics deliberately

    Control flow, standalone, signal inputs and inject() migrations are optional. Run them as separate, reviewable commits, never mixed with the version bump.

  5. 05

    Keep main deployable

    Each step merges to main within days. If a step takes longer, it's too big. Split the dependency upgrade from the code changes.

  6. 06

    Start clean, let the CLI commit

    ng update refuses to run on a working tree with uncommitted changes unless you pass --allow-dirty. Don't. Start clean and add --create-commits, so each migration lands as its own commit you can review or revert.

  7. 07

    Lean on the type checker

    Strict templates and TypeScript catch most breaking changes at compile time. Turn on strictTemplates early; it pays for itself during upgrades.

  8. 08

    Smoke-test the risky screens

    Overlays, dialogs, forms with custom value accessors and anything with third-party DOM integration. That's where silent regressions hide.

03Adopting modern Angular along the way

An upgrade is the cheapest moment to adopt new patterns, but only if you separate "it builds on the new version" from "it uses the new features". We landed each version first, then adopted standalone components, the new @if/@for control flow and OnPush as separate, incremental changes.

That separation matters for review and for rollback. A reviewer can approve a 400-file control-flow migration because it's mechanical and nothing else changed in that commit.

On a large app, most of these migrations also accept a --path option, so you can run them one feature folder at a time instead of across the whole workspace. That keeps each pull request small and gives you a natural order: start with the feature the team is about to touch anyway.

The signal migrations are more cautious than people expect. signal-input-migration and signal-queries-migration skip any input or query they can't convert safely, so a "finished" run can still leave decorator-based code behind. --best-effort-mode converts more aggressively, and --insert-todos leaves a comment explaining each one it skipped. I'd run the default mode with --insert-todos first, then work through the TODOs by hand.

04The commands, in order

This is the loop for each major version. The optional migrations run after the version lands, each in its own commit, so every change is reviewable and revertible on its own.

terminal
# 0. clean working tree, Node and TypeScript in range for the target version
git status

# 1. one major version at a time
ng update @angular/cli@^18 @angular/core@^18 --create-commits
ng update primeng@18          # keep the component library in lockstep
npm run build && npm test     # fix, commit, ship to main

# 2. optional migrations: separate commits, one feature folder at a time
ng generate @angular/core:control-flow --path src/app/features/billing
ng generate @angular/core:standalone --path src/app/features/billing
ng generate @angular/core:signal-input-migration --path src/app/features/billing
ng generate @angular/core:output-migration --path src/app/features/billing
ng generate @angular/core:inject --path src/app/features/billing
ng generate @angular/core:cleanup-unused-imports

# 3. repeat for 19, 20, 21 and 22

Run each migration only when your version has it, and read its page in the Angular migrations reference first. Some change runtime behaviour as well as syntax. The control-flow migration, for example, documents a change in how @for reuses views.

05The last step: 21 to 22

Our project's story ends at 21. Angular 22 shipped on 3 June 2026, and the step from 21 to 22 uses the same loop with one extra piece of preparation: tooling.

The two version ranges barely overlap, and that decides the order. Angular 21 runs on Node 20.19, 22.12 or 24, while Angular 22 needs Node 22.22, 24.15 or 26. Both versions accept those newer Node releases, so move CI images and local machines to one of them while you're still on 21, and ship that as its own change. TypeScript can't move early in the same way. Angular 21 accepts TypeScript 5.9 but not 6.0, and Angular 22 requires 6.0, so the TypeScript bump has to land in the same commit as the Angular update.

Once you're on 22, the resource APIs (resource, rxResource and httpResource) are stable, which makes it a good moment to revisit how screens load data. I cover that in Signals vs. RxJS in Angular. Treat it like the other optional migrations: after the version lands, in its own pull requests.

The support windows are the business case for not waiting. Each major gets about 12 months of active support and then 12 months of long-term support. Angular 19 and everything older is already out of support, Angular 20's long-term support ends on 28 November 2026, and Angular 21 is covered until June 2027. A team that is still on 16 is five steps away from a supported version, and that distance only grows if the steps keep getting postponed.

The takeaway

Upgrade one major version at a time, merge each to main quickly, and keep "builds on the new version" separate from "uses the new features". Done that way, even a six-version jump is just a series of ordinary releases.

Sources

Written by Jaymin MahetaSenior UI/UX Developer turning Figma designs into fast, accessible enterprise apps in Angular and React.
About me →