-
-
Notifications
You must be signed in to change notification settings - Fork 721
fix(codegen): remove end sourcemaps for }, ], )
#13180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes end sourcemap generation for closing brackets (}, ], )), which should significantly reduce sourcemap memory usage. This follows an optimization pattern used by esbuild that only generates sourcemaps for closing brackets under specific conditions.
- Removes
add_source_mapping_endfunction and its calls throughout the codebase - Updates development dependencies to support sourcemap visualization examples
- Adds new transformer plugin example demonstrating define replacement functionality
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_codegen/src/lib.rs | Removes add_source_mapping_end function and its usage in block printing methods |
| crates/oxc_codegen/src/gen.rs | Removes calls to add_source_mapping_end for various AST node types (arrays, objects, patterns) |
| crates/oxc_minifier/examples/minifier.rs | Updates sourcemap visualization to use new SourcemapVisualizer utility |
| crates/oxc_minifier/Cargo.toml | Replaces base64 dependency with oxc_sourcemap for visualization |
| crates/oxc_transformer_plugins/examples/define.rs | Adds new example demonstrating define replacement with sourcemap support |
| crates/oxc_transformer_plugins/Cargo.toml | Adds dependencies for the new example (pico-args, oxc_semantic) |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Instrumentation Performance ReportMerging #13180 will improve performances by 3.35%Comparing Summary
Benchmarks breakdown
Footnotes |
f7c694d to
0b946af
Compare
Merge activity
|
closes #13174 This should reduce sourcemap memory usage by a huge amount. These tokens were added in esbuild for code coverage: evanw/esbuild@c4d45e6 But esbuild has an optimization to not generate these tokens when `}` is not on the same line ``` if class.CloseBraceLoc.Start > class.BodyLoc.Start { p.addSourceMapping(class.CloseBraceLoc) } ``` We should revisit these tokens later in the future.
0b946af to
f10ac33
Compare
closes #13174
This should reduce sourcemap memory usage by a huge amount.
These tokens were added in esbuild for code coverage: evanw/esbuild@c4d45e6
But esbuild has an optimization to not generate these tokens when
}is not on the same lineWe should revisit these tokens later in the future.