SIGN IN SIGN UP

fix(angular): bump zoneJsVersion to ~0.16.0 to align with Angular v21 (#35799)

## Current Behavior

`@nx/angular`'s `zoneJsVersion` is pinned to `~0.15.0`, while
`catalogs.angular` in `pnpm-workspace.yaml` and the v21 migration entry
in `packages/angular/migrations.json` both pin `zone.js` at `~0.16.0`.
Generators and dependency-installation paths in `@nx/angular` therefore
emit `zone.js@~0.15.0` even when the project is on Angular 21, drifting
from what the migration and workspace catalog declare.

## Expected Behavior

`zoneJsVersion` matches the v21 pin (`~0.16.0`), keeping generator
output aligned with the workspace catalog and the v21 migration. The
bump is safe within Angular 21: `@angular/core@21.x` accepts `~0.15.0 ||
~0.16.0` (see `catalogs.angular-supported-versions` in
`pnpm-workspace.yaml`).

## Implementation Details

Bumps `zoneJsVersion` in `packages/angular/src/utils/versions.ts` from
`~0.15.0` to `~0.16.0`. The v21 entry in
`backward-compatible-versions.ts` inherits from `latestVersions` via
spread, so it picks up the bump automatically. The v20/v19 entries are
unchanged — those Angular majors correctly stay on `~0.15.0`.

Also extends `scripts/angular-support-upgrades/` so this drift doesn't
recur on the next Angular bump:

- `fetch-versions-from-registry.ts`: after the dist-tag fetch, resolves
`zone.js` and `rxjs` against the latest registry-published versions
matching `@angular/core@<resolved>`'s `peerDependencies` ranges. Skips
with a warning if a peer is missing or no satisfying version exists.
- `update-version-utils.ts`: adds regex bumps for `zoneJsVersion` and
`rxjsVersion` in `versions.ts`, guarded so they only run when the
version map carries those keys.

`update-package-jsons.ts` and `build-migrations.ts` need no changes —
their existing iteration over the version map already covers `zone.js`
(and `rxjs` where applicable) once the keys are populated.

`ngrxVersion` and the per-major back-compat blocks in
`backward-compatible-versions.ts` have similar drift risk but are out of
scope here (different mechanics; flagged for follow-up).

<!-- polygraph-session-start -->
---
[View session information
↗](https://snapshot.app.trypolygraph.com/orgs/69cdc268b6aa527e4129c2b4/sessions/fix-zone-js-version-b63af779)
<!-- polygraph-session-end -->

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
P
polygraph-snapshot-app[bot] committed
9371aa571d78023dca514b952eb0616fb0d3e3fe
Parent: 412a37a
Committed by GitHub <noreply@github.com> on 6/1/2026, 6:00:16 PM