Skip to content

refactor(@angular/build): remove unused options and dead code from i18n inliner - #33933

Open
clydin wants to merge 2 commits into
angular:mainfrom
clydin:refactor/i18n-inliner-cleanup
Open

refactor(@angular/build): remove unused options and dead code from i18n inliner#33933
clydin wants to merge 2 commits into
angular:mainfrom
clydin:refactor/i18n-inliner-cleanup

Conversation

@clydin

@clydin clydin commented Aug 26, 2026

Copy link
Copy Markdown
Member

Remove obsolete and unused options from the I18nInliner options and workerData.

The shouldOptimize option is removed from I18nInlinerOptions, workerData,
and cache base key calculation since inliner AST transformations do not perform
code optimization. The translations option is also removed from I18nInlinerOptions
and workerData because translations are provided per batch request.

In addition, the unused single-file inlineFile worker action and interface are
removed, and InlineFileBatchRequest is updated to model locales as a
ReadonlyMap to enforce locale key uniqueness.

…8n inliner

Remove obsolete and unused options from the I18nInliner options and workerData.

The `shouldOptimize` option is removed from `I18nInlinerOptions`, `workerData`,
and cache base key calculation since inliner AST transformations do not perform
code optimization. The `translations` option is also removed from `I18nInlinerOptions`
and `workerData` because translations are provided per batch request.

In addition, the unused single-file `inlineFile` worker action and interface are
removed, and `InlineFileBatchRequest` is updated to model `locales` as a
`ReadonlyMap` to enforce locale key uniqueness.
@clydin clydin added the target: minor This PR is targeted for the next minor release label Aug 26, 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 refactors the i18n inlining and translation encoding/reading system to use the specific ɵParsedTranslation type from @angular/localize instead of generic unknown types, improving type safety. It also cleans up unused options (such as shouldOptimize and translations), removes the unused inlineFile worker function, and refactors locales to use a ReadonlyMap. A review comment points out an opportunity to improve type safety further by passing the generic type parameter T to SharedTranslationDictionary inside createSharedTranslationProxy.

Comment thread packages/angular/build/src/tools/esbuild/i18n-translation-reader.ts Outdated
Replace untyped Record<string, unknown> translation dictionaries with
Record<string, ɵParsedTranslation> throughout the i18n inliner and related
utilities.

The SharedTranslationDictionary and createSharedTranslationProxy utilities now
default to ɵParsedTranslation with generic support for custom value types in
unit tests.
@clydin
clydin force-pushed the refactor/i18n-inliner-cleanup branch from ac053d5 to 65b7a2b Compare August 26, 2026 14:08
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 26, 2026
@clydin
clydin requested a review from alan-agius4 August 26, 2026 15:39
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