Repository navigation
feat: mark module starts with // <id> comments instead of #region pairs - #11235
Conversation
✅ Deploy Preview for rolldown-rs canceled.
|
Merging this PR will not alter performance
|
I agree with this reasoning but just to be curious: Do you have anything concrete for this?
And why we still want to keep it?
Can you notify affected people in this PR? |
42c4c0d to
f597345
Compare
|
|
@sapphi-red After this PR is merged, some snapshots will need updating. I can help with that. |
… pairs `experimental.attachDebugInfo: 'simple'` (the default) now writes a `// <module id>` line where each module starts, like esbuild and Bun. `'full'` keeps the `//#region` / `//#endregion` pairs for editor folding. The test harness used `//#endregion` to find where the runtime ends, so `HiddenModuleMarkersPlugin` now wraps only the hidden modules in a temporary region pair before the minify pass.
A line like `// rolldown:hmr` inside a template literal was rewritten to a region pair, which changed the literal's value or hid user code in the snapshot. Parse the chunk and take marker starts from its line comments.
`generateBundle` turned a `//!#region` line inside a template literal into `//#region`, and `renderChunk` disguised `//#region` lines by text too. Both hooks now change only line comments that oxc parses.
The runtime module can hold fixture code from `devMode.implement`, and a blank line in a template literal there became `//!#endregion`. Take the end from the line count of `RenderedModule::code` instead of the first blank line.
The recorded line count went stale when an earlier renderChunk hook added a line to the runtime, so the end marker landed inside a template literal again. Parse the chunk and skip blank lines inside template literals, block comments and JSX; anywhere else a comment line keeps behavior.
`full` now writes the same `// <id>` start lines as `simple` and only adds the `//!` chunk reasons. Nothing needs the `//#region` / `//#endregion` pairs, so the harness no longer disguises them either.
f597345 to
9845dbb
Compare
main now marks module starts with `// <id>` comments instead of `#region` pairs (#11235). This PR's new `cjs_compat/lone_surrogate_export_name` snapshot predates that change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E
main now marks module starts with `// <id>` comments instead of `#region` pairs (#11235). This PR's new `cjs_compat/lone_surrogate_export_name` snapshot predates that change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KSQFCN5EbczjosUMZeBc2E
## [1.2.15] - 2026-10-21 ### 🚀 Features - rolldown_plugin_vite_resolve: add `isBundled` to pick the browser-external stub format (#11260) by @h-a-n-a - dev: mark entry modules in the HMR module graph (#11252) by @h-a-n-a - mark module starts with `// <id>` comments instead of `#region` pairs (#11235) by @IWANABETHATGUY ### 🐛 Bug Fixes - plugin: stop `this.resolve` recursion between plugins with `skipSelf: true` (#11181) by @anzal1 - rolldown_plugin_vite_resolve: handle external `require` for `ssr.target: 'webworker'` (#11205) by @sapphi-red - rolldown_plugin_vite_build_import_analysis: only wrap dynamic imports with static specifiers in __vitePreload (#10879) by @smeng9 - strict-execution-order: wrap eager modules that forward wrapped definers (#11186) by @hyfdev - chunk-import-map: keep common chunk keys unique when enabling inline common chunks (#11230) by @hyfdev - only register signal-exit handler when a trace subscriber is active (#11208) by @DaniilIsupov ### 🧪 Testing - fold hand-unrolled Rust test tables (#11212) by @Brooooooklyn ### ⚙️ Miscellaneous Tasks - deps: upgrade oxc to 0.155.0 (#11228) by @Dunqing - rollup-tests: retriage failed tests (#11251) by @sapphi-red - deps: update rollup submodule for tests to v4.64.12 (#11249) by @rolldown-guard[bot] - deps: update test262 submodule for tests (#11242) by @rolldown-guard[bot] ### ❤️ New Contributors * @anzal1 made their first contribution in [#11181](#11181) * @smeng9 made their first contribution in [#10879](#10879) * @DaniilIsupov made their first contribution in [#11208](#11208) Co-authored-by: shulaoda <[email protected]>
rolldown 1.2.15 (rolldown/rolldown#11235) marks each module with a single `// <id>` comment in place of a `//#region` pair, and the declaration bundles lose their markers. Generated projects float to it through tsdown, so the inline snapshots in the library and scoped-css tests now expect the new format. The custom-element test found the chunk's own imports by splitting on `//#region`. It now reads the leading import lines. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…96) Squashed because the branch's first Solid commit, an rc.13 pin, was superseded by moving to rc.18. The PR page keeps all three commits. solid-router (#93): the example pinned solid-js and @solidjs/web, but @solidjs/vite-plugin pulls in @solidjs/babel-plugin and @solidjs/compiler through a caret range, and solid-js pulls in @solidjs/signals the same way. A fresh install therefore paired a newer compiler with the pinned runtime. Compiled code imports server helpers from @solidjs/web by name. From rc.15 on it imports ssrLinkClaim, which rc.13 does not export, so the built server entry failed to load. The example now pins solid-js, @solidjs/web, @solidjs/[email protected] and @solidjs/[email protected] at the current release candidates. npm overrides hold the compiler and signals packages at 2.0.0-rc.18 too. The source needed no changes, and the README explains the overrides. vue-router (#95): verify.ts found each SFC in the server build through Rolldown's `//#region <id>` comments. Rolldown 1.2.15 (rolldown/rolldown#11235) replaced them with a `// <id>` line at each module's start. [email protected] accepts that release, so the check found no SFCs. verify.ts now recognises either marker, because the pinned Vite still accepts the 1.2.11-1.2.14 releases that write regions. Fixes #93 Fixes #95
Rolldown 1.2.15 marks module starts with `// <id>` comments instead of `//#region`/`//#endregion` pairs (rolldown/rolldown#11235). Co-Authored-By: Claude Opus 5.5 <[email protected]>
* chore: bump the dev-tools group with 6 updates Bumps the dev-tools group with 6 updates: | Package | From | To | | --- | --- | --- | | [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) | `8.0.10` | `8.1.0` | | [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) | `8.0.10` | `8.1.0` | | [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react) | `6.1.2` | `6.2.1` | | [ast-v8-to-istanbul](https://github.com/AriPerkkio/ast-v8-to-istanbul) | `1.0.7` | `1.0.8` | | [playwright](https://github.com/microsoft/playwright) | `1.64.1` | `1.65.0` | | [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) | `8.3.5` | `8.3.6` | Updates `@babel/parser` from 8.0.10 to 8.1.0 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v8.1.0/packages/babel-parser) Updates `@babel/traverse` from 8.0.10 to 8.1.0 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v8.1.0/packages/babel-traverse) Updates `@vitejs/plugin-react` from 6.1.2 to 6.2.1 - [Release notes](https://github.com/vitejs/vite-plugin-react/releases) - [Changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite-plugin-react/commits/[email protected]/packages/plugin-react) Updates `ast-v8-to-istanbul` from 1.0.7 to 1.0.8 - [Release notes](https://github.com/AriPerkkio/ast-v8-to-istanbul/releases) - [Commits](AriPerkkio/ast-v8-to-istanbul@v1.0.7...v1.0.8) Updates `playwright` from 1.64.1 to 1.65.0 - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](microsoft/playwright@v1.64.1...v1.65.0) Updates `vite` from 8.3.5 to 8.3.6 - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v8.3.6/packages/vite) --- updated-dependencies: - dependency-name: "@babel/parser" dependency-version: 8.1.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-tools - dependency-name: "@babel/traverse" dependency-version: 8.1.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-tools - dependency-name: "@vitejs/plugin-react" dependency-version: 6.2.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-tools - dependency-name: ast-v8-to-istanbul dependency-version: 1.0.8 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dev-tools - dependency-name: playwright dependency-version: 1.65.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: dev-tools - dependency-name: vite dependency-version: 8.3.6 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: dev-tools ... Signed-off-by: dependabot[bot] <[email protected]> * fix: rolldown の実行時の部品だけの塊にもソースマップを書き、E2E のカバレッジを通す rolldown 1.2.15 から、塊の中のモジュールの印が「//#region <ID> … //#endregion」の対から 「// <ID>」の始まりの行だけに変わった(rolldown/rolldown#11235)。scripts/e2e-coverage.mjs は この対で \0rolldown/runtime.js だけの塊を見分けてソースマップが無くても飛ばしていたので、 見分けられなくなり、rolldown-runtime-*.js のソースマップが無いとして止まっていた。 コメントの書き方に頼らず、ビルドの設定のプラグインで、モジュールが全部 \0 で始まる ID の 塊にだけ、どのファイルにも写らないソースマップ(sources が空)を書く。 使わなくなった #region の読み取りは e2e-coverage.mjs から外す。 Co-Authored-By: Claude Opus 5.5 <[email protected]> * test: 溜めすぎのテストの上限を、中で待つ 10 秒が収まる長さにする 18MB を送るテストで、届き切るのを 10 秒まで待つのに、テストの上限が既定の 5 秒のままだった。 単体テストを全部並べて流すと CPU を取り合って 5 秒を超え、ときどき落ちていた(単独では 1.2 秒)。 Co-Authored-By: Claude Opus 5.5 <[email protected]> * test: 溜めすぎのテストの上限を既定に戻す #434 で、長い行の受け取りが行の長さの 2 乗の時間かかっていたのを直したので、 上限を延ばす必要は無くなった(延ばしたままだと、遅くなったときに気づけない)。 Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: shunya.tanaka <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
rolldown#11235 replaced the `#region` pairs in the output with `// <id>` comments.
rolldown#11235 replaced the `#region` pairs in the output with `// <id>` comments.
experimental.attachDebugInfo: 'simple'(the default) now writes a// <module id>line where each module starts, like esbuild and Bun, and no longer wraps each module in//#region///#endregion.The pairs came in with #1278 / #1330 so that VS Code and WebStorm can fold each module of the output. Today few people read bundler output in an editor, but agents read it often, and for an agent the pairs are only extra tokens. The start line keeps the part that is still useful: which file the code comes from.
The test harness used
//#endregionto find where the runtime ends, soHiddenModuleMarkersPluginnow wraps only the hidden modules in a temporary region pair before the minify pass. Other markers are no longer protected from the dce-only pass, so snapshots drop the same markers that production builds drop. Vite'srolldown-canarytests check the old markers, so they need an update there.