Skip to content

refactor(@angular/build): cache file data and translations in i18n inliner worker - #33866

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:perf/i18n-worker-in-memory-caching
Open

refactor(@angular/build): cache file data and translations in i18n inliner worker#33866
clydin wants to merge 1 commit into
angular:mainfrom
clydin:perf/i18n-worker-in-memory-caching

Conversation

@clydin

@clydin clydin commented Aug 14, 2026

Copy link
Copy Markdown
Member

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.

…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.
@clydin clydin added the target: minor This PR is targeted for the next minor release label Aug 14, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/angular/build/src/tools/esbuild/i18n-inliner-worker.ts
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 14, 2026
@clydin
clydin requested a review from alan-agius4 August 14, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/build target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant