2025-11-21: Angular 21

Modernization

Migrating to Angular 21 has been made possible by previous changes in the code to change all the component state to be fully reactive:

  • all the input and output properties have been changed to signals.
  • all the public properties representing state have been changed to signals.
  • effects and computed signals were used wherever appropriate.
  • modules have been removed.

The next step towards zone-less code will be migrating components to OnPush. This will happen progressively. Currently, only some low-level libraries use OnPush.

Also, modernizing the code implied:

  • replacing class-based guards and interceptors with their functional counterparts.
  • removing JSONP support (no longer needed).

Tooling

As for tooling, we moved from npm to pnpm, which is more robust and efficient, and avoids ng serve issues with ARM-based CPUs. This implies:

(1) you need to install pnpm in your machine (update the version if required):

corepack enable
corepack prepare pnpm@10.24.0 --activate

(2) for any project using npm:

(2.1) remove node_modules and package-lock.json:

Remove-Item -Recurse -Force node_modules, package-lock.json

(2.2) in package.json change (place as a sibling of dependencies, before it; update the version to your pnpm version got via pnpm -v):

"packageManager": "pnpm@10.24.0",
  • add at the end (required for ARM compatibility):
"optionalDependencies": {
  "@rollup/rollup-win32-arm64-msvc": "^4.53.3"
},
"pnpm": {
  "overrides": {
    "rollup": "npm:@rollup/wasm-node"
  }
}

When running ng serve in Angular workspaces, ARM-based machines may raise issues, even if before everything worked. Build succeeds, but then on serving you might get this error: An unhandled exception occurred: Cannot find module @rollup/rollup-win32-arm64-msvc. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try npm i again after removing both package-lock.json and node_modules directory. Migration to pnpm and the above configuration should fix this issue.

(2.3) pnpm install to install packages. Commit pnpm-lock.yaml.