Skip to content

feat: Angular 19.2, 20.3, 21.2 and 22 are supported, as a matrix in CI checks them - #97

Merged
ChristopherPHolder merged 2 commits into
mainfrom
feat/angular-compat
Nov 28, 2026
Merged

ChristopherPHolder merged 2 commits into
mainfrom
feat/angular-compat

Conversation

@ChristopherPHolder

Copy link
Copy Markdown
Collaborator

Closes #91.

The packages now support Angular 19.2, 20.3, 21.2 and 22. The range isn't a guess: it's what a CI matrix proves by building and running a real Angular CLI app against each version, zoneless and with Zone.js.

Compatibility

Angular From Zoneless Zone.js What the app needs
22 22.0.0 Yes Yes Nothing extra: incremental hydration is on by default
21.2 21.2.13 Yes Yes withIncrementalHydration()
20.3 20.3.21 Yes Yes withIncrementalHydration()
19.2 19.2.22 Yes Yes withIncrementalHydration(), provideExperimentalZonelessChangeDetection()

Peer ranges in every package: ^19.2.22 || ^20.3.21 || ^21.2.13 || ^22.0.0 || ~22.3.0-rc.0. The last part keeps the workspace's ngp pin inside the range.

Why those floors. Below each "From", and in 19.0, 19.1, 20.0–20.2, 21.0 and 21.1, two security fixes are missing. Angular only backported them to the last minor of each major:

  • ɵisHostAllowed, the server's host check, which the core imports. Without it the build fails.
  • Passing the server platform to bootstrapApplication(), which the renderer bootstraps through.

I found both floors by bisecting the published packages, then ran the floor patches themselves in the matrix. Angular 18 has no incremental hydration at all.

How it's checked

  • compat/fixture: an Angular CLI app that compiles on every supported version. It has a streamed route, a route with its own status and header, a redirect, a prerendered route, a client-rendered route, and a 404 set through RESPONSE_INIT.
  • compat/run.mjs --angular <minor|version|next> --mode <zoneless|zone>:
    • copies the fixture and writes in what differs between versions: the change detection provider, and the server config (19 has no withRoutes());
    • installs that Angular with the packages packed from the repo. It doesn't pass --legacy-peer-deps, so a peer range that doesn't admit the version fails the install;
    • builds and runs it, then checks the server's timing and responses, then the browser.
  • Server checks: the shell arrives before the data and the widget follows in a chunk, on two requests in the same process. The route's status and header, the redirect, the 404, the prerendered page and the client route all come out as @angular/ssr would send them.
  • Browser checks (headless Chrome over CDP, no dependencies), against a production build and a development build: the widget hydrates from server HTML and answers a click. In development, Angular reports its nodes hydrated. There are no console errors, and the server never falls back to a buffered render.
  • .github/workflows/compat.yml runs it for 19.2, 20.3, 21.2, 22.0–22.3, the three floor patches and Angular's next, each zoneless and with Zone.js: 22 cells. It runs on PRs that touch packages/ or compat/, on main, and weekly. next is allowed to fail, so it acts as an early warning.

What the matrix found, fixed here

  • The dehydrated block registry is provided with useClass before Angular 22, and with useFactory from 22 on. provideStreamHydration() only handled the factory, so hydration broke on 19–21 with createRegistry is not a function. It now takes either.
  • Incremental hydration is only on by default from Angular 22. Before that, without withIncrementalHydration(), the server renders no @defer block with a hydrate trigger, so nothing streams and nothing says why. A streamed render now warns about it, once. Checked on 21.2.

Docs

  • Installation page: the requirements name the supported versions, and a new "Compatibility" section has the table, what isn't supported and why, and how a new minor gets added.
  • Angular CLI page: a section for Angular 19 to 21.
  • Pages that said "narrow range" (limitations, the streaming SSR concept page) now point at the table.
  • READMEs and AGENTS.md: the core README, the root README (layout table and the release note) and AGENTS.md describe compat/, and say the peer ranges only change together with the matrix.

Checked

  • All 22 matrix cells pass locally, on Node 26. Two of them also ran on Node 22, which CI uses.
  • vp check passes. The fixture is excluded from lint; ng build type-checks it in every run.
  • nx run-many -t build typecheck (30 projects) and the docs build pass.

…I checks them

compat/ is an Angular CLI app that compiles on every supported version, and
compat/run.mjs installs one version into a copy of it, with the packages packed
from the repository, builds it and checks it: the shell before the data and the
widget in a chunk after it, @angular/ssr's statuses, headers, redirects,
prerendered and client routes, and in headless Chrome the widget hydrated from
server HTML (with Angular's dev-mode checks too) and answering a click.
.github/workflows/compat.yml runs it for the newest patch of every supported
minor, the lowest supported patch of each older major and Angular's next,
zoneless and with Zone.js.

What the matrix found and fixed on the way:

- Before Angular 22, the dehydrated block registry is provided with useClass,
  not useFactory; provideStreamHydration() takes either.
- Before 22, incremental hydration is off unless withIncrementalHydration() is
  added, and then nothing streams. A streamed render now warns once when it is.

The peer ranges are what the matrix proves:
^19.2.22 || ^20.3.21 || ^21.2.13 || ^22.0.0 || ~22.3.0-rc.0. Older patches
and minors lack Angular's host check and passing the platform to
bootstrapApplication(), two security fixes Angular only backported to the last
minor of each major. The installation page has the table.

Closes #91
@ChristopherPHolder
ChristopherPHolder merged commit 33cfef2 into main Nov 28, 2026
24 checks passed
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.

Support Angular 19, 20 and 21, with a compatibility table checked in CI

1 participant