Repository navigation
fix(ssr): Drop the host-instances bridge from the prod preload - #210
Merged
Merged
Conversation
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.
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.
The production SSR preload no longer passes
hostInstances: 'all'toinitNodeFederation.Why
The orchestrator resolves host instances before it installs the import map. With
'all'and the defaultload, every shared singleton was therefore imported straight fromnode_modules, which holds Angular's partial-compilation output, not the linked build. Every@angular/*import, including the host's own server bundle, was then routed to that copy. As a result, production SSR:JIT compilation failedforPlatformLocation,BrowserXhrandNoopAnimationDriver;isDevMode() === true;node_modulescore next to the@nf-internalchunks fromdist.Production doesn't need the bridge. The host's server bundle and the remotes resolve
@angular/*through the same import map, so there is one instance per package.Verification
Smoke test on a fresh clone of angular-examples (
angular/ssr, host + mfe1 + mfe2), Angular 22.2.6, orchestrator 4.10.0, Node 24.16, comparing the published 22.2.5 with this branch:JIT compilation failedin server outputisDevMode()truefalse@angular/coreresolves tonf-host:)dist/host/browser/_angular_core….js/,/todos,/insights/todos/1/todosrenders mfe1's./List, which uses@angular/core/rxjs-interop. No remote's import-map scope contains@angular/*orrxjs.Build, typecheck, knip and the 484 unit tests pass; lint has no errors.
The dev SSR entry is unchanged: it passes its own
load, which runs in the dev server's module graph.Part of #201, native-federation/orchestrator#130