chore: upgrade to Angular 22.2 - #144
Merged
Merged
Conversation
@angular/build 22.2 reworked the private APIs the federation build uses: - JavaScriptTransformer takes maxConcurrency in its options and an options object in transformData; Cache no longer takes a namespace. - The transformer hashes cache keys with xxhash-wasm, which must be loaded via initializeHash() first. It is not exported from @angular/build/private, so load the exact module the transformer uses. - SourceFileCache is no longer a Map of parsed sources; the watch list now comes from typeScriptFileCache and referencedFiles only.
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.
Bumps
@angular/buildand the devkit packages to 22.2. 22.2 reworks the private APIs the federation build uses (Babel → oxc linker/transformer, new cache layer, new watcher), which broke the build in three places:JavaScriptTransformer/Cachesignatures —maxThreadsmoved into the options asmaxConcurrency,transformDatatakes an options object ({ skipLinker }), andCacheno longer takes a namespace.initializeHash()first (Angular's own compiler plugin does it inonStart). Without it every build fails withHash utility must be initialized by awaiting initializeHash() before use, which typecheck doesn't catch.initializeHashisn't exported from@angular/build/privateand theexportsmap only allows.and./private, so it's loaded by absolute path from@angular/build/package.json— the same module instance the transformer uses. This relies on Angular's internal file layout.SourceFileCacheis no longer aMap— the parsedts.SourceFilecache moved into the TypeScript compilation, sofederationSourceFilesdropscache.keys()and usestypeScriptFileCache+referencedFilesonly.Everything else we import from
@angular/buildstill typechecks, and theNG_BUILD_*env replay still findsenvironment-options.jswith the same exports.pnpm typecheck,pnpm test(256/256) andpnpm buildpass;pnpm linthas no errors.Possible follow-up
22.2 adds a
rootFilesoption to the compiler plugin that restricts the TypeScript root names (keeping the tsconfig's.d.tsfiles). It could replace the per-context tsconfig written bywrite-context-tsconfig.ts(#138). Not needed for this upgrade.