Repository navigation
fix(builder): Write federation outputs as raw bytes - #183
Merged
Merged
Conversation
Writing outFile.text decoded every output as UTF-8, corrupting binary assets such as images and fonts. Closes #181.
Aukevanoost
added a commit
that referenced
this pull request
Oct 18, 2026
Backports 22.2.2..22.2.3 onto the Angular 21 layout. Incoming: - #177: i18n fails the build when localize-translate fails. - #178: init generates the v4 federation.config.mjs defaults (all of @angular/* shared with keepAll, denseExternals) and installs orchestrator ^4.8.0; the builder warns about flat externals and Angular packages shared without keepAll. - #182: cachePath builder option for the federation cache. - #183: federation outputs written as raw bytes. - @softarc/native-federation ~4.8.0, orchestrator ^4.8.0. Angular 21 specific adaptations: - None of the incoming changes touch @angular/build internals, so no // upstream: tags change (still angular-cli v21.2.19, 1a728258d6). - Skipped the remote builder schema/cachePath changes: this branch has no remote builder. - Kept the -v4 name, 21.2.15 version, ng21 pins and this branch's global pnpm overrides; main's nx>undici override isn't needed, the lock already resolves undici 7.29.1. - 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.
Fixes #181: the federation build now writes each esbuild output as raw bytes, so binary assets are no longer corrupted.
Changes
writeResult(src/tools/esbuild/angular-esbuild-adapter.ts) writesoutFile.contentsinstead ofoutFile.text.textdecodes the output as UTF-8, which replaced invalid byte sequences in images and fonts (e.g. from afileloader) with U+FFFD. This matches the esbuild adapter'swrite-result.ts.Tests
fs.writeFileSyncunchanged. It fails against the old.textwrite.contentsand checks for the bytes.pnpm typecheck,pnpm lintandpnpm testpass.Closes #181