refactor(@angular/build): cache persistent binary translation buffers in i18n inliner - #33952
Merged
alan-agius4 merged 2 commits intoAug 28, 2026
Merged
Conversation
… in i18n inliner Persist binary SharedArrayBuffer translation layouts on disk in .angular/cache keyed by translation file integrity hash. The I18nInliner creates a dedicated #translationCache instance under namespace 'translations' alongside #transformedFileCache under namespace 'transforms'. During locale serialization, translationCache.getOrCreate deduplicates in-flight encoding and restores pre-built binary buffers directly from disk, skipping translation dictionary binary encoding on warm builds.
There was a problem hiding this comment.
Code Review
This pull request introduces persistent caching for binary translation buffers in the i18n inliner when a translationIntegrity hash is provided. It updates serializeTranslation to be asynchronous, allowing it to retrieve or store serialized translations in a new translations cache. Additionally, it renames the existing transform cache to transformedFileCache, adds a check to prevent duplicate locales in inlineAll, and includes comprehensive unit tests to verify the caching behavior and error handling. I have no feedback to provide as there are no review comments.
… batch request in i18n inliner Streamline WorkerPool initialization by removing global files Map from workerData. Instead of storing all file Blobs in workerData for the worker pool lifetime, pass code and sourcemap Blobs on demand per inlineFileBatch request. On the worker thread, loadFileData consumes the passed code Blob on initial cache misses and continues to cache pre-parsed OXC AST metadata in worker thread memory, preserving 100% of worker AST parsing speed while improving V8 Young Generation garbage collection.
alan-agius4
approved these changes
Aug 28, 2026
Collaborator
|
This PR was merged into the repository. The changes were merged into the following branches:
|
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.
Persist binary SharedArrayBuffer translation layouts on disk in .angular/cache keyed by translation file integrity hash.
The I18nInliner creates a dedicated #translationCache instance under namespace 'translations' alongside #transformedFileCache under namespace 'transforms'. During locale serialization, translationCache.getOrCreate deduplicates in-flight encoding and restores pre-built binary buffers directly from disk, skipping translation dictionary binary encoding on warm builds.