oxc/crates/oxc_sourcemap
Hiroshi Ogawa 3d66929fa2
fix(sourcemap): improve source map visualizer (#7386)
- Related https://github.com/rolldown/rolldown/issues/2737

Probably this is still an approximation of what
https://github.com/evanw/source-map-visualization does, but I tried to
get some ideas from it.

For comparison, I added an example from their site
https://evanw.github.io/source-map-visualization/ as a snapshot in
`crates/oxc_sourcemap/tests/fixtures/esbuild/visualizer.snap`. I'll
mention a few notable changes in the comments.

Snapshot change in rolldown repo can be found in
- https://github.com/rolldown/rolldown/pull/2829
2024-11-21 14:35:56 +08:00
..
src fix(sourcemap): improve source map visualizer (#7386) 2024-11-21 14:35:56 +08:00
tests fix(sourcemap): improve source map visualizer (#7386) 2024-11-21 14:35:56 +08:00
Cargo.toml fix(sourcemap): improve source map visualizer (#7386) 2024-11-21 14:35:56 +08:00
CHANGELOG.md release(crates): v0.31.0 (#6360) 2024-10-08 20:55:24 +08:00
README.md docs(sourcemap): add trailing newline to README (#5539) 2024-09-06 15:24:52 +01:00

The sourcemap implement port from rust-sourcemap, but has some different with it.

  • Encode sourcemap at parallel, including quote sourceContent and encode token to vlq mappings.
  • Avoid Sourcemap some methods overhead, like SourceMap::tokens().