Repository navigation
fix(sourcemap): preserve names through collapse_sourcemaps - #9486
Conversation
Merging this PR will degrade performance by 3.09%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | collapse_codegen_chain |
30.7 ms | 31.7 ms | -3.09% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing eoin:fix-collapse-sourcemaps-preserve-names (82957f0) with main (7869925)2
Footnotes
-
10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
main(81f238f) during the generation of this report, so 7869925 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
|
It looks like this fixes a regression introduced in vitejs/vite@47a4d5069.
This change results in I'm not sure why |
bea6d29 to
c90ae0d
Compare
✅ Deploy Preview for rolldown-rs canceled.
|
646704c to
1e33b22
Compare
|
I’ll make a few small changes directly on your branch to avoid unnecessary back-and-forth and help move this forward more efficiently.
|
477bbaf to
63d2a9d
Compare
`collapse_sourcemaps` previously kept only `first_map.names`, silently dropping any identifier the minifier (or an intermediate transform) renamed. As a result, Vite 8 bundles emit near-empty `names` arrays where Vite 7 (Rollup + esbuild) populated them, breaking downstream consumers that rely on the names array to recover original identifier names from minified positions. Match the linked upstream (rollup/src/utils/collapseSourcemaps.ts): concatenate every map's names into a merged pool, then for each token walk the chain and prefer the name closest to the original source, falling back through later maps when none is set. Adds tests for last-map, middle-map, and first-vs-last name resolution.
Compute each map's name offset while building the lookup chain, so the collapse keeps its allocation count (tasks/track_memory_allocations).
…earlier map has names When every map before the last one has no names, no traced token can carry a name, so the remap loop runs without the per-step name work. This recovers the `collapse_codegen_chain` regression.
63d2a9d to
82957f0
Compare
## [1.2.11] - 2026-09-24 ### 🚀 Features - watch: report only file events (#10974) by @shulaoda ### 🐛 Bug Fixes - sourcemap: preserve names through `collapse_sourcemaps` (#9486) by @eoin - watch: map metadata events by kind and missing paths as deleted (#10973) by @shulaoda ### 🚜 Refactor - rolldown_fs_watcher: hand the handler file events instead of notify results (#10980) by @shulaoda - rolldown_fs_watcher: share one event handler adapter between the notify watchers (#10979) by @shulaoda - rolldown_fs_watcher: register every path with one watch mode (#10978) by @shulaoda - rolldown_fs_watcher: tweak the backend traits and the event mapping (#10977) by @shulaoda - watch: translate notify events inside FsWatcher (#10972) by @shulaoda ### 📚 Documentation - watch: update the fs watcher layout and the dev coordinator message (#10981) by @shulaoda - watch: document the event translation in FsWatcher (#10975) by @shulaoda ###◀️ Revert - "perf(dev/lazy): fetch a lazy route in one request" (#10789) (#10982) by @h-a-n-a ### ❤️ New Contributors * @eoin made their first contribution in [#9486](#9486) Co-authored-by: shulaoda <[email protected]>
This change results in
collapse_sourcemapsmore closely mirroring the original rollup implementation, fixing an issue with sourcemap generation.collapse_sourcemapspreviously kept onlyfirst_map.names, silently dropping any identifier the minifier (or an intermediate transform) renamed. As a result, Vite 8 bundles emit near-emptynamesarrays, breaking downstream consumers (e.g. Sentry) that rely on the names array to recover original identifier names from minified positions. This seems to be a version 8 regression.