feat(dev): align test-dev-server with Vite dev server#9668
Conversation
How to use the Graphite Merge QueueAdd the label graphite: merge-when-ready to this PR to add it to 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. This stack of pull requests is managed by Graphite. Learn more about stacking. |
7556cef to
dc1b912
Compare
dc1b912 to
aad66aa
Compare
Merging this PR will improve performance by 5.02%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | bundle@multi-duplicated-top-level-symbol |
271.6 ms | 258.6 ms | +5.02% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing 06-08-feat_dev_align_test-dev-server_with_vite (aad66aa) with main (811b2f9)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
06-09-fix_dev_force_rebuild_after_hmr_errors(c8dcbe2) during the generation of this report, somain(811b2f9) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
c8dcbe2 to
bd20217
Compare
aad66aa to
72d10a4
Compare
72d10a4 to
4aa3c92
Compare
bd20217 to
cc5972b
Compare
Merge activity
|
## Summary Stacked on #9652. Restructures `packages/test-dev-server` so it tracks Vite's full-bundle-mode dev server (`packages/vite/src/node/server/environments/fullBundleEnvironment.ts`), rather than carrying its own ad-hoc shape. The goal is to let dev-engine work be exercised inside the rolldown repo against a server whose error handling, middleware, and reload behavior match Vite's — so behavioral regressions in the `dev()` engine surface here before they reach Vite. A literal 1:1 port isn't possible: the test harness depends on pieces Vite doesn't have. Those are **kept** intentionally: - the standalone connect + `ws` server (Vite reuses its own HTTP/HMR transport), - the **disk**-serving path for the node target, - the `/_dev/status` endpoint plus `buildSeq` / `moduleRegistrationSeq` test instrumentation. **Constraint:** the shared rolldown HMR runtime (`crates/rolldown_plugin_hmr/src/runtime/runtime-extra-dev-default.js`) is **not** touched — every change lives in `packages/test-dev-server`. ## Structure The flat `dev-server.ts` is split to mirror Vite's layout: | test-dev-server | Vite equivalent | | --- | --- | | `src/environments/full-bundle-dev-environment.ts` (`FullBundleDevEnvironment`) | `environments/fullBundleEnvironment.ts` | | `src/middlewares/{memory-files,index-html,trigger-lazy-bundling,status}.ts` | `server/middlewares/*` | | `src/{clients,memory-files,fallback-html}.ts`, `src/utils/{debounce,prepare-error}.ts` | Vite helpers | | `src/dev-server.ts` | `server/index.ts` (connect/http/ws transport + middleware wiring only) | `FullBundleDevEnvironment` now owns the dev engine, the in-memory output, the client registry, and the `lastBuildError` / `fullReloadPending` state. ## Behavior ported from Vite - **Error replay:** `lastBuildError` is cached from either callback channel (`onOutput` / `onHmrUpdates`), broadcast on break, and replayed on client connect so the overlay survives a refresh; it's cleared on a successful build from **either** channel. - **Build-error overlay** (`error-overlay.ts`): stand-in for Vite's client overlay, injected into the generated `index.html` and the "Bundling in progress" spinner. Runs as its own ws client alongside the rolldown HMR runtime; because HMR patches are delivered per-client, recovery is signalled by a broadcast `build:ok` (HMR recovery) and a reload (full-build recovery). - **`prepareError`** (`utils/prepare-error.ts`): port of Vite's helper — strips ANSI via `node:util`'s `stripVTControlCharacters` and copies only the fields the overlay needs (`message`/`stack`/`id`/`frame`/`plugin`/`pluginCode`/`loc`). - **Reload handling:** deferred full reload (`fullReloadPending`), debounced reload, conservative stale-output regen guard (`hasStaleOutput && !lastBuildErrored && initialBuildCompleted`), and noop/empty HMR-batch filtering. - **Serving targets:** browser target serves from memory with the spinner + `skipWrite`; node target serves from disk behind a request gate. ## Docs Reconciles `meta/design/dev-engine.md` §2: it claimed `lastBuildError` clears only on a successful `onOutput`, but Vite (and now this port) also clears it on a successful `onHmrUpdates`. ## Testing `pnpm test:fixtures` (9) and `pnpm test:browser` (10) pass, including a new `browser.spec.ts` case asserting the build-error overlay appears on a break and clears on recovery.
cc5972b to
3a1c886
Compare
4aa3c92 to
d104a73
Compare
## Summary Rebuilds the `@rolldown/test-dev-server` **browser** test harness around an in-process dev server, mirroring Vite's playground harness. The old model ran each playground as a `pnpm serve` subprocess on a hand-picked port kept in two synced registries; this replaces it with a server that runs inside each vitest worker on an OS-assigned port, discovered from the spec's own path. **Adding a browser test is now a folder + a spec, with zero central edits.** Stacked on #9668. Rationale and as-built detail live in `meta/design/dev-server-test-harness.md`. ## Server entry point (`src/`) - New **`createDevServer(config, opts?) → { url, port, close }`** — binds `port 0` (OS-assigned) and resolves once the first bundle is actually being served (a navigation never lands on the spinner). - **Listen-before-build**: bind the socket → read the bound port → inject it into `experimental.devMode.port` → build. This makes auto-port work even though the HMR websocket port is baked into the bundle, without touching the shared runtime. - New `loadDevConfig(dir)`, an injectable `Logger` (server output → `serverLogs`), and a real `DevServer.close()` (ws server + clients + `httpServer.close()` + `env.close()`). `serve()` (the CLI/fixtures path) delegates to the same class. ## Harness (`tests/`) - In-process server per spec file; one shared Chromium (`launchServer` in global setup; each file connects and opens one page); teardown via the server's own `close()` — no `killPort`, no orphaned subprocesses. - Spec-path discovery: `vitest.config.e2e.mts` globs `playground/**/*.spec.ts`; global setup copies only the selected playgrounds into `playground-temp/`. - A `~utils` surface (`page`, `serverUrl`, `editFile`, `waitForBuildStable`, `untilBrowserLogAfter`, …) and URL-keyed `/_dev/status` helpers shared with the node fixtures suite. - Removed the subprocess machinery: `browser.spec.ts`, `vitest-setup-browser.ts`, `tests/test-utils.ts`, `tests/src/config.ts` (the port registry), and `vitest.config.browser.mts`. ## Lazy-compilation consolidation The four sibling `lazy-*` playgrounds (`lazy-compilation`, `lazy-aliased-import`, `lazy-shared-module`, `lazy-nested-dynamic-import`) are merged into **one** `lazy-compilation/` co-tenant playground: one `dev.config.mjs`, one `index.html`, `main.js` importing a `setup.js` per scenario sub-folder (`basic/`, `aliased-import/`, `shared-module/`, `nested-dynamic-import/`), and four specs sharing one cold-start `serve.ts`. Safe because lazy chunks compile only on first dynamic import, so each spec's own per-file server stays virgin for its scenario even though all four live in one project. ## Docs Rewrote `meta/design/dev-server-test-harness.md` down to principles + as-built implementation; folded in and deleted `dev-server-browser-tests.md`; updated `tests/README.md`. ## Verification - `pnpm typecheck` (tests) — clean - `pnpm test:browser` — 10/10 green (`hmr-full-bundle-mode` + the four lazy scenarios) - `knip` (lazy-compilation workspace) — clean 🤖 Generated with [Claude Code](https://claude.com/claude-code)
## [1.1.2] - 2026-06-18 ### 📝 Notable tsconfig behavior changes These ship via the `oxc_resolver` 11.21.3 bump (#9841) and affect `resolve.tsconfigPaths` (Vite 8 resolves through oxc-resolver): - **Honor explicit non-TS extensions in `include`** (oxc-project/oxc-resolver#1213). `compilerOptions.paths` now resolve for importers whose extension is explicitly listed in a tsconfig's `include` (e.g. `src/**/*.vue`, `src/**/*.svelte`). Previously oxc-resolver filtered importers by extension before evaluating the `include` globs, so a `.vue`/`.svelte` file listed in `include` never matched its project and its `paths` were skipped. This unblocks the default create-vite Vue + TS layout (a solution-style root plus a referenced `tsconfig.app.json` that declares `paths` and `include: ["src/**/*.ts", "src/**/*.vue"]`). Matches vue-tsc and svelte-check, which register these extensions via TypeScript's `extraFileExtensions`. - **No fallback to the outermost tsconfig in auto-discovery** (oxc-project/oxc-resolver#1220). Auto-discovery no longer attaches the topmost ancestor `tsconfig.json` to a file that no project actually owns (via `files` / `include` / project references). Previously such a file inherited the outermost ancestor's `paths` / `baseUrl`, leaking aliases into files that project does not own. oxc-resolver now returns no config in that case, matching tsserver / typescript-go, which route such files to an inferred project with no aliases. ### 🚀 Features - add option named for invalid return type errors for more places (#9846) by @shulaoda - add option names for invalid return type errors (#9821) by @sapphi-red - transform: infer decorator strictNullChecks from tsconfig (#9590) by @kylecannon - expose React Compiler options for rolldown and Vite users (#9801) by @Boshen - tracing: gate chrome-json trace layer behind `chrome-tracing` feature (#9773) by @hyf0 - dev: align test-dev-server with Vite dev server (#9668) by @h-a-n-a ### 🐛 Bug Fixes - plugin_timings: point doc link to existing checks reference page (#9837) by @hyf0 - generator: correct contradictory panic message in cjs cross-chunk symbol lookup (#9836) by @hyf0 - esm: preserve with clause on export * from external (#9796) by @hyf0 - Make external_import_binding_merger deterministic (#9755) by @naruaway - surface invalid `manualCodeSplitting` group `test` regex as an error (#9792) by @shulaoda - avoid panic on `output.file` without a file name (#9789) by @shulaoda - avoid O(N^2) rendering of high-volume diagnostics (#9748) (#9749) by @IWANABETHATGUY - avoid panic on JSON numbers outside f64 range (#9788) by @shulaoda - deps: bump mimalloc-safe to 0.1.63 to fix worker_threads segfault (#9785) by @shulaoda - cache ESM evaluation errors (#9784) by @sapphi-red - wrap node require helper in pure IIFE (#9783) by @kb019 - lazy-barrel: load locally-used imports on a re-exported record (#9757) by @shulaoda - avoid dangling wrapped-ESM init call across chunks (#9502) (#9717) by @IWANABETHATGUY - dev: detect same-second rewrites in CI poll watcher (#9736) by @h-a-n-a - dev: force rebuild after HMR errors (#9686) by @h-a-n-a - dev: print build errors on browser refresh after a failed build (#9652) by @h-a-n-a ### 🚜 Refactor - single-source the chunk $N symbol-naming algorithm (#9831) by @Dunqing - simplify common_dir helper (#9857) by @IWANABETHATGUY - drop commondir crate in favor of in-house helper (#9849) by @Boshen - binding: extract helpers from normalize_binding_options (#9842) by @Boshen - move rolldown_filter_analyzer to tasks and scope oxc cfg feature (#9839) by @Boshen - options: merge manualCodeSplitting into codeSplitting object form (#9805) by @IWANABETHATGUY - options: support codeSplitting object form in CodeSplittingMode (#9804) by @IWANABETHATGUY - diagnostic: reuse ByteLocator for per-source line lookup (#9762) by @IWANABETHATGUY - remove redundant Arc around tracing spans (#9778) by @camc314 - remove unnecessary `Arc` around sourcemap sender (#9777) by @camc314 - rolldown_plugin_vite_wasm_fallback: remove the plugin (#9775) by @sapphi-red - binding: remove infer-able `napi(ts_type)` (#9737) by @sapphi-red - remove preprocessor span dedup (#9734) by @hyf0 - identify AST nodes by NodeId instead of Span/Address (#9609) by @IWANABETHATGUY ### 📚 Documentation - tsconfig: align auto-discovery docs with oxc-resolver behavior (#9845) by @shulaoda - relocate meta/design to internal-docs, split design from implementation (#9826) by @h-a-n-a - meta: add options normalization design doc (#9818) by @IWANABETHATGUY - document why the napi tracing feature is enabled (#9766) by @Boshen - dev: move test-dev-server test guidance into the testing docs (#9809) by @h-a-n-a ### ⚡ Performance - drop unused regex unicode property tables from the binding (#9848) by @Boshen - drop urlencoding crate in favor of percent-encoding (#9851) by @Boshen - drop owo-colors supports-colors feature in vite reporter (#9824) by @Boshen - skip enum member value extraction for non-TypeScript modules (#9840) by @shulaoda - rolldown: use unstable sort for itertools sorted_by at unique-key sites (#9827) by @Boshen - cheaper deterministic ordering in external import binding merger (#9810) by @IWANABETHATGUY - disable idna's ICU backend by pinning idna_adapter to 1.0.0 (-129 KB) (#9811) by @Boshen - size: use unstable sort where stability is unneeded (#9803) by @Boshen - remove num-format dependency from vite reporter (#9795) by @Boshen - reduce js callback error size (#9776) by @Boshen - rolldown_error: remove Debug supertrait from BuildEvent (#9798) by @Boshen - reduce plugin hook order code size (#9761) by @Boshen - deps: disable `infer` default features to reduce binary size (#9765) by @Boshen - reduce pluginable monomorphization size (#9771) by @Boshen - avoid rebuilding replace plugin values (#9764) by @Boshen - defer link-stage-output drop to rayon workers after output is produced (#9733) by @Brooooooklyn - tree-shaking: hoist already-included guard to call sites in inclusion DFS (#9738) by @Brooooooklyn - renamer: dedup before allocating the owned name in add_symbol_in_root_scope (#9740) by @Brooooooklyn ### 🧪 Testing - allocs: track allocation counts for rolldown_sourcemap (#9835) by @hyf0 - bench: add CodSpeed micro-benchmarks for rolldown_sourcemap (#9834) by @hyf0 - add cjs named export mutation test (#9823) by @sapphi-red - dev: restore shared-page reliability conventions in AGENTS.md (#9786) by @h-a-n-a - dev: add `AGENTS.md` test guidance for agents (#9763) by @h-a-n-a - dev: split out initial-build-error into its own playground (#9772) by @h-a-n-a - dev: align e2e suite with Vite and parallelize playgrounds (#9759) by @h-a-n-a - remove unnecessary module namespace object JSON serializations in tests (#9725) by @sapphi-red - use `assert.deepStrictEqual` instead of `assert.deepEqual` by using `assert/strict` instead of `assert` (#9724) by @sapphi-red - hmr: add test case for #5301 (#5302) by @sapphi-red - dev: add tests for dev-engine principles (#9720) by @h-a-n-a - dev: align dev-engine test harness with Vite (#9684) by @h-a-n-a ### ⚙️ Miscellaneous Tasks - deps: update napi to 3.9.3 (#9862) by @shulaoda - deps: update oxc to 0.137.0 (#9856) by @Boshen - re-enable default lld linker on x86_64-unknown-linux-gnu (#9855) by @Boshen - deps: bump vite-plus to 0.2.1 (#9850) by @Boshen - skills: translate _config.json when encoding rolldown REPL links (#9847) by @IWANABETHATGUY - deps: update oxc_resolver and oxc_resolver_napi to 11.21.3 (#9841) by @Boshen - pin vite-plus (vp) CLI to 0.1.24 in setup-vp (#9830) by @Boshen - add crate/package-level CODEOWNERS (#9819) by @IWANABETHATGUY - drop unused derive_more display feature from rolldown_plugin (#9820) by @Boshen - remove auto-assign PR workflow (#9807) by @IWANABETHATGUY - deps: update rollup submodule for tests to v4.62.0 (#9780) by @rolldown-guard[bot] - deps: update esbuild for tests to 0.28.1 (#9779) by @rolldown-guard[bot] - deps: update test262 submodule for tests (#9781) by @rolldown-guard[bot] - deps: update oxc to 0.136.0 (#9770) by @Boshen - add pull request template (#9756) by @sapphi-red - clarify `rolldown_plugin_vite_*` is compatible for the same minor (#9774) by @sapphi-red - deps: update github actions (#9745) by @renovate[bot] - deps: update rust crates (#9747) by @renovate[bot] - deps: update napi to v3.9.2 (#9744) by @renovate[bot] - deps: update npm packages (#9746) by @renovate[bot] - deps: update @napi-rs/cli and emnapi deps (#9741) by @Brooooooklyn - generator: fix `vp fmt` on Windows (#9727) by @sapphi-red - ban importing from `assert` and recommend `assert/strict` (#9726) by @sapphi-red ### ❤️ New Contributors * @naruaway made their first contribution in [#9755](#9755) * @kb019 made their first contribution in [#9783](#9783) Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
## [1.0.16] - 2026-06-18 ### 🚀 Features - add option named for invalid return type errors for more places (rolldown#9846) by `@shulaoda` - add option names for invalid return type errors (rolldown#9821) by `@sapphi-red` - transform: infer decorator strictNullChecks from tsconfig (rolldown#9590) by `@kylecannon` - expose React Compiler options for rolldown and Vite users (rolldown#9801) by `@Boshen` - tracing: gate chrome-json trace layer behind `chrome-tracing` feature (rolldown#9773) by `@hyf0` - dev: align test-dev-server with Vite dev server (rolldown#9668) by `@h-a-n-a` ### 🐛 Bug Fixes - plugin_timings: point doc link to existing checks reference page (rolldown#9837) by `@hyf0` - generator: correct contradictory panic message in cjs cross-chunk symbol lookup (rolldown#9836) by `@hyf0` - esm: preserve with clause on export * from external (rolldown#9796) by `@hyf0` - Make external_import_binding_merger deterministic (rolldown#9755) by `@naruaway` - surface invalid `manualCodeSplitting` group `test` regex as an error (rolldown#9792) by `@shulaoda` - avoid panic on `output.file` without a file name (rolldown#9789) by `@shulaoda` - avoid O(N^2) rendering of high-volume diagnostics (rolldown#9748) (rolldown#9749) by `@IWANABETHATGUY` - avoid panic on JSON numbers outside f64 range (rolldown#9788) by `@shulaoda` - deps: bump mimalloc-safe to 0.1.63 to fix worker_threads segfault (rolldown#9785) by `@shulaoda` - cache ESM evaluation errors (rolldown#9784) by `@sapphi-red` - wrap node require helper in pure IIFE (rolldown#9783) by `@kb019` - lazy-barrel: load locally-used imports on a re-exported record (rolldown#9757) by `@shulaoda` - avoid dangling wrapped-ESM init call across chunks (rolldown#9502) (rolldown#9717) by `@IWANABETHATGUY` - dev: detect same-second rewrites in CI poll watcher (rolldown#9736) by `@h-a-n-a` - dev: force rebuild after HMR errors (rolldown#9686) by `@h-a-n-a` - dev: print build errors on browser refresh after a failed build (rolldown#9652) by `@h-a-n-a` ### 🚜 Refactor - single-source the chunk $N symbol-naming algorithm (rolldown#9831) by `@Dunqing` - simplify common_dir helper (rolldown#9857) by `@IWANABETHATGUY` - drop commondir crate in favor of in-house helper (rolldown#9849) by `@Boshen` - binding: extract helpers from normalize_binding_options (rolldown#9842) by `@Boshen` - move rolldown_filter_analyzer to tasks and scope oxc cfg feature (rolldown#9839) by `@Boshen` - options: merge manualCodeSplitting into codeSplitting object form (rolldown#9805) by `@IWANABETHATGUY` - options: support codeSplitting object form in CodeSplittingMode (rolldown#9804) by `@IWANABETHATGUY` - diagnostic: reuse ByteLocator for per-source line lookup (rolldown#9762) by `@IWANABETHATGUY` - remove redundant Arc around tracing spans (rolldown#9778) by `@camc314` - remove unnecessary `Arc` around sourcemap sender (rolldown#9777) by `@camc314` - rolldown_plugin_vite_wasm_fallback: remove the plugin (rolldown#9775) by `@sapphi-red` - binding: remove infer-able `napi(ts_type)` (rolldown#9737) by `@sapphi-red` - remove preprocessor span dedup (rolldown#9734) by `@hyf0` - identify AST nodes by NodeId instead of Span/Address (rolldown#9609) by `@IWANABETHATGUY` ### 📚 Documentation - tsconfig: align auto-discovery docs with oxc-resolver behavior (rolldown#9845) by `@shulaoda` - relocate meta/design to internal-docs, split design from implementation (rolldown#9826) by `@h-a-n-a` - meta: add options normalization design doc (rolldown#9818) by `@IWANABETHATGUY` - document why the napi tracing feature is enabled (rolldown#9766) by `@Boshen` - dev: move test-dev-server test guidance into the testing docs (rolldown#9809) by `@h-a-n-a` ### ⚡ Performance - drop unused regex unicode property tables from the binding (rolldown#9848) by `@Boshen` - drop urlencoding crate in favor of percent-encoding (rolldown#9851) by `@Boshen` - drop owo-colors supports-colors feature in vite reporter (rolldown#9824) by `@Boshen` - skip enum member value extraction for non-TypeScript modules (rolldown#9840) by `@shulaoda` - rolldown: use unstable sort for itertools sorted_by at unique-key sites (rolldown#9827) by `@Boshen` - cheaper deterministic ordering in external import binding merger (rolldown#9810) by `@IWANABETHATGUY` - disable idna's ICU backend by pinning idna_adapter to 1.0.0 (-129 KB) (rolldown#9811) by `@Boshen` - size: use unstable sort where stability is unneeded (rolldown#9803) by `@Boshen` - remove num-format dependency from vite reporter (rolldown#9795) by `@Boshen` - reduce js callback error size (rolldown#9776) by `@Boshen` - rolldown_error: remove Debug supertrait from BuildEvent (rolldown#9798) by `@Boshen` - reduce plugin hook order code size (rolldown#9761) by `@Boshen` - deps: disable `infer` default features to reduce binary size (rolldown#9765) by `@Boshen` - reduce pluginable monomorphization size (rolldown#9771) by `@Boshen` - avoid rebuilding replace plugin values (rolldown#9764) by `@Boshen` - defer link-stage-output drop to rayon workers after output is produced (rolldown#9733) by `@Brooooooklyn` - tree-shaking: hoist already-included guard to call sites in inclusion DFS (rolldown#9738) by `@Brooooooklyn` - renamer: dedup before allocating the owned name in add_symbol_in_root_scope (rolldown#9740) by `@Brooooooklyn` ### 🧪 Testing - allocs: track allocation counts for rolldown_sourcemap (rolldown#9835) by `@hyf0` - bench: add CodSpeed micro-benchmarks for rolldown_sourcemap (rolldown#9834) by `@hyf0` - add cjs named export mutation test (rolldown#9823) by `@sapphi-red` - dev: restore shared-page reliability conventions in AGENTS.md (rolldown#9786) by `@h-a-n-a` - dev: add `AGENTS.md` test guidance for agents (rolldown#9763) by `@h-a-n-a` - dev: split out initial-build-error into its own playground (rolldown#9772) by `@h-a-n-a` - dev: align e2e suite with Vite and parallelize playgrounds (rolldown#9759) by `@h-a-n-a` - remove unnecessary module namespace object JSON serializations in tests (rolldown#9725) by `@sapphi-red` - use `assert.deepStrictEqual` instead of `assert.deepEqual` by using `assert/strict` instead of `assert` (rolldown#9724) by `@sapphi-red` - hmr: add test case for rolldown#5301 (rolldown#5302) by `@sapphi-red` - dev: add tests for dev-engine principles (rolldown#9720) by `@h-a-n-a` - dev: align dev-engine test harness with Vite (rolldown#9684) by `@h-a-n-a` ### ⚙️ Miscellaneous Tasks - add rollipop-integration skill by `@leegeunhyeok` - update esbuild snap diff metrics by `@leegeunhyeok` - sync upstream rolldown v1.1.2 by `@leegeunhyeok` - deps: update napi to 3.9.3 (rolldown#9862) by `@shulaoda` - deps: update oxc to 0.137.0 (rolldown#9856) by `@Boshen` - re-enable default lld linker on x86_64-unknown-linux-gnu (rolldown#9855) by `@Boshen` - deps: bump vite-plus to 0.2.1 (rolldown#9850) by `@Boshen` - skills: translate _config.json when encoding rolldown REPL links (rolldown#9847) by `@IWANABETHATGUY` - deps: update oxc_resolver and oxc_resolver_napi to 11.21.3 (rolldown#9841) by `@Boshen` - pin vite-plus (vp) CLI to 0.1.24 in setup-vp (rolldown#9830) by `@Boshen` - add crate/package-level CODEOWNERS (rolldown#9819) by `@IWANABETHATGUY` - drop unused derive_more display feature from rolldown_plugin (rolldown#9820) by `@Boshen` - remove auto-assign PR workflow (rolldown#9807) by `@IWANABETHATGUY` - deps: update rollup submodule for tests to v4.62.0 (rolldown#9780) by `@rolldown-guard[bot]` - deps: update esbuild for tests to 0.28.1 (rolldown#9779) by `@rolldown-guard[bot]` - deps: update test262 submodule for tests (rolldown#9781) by `@rolldown-guard[bot]` - deps: update oxc to 0.136.0 (rolldown#9770) by `@Boshen` - add pull request template (rolldown#9756) by `@sapphi-red` - clarify `rolldown_plugin_vite_*` is compatible for the same minor (rolldown#9774) by `@sapphi-red` - deps: update github actions (rolldown#9745) by `@renovate[bot]` - deps: update rust crates (rolldown#9747) by `@renovate[bot]` - deps: update napi to v3.9.2 (rolldown#9744) by `@renovate[bot]` - deps: update npm packages (rolldown#9746) by `@renovate[bot]` - deps: update @napi-rs/cli and emnapi deps (rolldown#9741) by `@Brooooooklyn` - generator: fix `vp fmt` on Windows (rolldown#9727) by `@sapphi-red` - ban importing from `assert` and recommend `assert/strict` (rolldown#9726) by `@sapphi-red` Co-authored-by: leegeunhyeok <26512984+leegeunhyeok@users.noreply.github.com>

