Skip to content

feat: Support Angular 22.3 - #215

Merged
Aukevanoost merged 2 commits into
mainfrom
feat/angular-22.3
Nov 27, 2026
Merged

Aukevanoost merged 2 commits into
mainfrom
feat/angular-22.3

Conversation

@Aukevanoost

@Aukevanoost Aukevanoost commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Moves the adapter to Angular 22.3 (@angular/build ~22.3.0). Users on Angular 22.2 stay on adapter 22.2.x.

Changes

  • @angular/build, @angular/localize and @angular-devkit/* move to 22.3.

  • ng add fix: @angular-devkit/schematics 22.3 adds an exports map, which blocks our tasks/index.js import. The init schematic now imports from @angular-devkit/schematics/tasks. Without this, ng add fails on 22.3 with "Missing ./tasks/index.js specifier".

  • Remote builder assets: the copied asset code now includes the 22.3 upstream fixes:

    • Roots are matched with isSubDirectory, so our old deliberate divergence is now upstream behaviour (angular/angular-cli 58c30c05f6).
    • expandDirectories: false: a glob that names a directory no longer copies its contents (65f302c5df).
    • .gitkeep is ignored in nested folders too, not only at the input root.
    • User ignores go through Angular's new directory normalization. tinyglobby already skipped ignored folders, so we found no case where the copied files change.
    • A glob with no wildcards is looked up with a stat instead of a glob.
    • An asset that would be written outside the output path throws.

    One deliberate difference: entries are resolved one at a time instead of with Angular's bounded mapConcurrent. The parity spec covers the nested .gitkeep and directory-glob changes, and a watch-mode case for a changed file matched by a literal glob.

  • All // upstream: tags point at v22.3.0 (bdda8bbf1b). Apart from the asset helpers, none of the code we copied changed upstream.

Checked in the 22.3.0 release, no change needed

  • Cache folder per project and builder (5ffed3f3b6): Angular's own cache for a federated app moves to .angular/cache/22.3.0/<project>/build/ (checked in the SSR example). Our federation cache (cachePath) is separate, and nothing in the adapter depends on Angular's cache layout.
  • Single Domino copy in server bundles (f15c8c641): this only applies to bundles Angular builds itself. Our shared @angular/platform-server bundle keeps its own copy, as on 22.2.
  • Quoted paths in generated imports (e3787076e): we generate no esbuild virtual modules like the ones that were fixed.
  • Compiler and BundlerContext changes: the /private types still compile and all specs pass.
  • The new library builder and the ng-packagr deprecation: these don't affect the adapter.

Testing

pnpm typecheck, pnpm lint, pnpm test (503 passing), pnpm knip and pnpm build all pass.

SSR smoke test with the federated SSR example from angular-examples (host, mfe1, mfe2) on Angular 22.3.0, using this branch's packed build:

  • All three apps build with no errors or warnings. Angular's new Domino global (ɵdomino) is in the server bundles.
  • The host starts with federation initialised for both remotes (/healthz reports mfe1, mfe2 and the host).
  • /, /todos, /todos/:id and /insights return 200 with the remote components rendered on the server, and no errors appear in any server log.
  • Not checked: browser hydration and ng serve (dev SSR).

- Move @angular/build, @angular/localize and @angular-devkit/* to 22.3
- Import NodePackageInstallTask from @angular-devkit/schematics/tasks: the
  22.3 exports map blocks the tasks/index.js path, which broke ng add
- Port the 22.3 asset fixes to the remote builder: isSubDirectory root
  matching, expandDirectories: false, nested .gitkeep and directory
  ignores, the literal-glob fast path and the destination escape check
- Bump every upstream tag to v22.3.0 (bdda8bbf1b)
- The directory-ignore case keeps a file that must survive and no longer
  claims new 22.3 behaviour
- Cover a changed file matched by a literal glob in copyChangedAssets
@Aukevanoost
Aukevanoost merged commit c455887 into main Nov 27, 2026
1 check passed
Aukevanoost added a commit that referenced this pull request Nov 27, 2026
Backports 22.2.5..22.3.0 onto the Angular 21 layout.

Incoming:
- #214: @softarc/native-federation ~4.11.0; fromPackageJson() takes an
  optional base config and autoShareScope resolves projectPath against
  workspaceRoot.
- #171/#213: rewriteModulePreloads (./ssr export) for native import maps.
- #209: ngServerMode is set in exposed-module bundles.
- #210: the prod node preload no longer passes hostInstances.
- #215: NodePackageInstallTask comes from @angular-devkit/schematics/tasks.
- Tag-triggered release workflow (staged npm publish).

Angular 21 specific adaptations:
- Left out the Angular 22.3 bump: kept the -v4 name, 21.2.18 version and
  ng21 pins; bumped @softarc/native-federation to 4.11 by hand.
- Kept the `// upstream:` tags at v21.2.19 (1a728258d6) and the 21.2
  debugOptimize note.
- Dropped the remote builder, share-utils.spec.ts and
  tools/esbuild/sourcemap-ignorelist-plugin.ts as before.
- @angular/ssr 21.2 emits the same modulepreload markup as 22, so
  rewriteModulePreloads applies unchanged.
- follow-redirects@1 override raised to ^1.16.2 for a high advisory.
- pnpm-lock.yaml regenerated rather than merged.
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