refactor(@angular/build): lazy load sourcemap remapping in i18n inliner worker - #34193
Merged
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the i18n-inliner-worker.ts file to lazily load the @ampproject/remapping dependency. The eager import of remapping has been converted to a type-only import, and the module is now dynamically imported and cached only when inlineLocalize is executed. There are no review comments, so I have no feedback to provide.
alan-agius4
approved these changes
Sep 29, 2026
alan-agius4
force-pushed
the
perf-lazy-sourcemap-remapping
branch
from
September 29, 2026 08:13
9bc35b1 to
f849fcb
Compare
…er worker Previously, `@ampproject/remapping` was statically imported at the top level of `i18n-inliner-worker.ts`, eagerly pulling in 5 packages (`@ampproject/remapping` and 4 sub-dependencies) upon worker initialization. In typical workflows or when sourcemaps are not requested for inlining, remapping is never executed. This changes the import of `@ampproject/remapping` to be dynamic so that it is only loaded when a file actually requires sourcemap remapping.
clydin
force-pushed
the
perf-lazy-sourcemap-remapping
branch
from
September 29, 2026 14:22
f849fcb to
519e019
Compare
Member
Author
|
This PR was merged into the repository. The changes were merged into the following branches:
|
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.
Previously,
@ampproject/remappingwas statically imported at the top level ofi18n-inliner-worker.ts, eagerly pulling in 5 packages (@ampproject/remappingand 4 sub-dependencies) upon worker initialization.In typical workflows or when sourcemaps are not requested for inlining, remapping is never executed.
This changes the import of
@ampproject/remappingto be dynamic so that it is only loaded when a file actually requires sourcemap remapping.