Summary
Stacked on #9652.
Restructures
packages/test-dev-serverso it tracks Vite's full-bundle-mode devserver (
packages/vite/src/node/server/environments/fullBundleEnvironment.ts),rather than carrying its own ad-hoc shape. The goal is to let dev-engine work be
exercised inside the rolldown repo against a server whose error handling,
middleware, and reload behavior match Vite's — so behavioral regressions in the
dev()engine surface here before they reach Vite.A literal 1:1 port isn't possible: the test harness depends on pieces Vite
doesn't have. Those are kept intentionally:
wsserver (Vite reuses its own HTTP/HMR transport),/_dev/statusendpoint plusbuildSeq/moduleRegistrationSeqtestinstrumentation.
Constraint: the shared rolldown HMR runtime
(
crates/rolldown_plugin_hmr/src/runtime/runtime-extra-dev-default.js) is nottouched — every change lives in
packages/test-dev-server.Structure
The flat
dev-server.tsis split to mirror Vite's layout:src/environments/full-bundle-dev-environment.ts(FullBundleDevEnvironment)environments/fullBundleEnvironment.tssrc/middlewares/{memory-files,index-html,trigger-lazy-bundling,status}.tsserver/middlewares/*src/{clients,memory-files,fallback-html}.ts,src/utils/{debounce,prepare-error}.tssrc/dev-server.tsserver/index.ts(connect/http/ws transport + middleware wiring only)FullBundleDevEnvironmentnow owns the dev engine, the in-memory output, theclient registry, and the
lastBuildError/fullReloadPendingstate.Behavior ported from Vite
lastBuildErroris cached from either callback channel(
onOutput/onHmrUpdates), broadcast on break, and replayed on clientconnect so the overlay survives a refresh; it's cleared on a successful build
from either channel.
error-overlay.ts): stand-in for Vite's clientoverlay, injected into the generated
index.htmland the "Bundling inprogress" spinner. Runs as its own ws client alongside the rolldown HMR
runtime; because HMR patches are delivered per-client, recovery is signalled
by a broadcast
build:ok(HMR recovery) and a reload (full-build recovery).prepareError(utils/prepare-error.ts): port of Vite's helper — stripsANSI via
node:util'sstripVTControlCharactersand copies only the fieldsthe overlay needs (
message/stack/id/frame/plugin/pluginCode/loc).fullReloadPending), debouncedreload, conservative stale-output regen guard
(
hasStaleOutput && !lastBuildErrored && initialBuildCompleted), andnoop/empty HMR-batch filtering.
skipWrite; node target serves from disk behind a request gate.Docs
Reconciles
meta/design/dev-engine.md§2: it claimedlastBuildErrorclearsonly on a successful
onOutput, but Vite (and now this port) also clears it on asuccessful
onHmrUpdates.Testing
pnpm test:fixtures(9) andpnpm test:browser(10) pass, including a newbrowser.spec.tscase asserting the build-error overlay appears on a break andclears on recovery.