FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

refactor(@angular/build): optimize i18n locale polyfill data bundling per locale by clydin · Pull Request #33921 · angular/angular-cli · GitHub

refactor(@angular/build): optimize i18n locale polyfill data bundling per locale - #33921

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
clydin:perf/i18n-locale-polyfill-optimization
Aug 26, 2026
Merged

refactor(@angular/build): optimize i18n locale polyfill data bundling per locale#33921
alan-agius4 merged 1 commit into
angular:mainfrom
clydin:perf/i18n-locale-polyfill-optimization

Conversation

clydin commented Aug 25, 2026

Copy link
Copy Markdown
Member

Inject global Angular locale data scripts on-demand into each locale's polyfill bundle during inlining instead of bundling all active locale datasets into a single shared polyfill output file.

The loadLocaleData utility resolves and caches @angular/common/locales/global data per locale. During inlining, i18n-inliner-worker injects the specific locale data script alongside ___NG_LOCALE_INSERT___ in the polyfill bundle. This eliminates cross-locale bundle bloat so users download only the exact locale data needed for their targeted locale.

clydin added the target: minor This PR is targeted for the next minor release label Aug 25, 2026
clydin marked this pull request as ready for review August 25, 2026 21:35

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Code Review

This pull request refactors the Angular locale data resolution and loading logic out of the esbuild plugin into reusable helper functions, and integrates them into the i18n inliner worker to inject locale data directly alongside locale insertion sites. Feedback on these changes highlights two main issues: first, appending the locale data script to every insertion site can cause duplicate injections and bundle bloat when multiple sites exist; second, silent catch blocks during file reads could lead to silent failures, and any I/O errors should instead be caught and reported.

… per locale

Inject global Angular locale data scripts on-demand into each locale's polyfill
bundle during inlining instead of bundling all active locale datasets into a
single shared polyfill output file.

The `loadLocaleData` utility resolves and caches `@angular/common/locales/global`
data per locale. During inlining, `i18n-inliner-worker` injects the specific
locale data script alongside `___NG_LOCALE_INSERT___` in the polyfill bundle.
This eliminates cross-locale bundle bloat so users download only the exact
locale data needed for their targeted locale.
clydin force-pushed the perf/i18n-locale-polyfill-optimization branch from 902ec58 to d4a1424 Compare August 25, 2026 21:50
clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 25, 2026
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 26, 2026
alan-agius4 merged commit 89cc6b3 into angular:main Aug 26, 2026
51 of 53 checks passed

Copy link
Copy Markdown
Collaborator

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

clydin deleted the perf/i18n-locale-polyfill-optimization branch August 26, 2026 13:12
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

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


Back | FazBrowse Home | New Git URL