Repository navigation
refactor(@angular/build): cache persistent binary translation buffers in i18n inliner - #33952
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.
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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.