Skip to content

fix(@angular/build): keep generated locale polyfills cacheable - #34721

Open
splincode wants to merge 1 commit into
angular:mainfrom
splincode:fix/i18n-stable-generated-polyfills
Open

splincode wants to merge 1 commit into
angular:mainfrom
splincode:fix/i18n-stable-generated-polyfills

Conversation

@splincode

@splincode splincode commented Nov 14, 2026 •

Copy link
Copy Markdown

PR Checklist

  • The commit message follows the project guidelines.
  • Extended the existing i18n E2E test.

PR Type

  • Bugfix

What is the current behavior?

In a localized AOT build without additional polyfills, the CLI-generated polyfills bundle only sets the locale and loads Angular locale data. Editing an application translation still changes its URL because esbuild includes the translation-file digest in the filename hash.

Part of #30675; follows the feedback on #34673.

What is the new behavior?

Use the selected locales and their Angular locale data as the hash input for this generated bundle before esbuild assigns the filename. There is still one shared filename across locales, and no output files or imports are rewritten for hashing. Application chunks, workers, user-supplied polyfills, and watch builds retain their current hashing.

Does this PR introduce a breaking change?

  • No

@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 a mechanism to account for locale ID and locale data in the shared output hash when inlining translations and polyfills are empty, appending a hash footer to the polyfills bundle. It also moves the caching of loaded locale data from the utility module to the worker level and updates E2E tests to verify cacheability under esbuild. The review feedback suggests passing options.workspaceRoot to loadLocaleData to ensure robust module resolution in monorepos.

@splincode
splincode force-pushed the fix/i18n-stable-generated-polyfills branch from a682c99 to 3d6dbd3 Compare November 14, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant