Skip to content

feat: adopt @softarc/native-federation 4.9.0 - #194

Merged
Aukevanoost merged 7 commits into
mainfrom
feat/core-4.9.0-next.2
Oct 28, 2026
Merged

Aukevanoost merged 7 commits into
mainfrom
feat/core-4.9.0-next.2

Conversation

@Aukevanoost

@Aukevanoost Aukevanoost commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Brings the adapter on par with core 4.9.0 and depends on @softarc/native-federation ~4.9.0.

Changes

  • i18n: translate every file the federation build writes (core#178). translateFederationArtifacts built its own file list from FederationInfo. Without denseChunking (core's default), the chunks of mapping and exposed bundles are missing from FederationInfo.chunks, so they were never copied into the other locales and 404'd there. The builder now passes collectOutputFiles(federationCache), which also covers source maps and extracted CSS. localize-translate copies non-JS files unchanged, so a translated locale gets the source locale's .map files.
  • Bundle kind (core#218). setup() picks the bundler with kind === 'shared', and disposeFederationContexts() disposes every bundle that isn't shared. The context no longer extends the deprecated NFBuildAdapterContext.
  • setup() replaces an existing context (core#203). A second setup() under the same name disposes the old context first, including the compiler plugin's reset of Angular's TS state (buildForFederation corrupts globalSharedCompilationState, causing "polyfills.ts missing from TypeScript compilation" on Linux #47). Core no longer reaches this path, so this is contract conformance only.
  • Removed dev, isMappingOrExposed and optimizedMappings from the normalized context options, since nothing read them.

No adapter change is needed for the other core PRs in next.0–next.2. The adapter already writes every file flat under absolute paths, sets entry on mapping and exposed outputs, and declares its own esbuild.

Release notes

  • mappingsFromWorkspace().package(prefix, cfg) is available from @angular-architects/native-federation/config (core#214).
  • In a typed config, passing platform or packageInfo to a mapping no longer compiles. An untyped .mjs config ignores them.
  • A mapping with build: 'default' now throws.
  • The bare-import check now also scans chunks of mapping and exposed bundles when denseChunking is off (core#178). An undeclared bare import in one of those chunks now warns, and with features.strictImports on, a build that passed before can fail.
  • chunks on a shared external without build: 'separate' or build: 'package' now warns and is ignored, because it only applies to an external with a bundle of its own (core#217). With cacheExternalArtifacts, the externals cache is now keyed on chunks, so the first build after upgrading misses the cache once.
  • Known issue, already present before this PR: with integrityHashes and i18n both on, the non-source locales get the source locale's remoteEntry.json, whose hashes don't match the translated files. feat(i18n): inline the source locale and refresh integrity hashes after translation #173 fixes this.

translateFederationArtifacts derived its file list from FederationInfo. Without
denseChunking (core's default) the chunks of mapping and exposed bundles are not
in FederationInfo.chunks, so they were never copied into the other locales and
404'd there. The builder now passes core's own list of written files
(collectOutputFiles), which also covers source maps and extracted css.
- Pick the bundler by the bundle `kind` core passes to setup(), and stop
  extending the deprecated NFBuildAdapterContext (core#218).
- A second setup() under the same name disposes the old context first, as the
  adapter contract now states (core#203).
- Drop dev, isMappingOrExposed and optimizedMappings from the normalized
  context options; nothing read them.
normalizeContextOptions no longer reads it.
@Aukevanoost Aukevanoost changed the title feat: adopt @softarc/native-federation 4.9.0-next.2 feat: adopt @softarc/native-federation 4.9.0 Oct 28, 2026
@Aukevanoost
Aukevanoost merged commit 78e62d1 into main Oct 28, 2026
1 check passed
Aukevanoost added a commit that referenced this pull request Oct 28, 2026
Backports 22.2.3..22.2.4 onto the Angular 21 layout.

Incoming:
- #167/#169: the dev server keeps federation externals out of the
  stylesheet build; Angular's ssr/prerender corrections reach serveWithVite.
- #166/#168: context tsconfigs pass `types` resolved instead of widening
  typeRoots.
- #173/#176/#186/#200: i18n translates every federation output, honours
  outputPath.browser, stays under the Windows command line limit, inlines
  the source locale only when requested and refreshes integrity hashes.
- #187/#190: optional-peer entry points are skipped only when the peer is
  missing; @angular/localize is an optional peer.
- #189/#195/#196: federation build results carry their entry; a path
  written twice is reported once.
- #194: @softarc/native-federation ~4.9.0, orchestrator ^4.9.0.

Angular 21 specific adaptations:
- Checked the #167/#169 assumptions against @angular/build 21.2.24:
  serveWithVite reads externalDependencies and ssr back from the options it
  passed, and the stylesheet bundler uses externalDependencies, as on 22.
- No // upstream: tags change (still angular-cli v21.2.19, 1a728258d6).
- Skipped #188/#198 (remote builder): this branch has no remote builder.
- Kept the internal builder without instrumentForCoverage; dropped it from
  the incoming spec.
- Moved output-entries and the i18n integration spec into src/utils.
- Skipped the `types: ["*"]` spec below TypeScript 6 (branch is on 5.9).
- @angular/localize optional peer/devDependency at >=21.2.0/^21.2.0.
- Kept the -v4 name, 21.2.16 version, ng21 pins and this branch's global
  pnpm overrides; main's vite 8 override doesn't apply to 21.2's vite 7.
- 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