Skip to content

feat: mark module starts with // <id> comments instead of #region pairs - #11235

Merged
IWANABETHATGUY merged 8 commits into
mainfrom
feat/attach-debug-info-module-comments
Oct 20, 2026
Merged

IWANABETHATGUY merged 8 commits into
mainfrom
feat/attach-debug-info-module-comments

Conversation

@IWANABETHATGUY

@IWANABETHATGUY IWANABETHATGUY commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

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 //#endregion to find where the runtime ends, so HiddenModuleMarkersPlugin now 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's rolldown-canary tests check the old markers, so they need an update there.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://feat-attach-debug-info-module-comments-rolldown-rs.voidzero-docs.workers.dev (commit 9845dbb)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://2145ec2b-rolldown-rs.voidzero-docs.workers.dev 9845dbb 2026-10-20T06:03:28.435Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://edeb4122-rolldown-rs.voidzero-docs.workers.dev f597345 2026-10-19T15:41:56.979Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://ce43c763-rolldown-rs.voidzero-docs.workers.dev a4dbe3f 2026-10-18T15:51:59.236Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9fd6b099-rolldown-rs.voidzero-docs.workers.dev eb2e99f 2026-10-18T14:38:00.406Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://003fea40-rolldown-rs.voidzero-docs.workers.dev 69b0e7c 2026-10-18T14:20:48.402Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://d664535f-rolldown-rs.voidzero-docs.workers.dev 7886a49 2026-10-18T14:04:53.011Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://02d188a2-rolldown-rs.voidzero-docs.workers.dev 2c06407 2026-10-18T10:55:36.722Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://ec330fb8-rolldown-rs.voidzero-docs.workers.dev 22eb86a 2026-10-18T10:35:46.973Z Visit the dashboard ↗

@netlify

netlify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 9845dbb
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6ad703c0133e4f3f72afbe9e

@IWANABETHATGUY
IWANABETHATGUY marked this pull request as ready for review October 18, 2026 15:51
@codspeed

codspeed Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 4 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 7 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing feat/attach-debug-info-module-comments (9845dbb) with main (cef9e5c)2

Open in CodSpeed

Footnotes

  1. 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. ↩

  2. No successful run was found on main (b717946) during the generation of this report, so cef9e5c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@hyfdev

hyfdev commented Oct 18, 2026

Copy link
Copy Markdown
Member

but agents read it often, and for an agent the pairs are only extra tokens.

I agree with this reasoning but just to be curious: Do you have anything concrete for this?

Only 'full' keeps the pairs.

And why we still want to keep it?

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. Other markers are no longer protected from the dce-only pass, so snapshots drop the same markers that production builds drop. Vite's rolldown-canary tests check the old markers, so they need an update there.

Can you notify affected people in this PR?

@IWANABETHATGUY
IWANABETHATGUY force-pushed the feat/attach-debug-info-module-comments branch from 42c4c0d to f597345 Compare October 19, 2026 15:35
@IWANABETHATGUY

IWANABETHATGUY commented Oct 19, 2026 •

Copy link
Copy Markdown
Member Author

but agents read it often, and for an agent the pairs are only extra tokens.

I agree with this reasoning but just to be curious: Do you have anything concrete for this?

Only 'full' keeps the pairs.

And why we still want to keep it?

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. Other markers are no longer protected from the dce-only pass, so snapshots drop the same markers that production builds drop. Vite's rolldown-canary tests check the old markers, so they need an update there.

Can you notify affected people in this PR?

  1. Only token counts. With the gpt-4o tokenizer, the format change alone saves 3.3% of the tokens in our snapshots, and 12.5% in small ones like esbuild/dce/const_value_inlining_bundle. On real library output (3,132 rolldown-built files in our node_modules), it is about 1% per file (median) and 0.2% overall. So it is a small win, mostly for small outputs.

  2. On second thought, I don't think anyone really needs this, so I remove it.

@IWANABETHATGUY

Copy link
Copy Markdown
Member Author

@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.
@IWANABETHATGUY
IWANABETHATGUY force-pushed the feat/attach-debug-info-module-comments branch from f597345 to 9845dbb Compare October 20, 2026 06:01
IWANABETHATGUY added a commit to vitejs/vite that referenced this pull request Oct 20, 2026
@IWANABETHATGUY
IWANABETHATGUY merged commit 648591f into main Oct 20, 2026
36 of 37 checks passed
@IWANABETHATGUY
IWANABETHATGUY deleted the feat/attach-debug-info-module-comments branch October 20, 2026 06:10
Dunqing pushed a commit that referenced this pull request Oct 20, 2026
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
Dunqing added a commit that referenced this pull request Oct 20, 2026
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
@rolldown-guard rolldown-guard Bot mentioned this pull request Oct 21, 2026
shulaoda added a commit that referenced this pull request Oct 21, 2026
## [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]>
NullVoxPopuli added a commit to NullVoxPopuli/ember.nvp that referenced this pull request Oct 23, 2026
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]>
markmals added a commit to pitlane-tools/pitlane that referenced this pull request Oct 24, 2026
…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
nstepien added a commit to nstepien/ecij that referenced this pull request Oct 28, 2026
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]>
sny-tanaka added a commit to sny-tanaka/tanacode that referenced this pull request Nov 16, 2026
* 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]>
IWANABETHATGUY added a commit to araishi/rolldown that referenced this pull request Nov 19, 2026
rolldown#11235 replaced the `#region` pairs in the output with `// <id>` comments.
IWANABETHATGUY added a commit to araishi/rolldown that referenced this pull request Nov 19, 2026
rolldown#11235 replaced the `#region` pairs in the output with `// <id>` comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants