refactor(@angular/build): optimize JavaScript transformer worker startup and sourcemap generation - #33980
Open
clydin wants to merge 2 commits into
Open
refactor(@angular/build): optimize JavaScript transformer worker startup and sourcemap generation#33980clydin wants to merge 2 commits into
clydin wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request optimizes dynamic imports in the JavaScript transformer worker by grouping them using Promise.all and updates the source map generation options in the OXC transformer to use 'boundary' instead of true for hires. The review feedback suggests caching the dynamically imported Babel linker dependencies at the module level to avoid the overhead of repeatedly calling import() and creating new promises on every file transformation.
… worker By default, JavaScript transformations use the native OXC engine for Angular linking and advanced optimizations. The Babel-based linker is only utilized when the NG_BUILD_BABEL_LINKER environment variable is explicitly enabled. Previously, transformAsync was imported statically at the top level of javascript-transformer-worker.ts, causing Node.js to eagerly evaluate @babel/core and all its transitive dependencies on startup across every Piscina worker thread. Importing @babel/core dynamically only when the Babel linker fallback is active reduces worker thread startup latency and eliminates unnecessary worker idle memory overhead on standard builds.
…ation in oxc transform Generating high-resolution sourcemap tokens for every character with hires: true produces substantially larger intermediate decoded mappings and increases peak memory consumption during sourcemap remapping. Using hires: 'boundary' generates tokens only at identifier and word boundaries. This significantly reduces decoded sourcemap memory footprint and remapping time while retaining full debugging accuracy.
clydin
force-pushed
the
perf/js-transformer-optimizations
branch
from
August 31, 2026 19:04
8df7a4f to
33b6676
Compare
alan-agius4
approved these changes
Sep 1, 2026
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.
This PR introduces two targeted performance optimizations to the JavaScript transformation pipeline:
@babel/corein transformer workers