Skip to content

refactor(@angular/build): use translation integrity for i18n inlining cache keys - #33859

Merged
clydin merged 1 commit into
angular:mainfrom
clydin:perf/i18n-inliner-cache-key
Aug 14, 2026
Merged

refactor(@angular/build): use translation integrity for i18n inlining cache keys#33859
clydin merged 1 commit into
angular:mainfrom
clydin:perf/i18n-inliner-cache-key

Conversation

@clydin

@clydin clydin commented Aug 13, 2026

Copy link
Copy Markdown
Member

Avoid full JSON serialization and hashing of the in-memory translation dictionary for each locale when computing persistent cache keys. Instead, use the combined translation file integrity hashes and the installed @angular/localize package version when available, falling back to the in-memory translation object if integrity is absent.

@clydin clydin added the target: minor This PR is targeted for the next minor release label Aug 13, 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 enhances the i18n inlining process by introducing localizeVersion and translationIntegrity to improve caching efficiency. It resolves the @angular/localize package version from its manifest and computes a combined integrity string from translation files. The review feedback suggests simplifying the manual loop used to build translationIntegrity with declarative array methods, and using optional chaining when reading the parsed package manifest to prevent a potential runtime error if the manifest is null.

Comment thread packages/angular/build/src/builders/application/i18n.ts
Comment thread packages/angular/build/src/builders/application/i18n.ts
@clydin
clydin force-pushed the perf/i18n-inliner-cache-key branch from 6e4bc56 to c22f040 Compare August 13, 2026 19:02
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 13, 2026
@clydin
clydin requested a review from alan-agius4 August 13, 2026 20:00
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Aug 14, 2026
… cache keys

Avoid full JSON serialization and hashing of the in-memory translation
dictionary for each locale when computing persistent cache keys. Instead,
use the combined translation file integrity hashes and the installed
`@angular/localize` package version when available, falling back to the
in-memory translation object if integrity is absent.
@clydin
clydin force-pushed the perf/i18n-inliner-cache-key branch from c22f040 to 23878ff Compare August 14, 2026 13:31
@clydin
clydin merged commit d827ba9 into angular:main Aug 14, 2026
39 checks passed
@clydin

clydin commented Aug 14, 2026

Copy link
Copy Markdown
Member Author

This PR was merged into the repository. The changes were merged into the following branches:

@clydin
clydin deleted the perf/i18n-inliner-cache-key branch August 14, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker 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.

2 participants