refactor(@angular/build): remove unused options and dead code from i18n inliner - #33933
Open
clydin wants to merge 2 commits into
Open
refactor(@angular/build): remove unused options and dead code from i18n inliner#33933clydin wants to merge 2 commits into
clydin wants to merge 2 commits into
Conversation
…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.
There was a problem hiding this comment.
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.
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
force-pushed
the
refactor/i18n-inliner-cleanup
branch
from
August 26, 2026 14:08
ac053d5 to
65b7a2b
Compare
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.
Remove obsolete and unused options from the I18nInliner options and workerData.
The
shouldOptimizeoption is removed fromI18nInlinerOptions,workerData,and cache base key calculation since inliner AST transformations do not perform
code optimization. The
translationsoption is also removed fromI18nInlinerOptionsand
workerDatabecause translations are provided per batch request.In addition, the unused single-file
inlineFileworker action and interface areremoved, and
InlineFileBatchRequestis updated to modellocalesas aReadonlyMapto enforce locale key uniqueness.