refactor(@angular/build): cache file data and translations in i18n inliner worker - #33866
Open
clydin wants to merge 1 commit into
Open
refactor(@angular/build): cache file data and translations in i18n inliner worker#33866clydin wants to merge 1 commit into
clydin wants to merge 1 commit into
Conversation
…liner worker Add in-memory caching for decoded file contents, sourcemaps, and extracted localization AST metadata within the i18n inliner worker. Additionally, replace the single active translation slot with a per-locale map to retain deserialized translation tables across interleaved file requests.
There was a problem hiding this comment.
Code Review
This pull request introduces caching for file data and deserialized translation messages in the i18n inliner worker to improve performance. Specifically, it adds a fileDataCache and replaces the single-active-translation tracking with a map-based deserializedTranslations cache. It also refactors inlineFile and inlineCode to call inlineLocalize directly, removing the redundant transformWithOxc helper. The review feedback suggests further optimizing inlineFile by using Promise.all to run the asynchronous operations (fetching file data, reading the sourcemap, and loading translations) concurrently rather than sequentially.
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.
Add in-memory caching for decoded file contents, sourcemaps, and extracted localization AST metadata within the i18n inliner worker. Additionally, replace the single active translation slot with a per-locale map to retain deserialized translation tables across interleaved file requests.