Skip to content
← All workIn progress

Angular 10 → 21 SPA Migration

Engineered the migration of a council case-management SPA across eleven Angular major versions, evaluating a zoneless standalone rewrite, a scaffold-and-port and an in-place upgrade against the same OData backend.

Role
Front-end engineer · migration strategy & architecture
Year
2026
Type
Full-stack platforms
Stack
Angular 21 · TypeScript 5.9 · RxJS 7.8 · PrimeNG 21 · Vitest · Chart.js 4 · Bootstrap 5 · GOV.UK Frontend 5 · OData
Angular major versions spanned
11
components migrated
~86
migration strategies evaluated
3

The problem

A local authority's casework SPA for FOI requests, member enquiries and complaints was stuck on Angular 10, eleven majors behind, with dependencies that had reached end of life or broken compatibility: PrimeNG theming, Chart.js 2, @angular/animations, Karma/Protractor and TSLint. Version-by-version upgrades were slow, a rewrite of about 86 components was large, and every feature had to keep working.

Architecture

  1. 01

    Baseline

    Angular 10.2, PrimeNG 10, Bootstrap 4 with jQuery, RxJS 6, webpack browser builder, Karma/Protractor and TSLint.

  2. 02

    Scaffold

    Fresh Angular 21.1 CLI project with every runtime dependency at current versions, build verified green before porting began.

  3. 03

    Port

    About 86 components and 400+ files copied in, compiler errors resolved against a written error-to-fix migration guide.

  4. 04

    Modernise

    Layout shell converted to standalone components with @if control flow, migrating outward from the shell towards feature modules.

  5. 05

    Rewrite track

    Parallel greenfield build using signals, functional guards and interceptors, and zoneless change detection.

  6. 06

    Toolchain

    @angular/build:application builder, Vitest on jsdom, code-configured PrimeNG Aura theming and tightened bundle budgets.

Engineering highlights

  • 01

    Three strategies, side by side

    Ran a zoneless standalone rewrite, a scaffold-and-port and an in-place 10 → 13 upgrade in parallel, weighing rewrite cleanliness against port speed and incremental safety on an 86-component codebase.

  • 02

    Zoneless, signal-based rewrite

    The greenfield track uses standalone components only, signals for auth state, a functional authGuard reading role and claim types from route data, a functional bearer-token interceptor and provideZonelessChangeDetection.

  • 03

    Deliberate change-detection split

    The port keeps zone.js with event coalescing on purpose to match legacy behaviour during migration, while the rewrite goes fully zoneless, separating framework-behaviour risk from porting risk.

  • 04

    Build and test overhaul

    Replaced the webpack browser builder, polyfills and global jQuery, Bootstrap and Chart.js scripts with the application builder, and Karma/Jasmine/Protractor with Vitest on jsdom; bundle budgets cut back to 1 MB / 2 MB.

  • 05

    Theming and animation migration

    Moved PrimeNG from CSS theme files to a code-configured Aura preset via providePrimeNG, and dropped @angular/animations for native CSS enter/leave animations, in line with PrimeNG 21's CSS-based approach.

  • 06

    Security model carried across

    JWT login with MFA, role- and claim-based route guards, structural directives for template-level authorisation and token-expiry auto-logout preserved, with map keys fetched from the backend API registry, not shipped to the client.

Next projectAI User-Story Assistant for CRM