Skip to content

refactor(@angular/build): defer sourcemap remapping in javascript transformer worker - #33795

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
clydin:perf/deferred-remapping-transformer-worker
Aug 6, 2026
Merged

refactor(@angular/build): defer sourcemap remapping in javascript transformer worker#33795
alan-agius4 merged 1 commit into
angular:mainfrom
clydin:perf/deferred-remapping-transformer-worker

Conversation

@clydin

@clydin clydin commented Aug 6, 2026

Copy link
Copy Markdown
Member

Refactor the JavaScript transformer worker to collect intermediate decoded source maps in memory across pipeline passes and execute sourcemap remapping only once at the end of transformation. In addition, cache the oxc-transform module at module scope to avoid allocating dynamic import promises for every transformed file, and update oxc-linker and oxc-transform to directly return raw DecodedSourceMap objects without internal input sourcemap loading or intermediate remapping.

@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 refactors sourcemap handling in the Angular build tools by deferring and chaining remapping. Instead of remapping input sourcemaps directly within the OXC linker and transform steps, they now return decoded sourcemaps. The javascript-transformer-worker accumulates these maps and performs a single chained remapping at the end. Feedback on these changes suggests utilizing the pre-loaded input map from the coverage instrumentation step to prevent omitting coverage sourcemaps, and adding a corresponding unit test to verify this behavior.

Comment thread packages/angular/build/src/tools/esbuild/javascript-transformer-worker.ts Outdated
…nsformer worker

Refactor the JavaScript transformer worker to collect intermediate decoded source maps in memory across pipeline passes and execute sourcemap remapping only once at the end of transformation. In addition, cache the oxc-transform module at module scope to avoid allocating dynamic import promises for every transformed file, and update oxc-linker and oxc-transform to directly return raw DecodedSourceMap objects without internal input sourcemap loading or intermediate remapping.
@clydin
clydin force-pushed the perf/deferred-remapping-transformer-worker branch from 33320e4 to 85c641d Compare August 6, 2026 14:36
@clydin clydin added the target: minor This PR is targeted for the next minor release label Aug 6, 2026
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Aug 6, 2026
@alan-agius4
alan-agius4 merged commit 715852b into angular:main Aug 6, 2026
41 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator

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

@clydin
clydin deleted the perf/deferred-remapping-transformer-worker branch August 6, 2026 14:55
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