Repository navigation
feat: Angular 19.2, 20.3, 21.2 and 22 are supported, as a matrix in CI checks them - #97
Merged
Merged
Conversation
…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
…nute for it, and try a second launch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
withIncrementalHydration()withIncrementalHydration()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.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 throughRESPONSE_INIT.compat/run.mjs --angular <minor|version|next> --mode <zoneless|zone>:withRoutes());--legacy-peer-deps, so a peer range that doesn't admit the version fails the install;@angular/ssrwould send them.hydrated. There are no console errors, and the server never falls back to a buffered render..github/workflows/compat.ymlruns it for 19.2, 20.3, 21.2, 22.0–22.3, the three floor patches and Angular'snext, each zoneless and with Zone.js: 22 cells. It runs on PRs that touchpackages/orcompat/, on main, and weekly.nextis allowed to fail, so it acts as an early warning.What the matrix found, fixed here
useClassbefore Angular 22, and withuseFactoryfrom 22 on.provideStreamHydration()only handled the factory, so hydration broke on 19–21 withcreateRegistry is not a function. It now takes either.withIncrementalHydration(), the server renders no@deferblock with ahydratetrigger, so nothing streams and nothing says why. A streamed render now warns about it, once. Checked on 21.2.Docs
compat/, and say the peer ranges only change together with the matrix.Checked
vp checkpasses. The fixture is excluded from lint;ng buildtype-checks it in every run.nx run-many -t build typecheck(30 projects) and the docs build pass.