Skip to content

chore: upgrade to Angular 22 + TypeScript 6.0, extend compat matrix to 18–22#1621

Merged
CodeAndWeb merged 3 commits into
developfrom
chore/angular-22
Jun 9, 2026
Merged

chore: upgrade to Angular 22 + TypeScript 6.0, extend compat matrix to 18–22#1621
CodeAndWeb merged 3 commits into
developfrom
chore/angular-22

Conversation

@CodeAndWeb

Copy link
Copy Markdown
Member

Brings the dev workspace (library build toolchain + test-app) from Angular 21.2.8 → 22.0.0 and extends the cross-version compat matrix to cover Angular 18–22. The published library version (18.0.0-rc.3) and the @angular/core >=18 peer floor are unchanged — this is a toolchain upgrade, not a release.

Workspace upgrade

  • ng update to @angular/* ^22, @angular/cli/@angular/build/@angular/compiler-cli/ng-packagr ^22, angular-eslint ^22; pinned typescript ~6.0, typescript-eslint ^8.61, zone.js ~0.16.
  • Kept the schematic's behavior-preserving migrations, but made them cross-version safe so the shared source still compiles under Angular 18–21 in the matrix:
    • demo components use ChangeDetectionStrategy.Default (identical to v22's Eager, but exists in all versions) instead of the v22-only Eager;
    • withXhr() kept only in the test-app bootstrap; dropped from the http-loader specs (inert there under provideHttpClientTesting(), and the symbol doesn't exist on older Angular).
  • Reverted the migration's extendedDiagnostics suppressions — the library builds clean with nullishCoalescing/optionalChain diagnostics on.
  • Lint: the shipped libraries lint clean; one block-directive spec now signal-drives its property-change test so it passes under the v22 OnPush default (no CD override, no suppression). Honored the ^_ unused-var convention in eslint config (removed one inline disable). Added a best-effort lint target + config for test-app.

Compat matrix

  • Extended to a18, a19, a20, a21, latest(=22); dropped a16 (below the >=18 floor).
  • test-and-build-for-all.sh: lint is best-effort/non-fatal and skipped where no lint target exists; config restored unconditionally via trap restore_latest EXIT.
  • Added compat/consume/ — an artifact-consumability gate that type-checks the packed v22/TS6 .d.ts against TS 5.5–5.9 with skipLibCheck:false.

Verification (all green)

  • build-all + test-ci (448 tests) + lint + ng build test-app on Angular 22.
  • Manual smoke check: language switching updates correctly.
  • Full matrix: build + test green on Angular 18 / 19 / 20 / 21 / 22.
  • Consumability gate green for a18–a21 — the v22 .d.ts is consumable down to the >=18 peer floor.
  • Lint best-effort: a21/latest clean; a20 fails only on a typescript-eslint@8.2.0 rule-loading skew (non-fatal, documented).

Follow-up (not in this PR)

Matrix-script reproducibility (corepack prepare pnpm@latest + lockfile deletion) is tracked separately; this PR adds packageManager pins to a19/a20 as the minimal unblock.

🤖 Generated with Claude Code

- ng update @angular/* @angular/cli @angular/build @angular/compiler-cli
  ng-packagr angular-eslint to v22; pin typescript ~6.0, typescript-eslint
  ^8.61, zone.js ~0.16
- keep the v22 schematic migrations but make them cross-version safe so the
  shared source still compiles under Angular 18-21 in the compat matrix:
  - demo components use ChangeDetectionStrategy.Default (identical to the
    schematic's v22-only Eager, value 1) to preserve eager rendering
  - keep withXhr() only in the test-app bootstrap (real backend); drop it from
    the http-loader specs, where provideHttpClientTesting() makes it inert and
    the symbol does not exist on older Angular
- drop the migration's extendedDiagnostics suppressions; library source builds
  clean with nullishCoalescing/optionalChain diagnostics on
- block-directive spec: signal-drive the property-change test so it passes under
  the v22 OnPush default
- honor the ^_ unused-var convention in eslint config (removes one inline
  disable in translate.store)
- add a best-effort lint target + config for test-app
- compat/latest bumped to Angular 22 / TS 6.0 / zone.js 0.16 / typescript-eslint
  8.61; new compat/a21 snapshots the previous Angular 21 latest
- drop compat/a16 (below the published >=18 peer floor)
- test-and-build-for-all.sh: split 21 from latest, add a21 to the matrix, make
  lint best-effort + non-fatal (skipped where no lint target exists), and
  restore the latest config unconditionally via 'trap restore_latest EXIT'
- pin a Node-compatible packageManager in a19/a20 (were unpinned, so corepack
  fell back to pnpm@latest, which crashes under Node 18); reproducible-toolchain
  rework remains the deferred backlog item
- add compat/consume: an artifact-consumability gate that type-checks the packed
  v22/TS6 .d.ts against TS 5.5-5.9 with skipLibCheck:false (a18-a21), proving the
  single source line is consumable down to the >=18 peer floor

Full matrix green (build + test) on Angular 18/19/20/21/22; consumability gate
green for all four older toolchains. Lint best-effort: a21/latest clean, a20
fails on a typescript-eslint 8.2.0 rule-loading skew (documented, non-fatal).
Angular 22's CLI requires Node >=22.22.3, so the Latest build matrix can
never pass on Node 20.x; its failure fail-fast-cancelled the healthy 22.x
and 24.x legs. Drop 20.x from the Latest matrix.

The compat 'Angular 21' entry still copied compat/latest, which is now
Angular 22 — so 21 was untested and 22 ran twice. Point it at the new
compat/a21 dir, giving a true 18-21 compat sweep plus 22 via Latest.
@CodeAndWeb CodeAndWeb merged commit 2542123 into develop Jun 9, 2026
6 checks passed
@CodeAndWeb CodeAndWeb deleted the chore/angular-22 branch June 9, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant