Skip to content

test(dev): fix hmr-hot-update-hook-vite fixture on Windows - #10565

Merged
graphite-app[bot] merged 1 commit into
mainfrom
fix-hmr-hot-update-hook-vite-windows
Jul 31, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
fix-hmr-hot-update-hook-vite-windows

Conversation

@h-a-n-a

@h-a-n-a h-a-n-a commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

What

Windows dev-server CI has been red since the hmr-hot-update-hook-vite playground landed (for example this run): the 5 lookup-based specs fail on Windows while macOS passes.

Why

  • The engine hands hotUpdate hooks vite-normalized paths: ctx.file and the module ids use forward slashes on every OS.
  • The fixture built its module-graph lookup keys with win32 path.join, which produces backslash keys on Windows. Every getModuleById lookup missed, the fixture's own asserts threw inside the hook, the HMR update failed, and the recovery full reload wiped the browser counters the specs poll.
  • The resolveId hook also returned a win32-joined id, so the by-file expansion could not relate widget.js?part=extra to the edited base file.

Fix

  • Add a small slash helper to @rolldown/test-dev-server (playground configs cannot import vite's normalizePath) and re-export it from test-utils for specs.
  • Normalize the six lookup keys and the resolveId return with it: slash(path.join(dir, 'dep.js')) — the same pattern real vite plugins use on Windows.
  • addWatchFile calls stay unchanged: the engine normalizes watch registrations itself.

Tested

  • pnpm vitest run --config vitest.config.e2e.mts playground/hmr-hot-update-hook-vite passes 8/8 on macOS.
  • The ci: windows label on this PR runs the Windows job, which is the real verification.

🤖 Generated with Claude Code

h-a-n-a commented Jul 31, 2026

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add 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.

@netlify

netlify Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 1f32178
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6a6c9108ff5004000753f06a

h-a-n-a commented Jul 31, 2026 •

Copy link
Copy Markdown
Member Author

Merge activity

  • Jul 31, 12:10 PM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jul 31, 12:10 PM UTC: h-a-n-a added this pull request to the Graphite merge queue.
  • Jul 31, 12:26 PM UTC: Merged by the Graphite merge queue.

### What

Windows dev-server CI has been red since the `hmr-hot-update-hook-vite` playground landed (for example [this run](https://github.com/rolldown/rolldown/actions/runs/30604121832/job/91073203779)): the 5 lookup-based specs fail on Windows while macOS passes.

### Why

- The engine hands `hotUpdate` hooks vite-normalized paths: `ctx.file` and the module ids use forward slashes on every OS.
- The fixture built its module-graph lookup keys with win32 `path.join`, which produces backslash keys on Windows. Every `getModuleById` lookup missed, the fixture's own asserts threw inside the hook, the HMR update failed, and the recovery full reload wiped the browser counters the specs poll.
- The `resolveId` hook also returned a win32-joined id, so the by-file expansion could not relate `widget.js?part=extra` to the edited base file.

### Fix

- Add a small `slash` helper to `@rolldown/test-dev-server` (playground configs cannot import vite's `normalizePath`) and re-export it from `test-utils` for specs.
- Normalize the six lookup keys and the `resolveId` return with it: `slash(path.join(dir, 'dep.js'))` — the same pattern real vite plugins use on Windows.
- `addWatchFile` calls stay unchanged: the engine normalizes watch registrations itself.

### Tested

- `pnpm vitest run --config vitest.config.e2e.mts playground/hmr-hot-update-hook-vite` passes 8/8 on macOS.
- The `ci: windows` label on this PR runs the Windows job, which is the real verification.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@graphite-app
graphite-app Bot force-pushed the fix-hmr-hot-update-hook-vite-windows branch from ed9edbe to 1f32178 Compare July 31, 2026 12:11
@graphite-app
graphite-app Bot merged commit 1f32178 into main Jul 31, 2026
34 of 35 checks passed
@graphite-app
graphite-app Bot deleted the fix-hmr-hot-update-hook-vite-windows branch July 31, 2026 12:26
@rolldown-guard rolldown-guard Bot mentioned this pull request Aug 3, 2026
shulaoda added a commit that referenced this pull request Aug 3, 2026
## [1.2.2] - 2026-08-03

### 🚀 Features

- code-splitting: support inlining of shared deps in dynamic entries (#10526) by @nicolo-ribaudo
- plugin: time the user callbacks configured on the options (#10509) by @IWANABETHATGUY

### 🐛 Bug Fixes

- dev: force `cleanDir` off in dev mode (#10579) by @shulaoda
- dev: keep `?rolldown-lazy` proxy ids out of user `resolveId` hooks (#10580) by @btea
- initialize re-exported wrapped ESM modules at the entry chunk (#10567) by @hyfdev
- link: resolve circular star reexports as null (#10445) by @Nic-Polumeyv
- transform: transformer gate skips newer syntax that oxc can lower (#10564) by @sekyungk
- code-splitting: materialize consumer-local barrel routing when the order-wrap plan is empty (#10544) by @hyfdev
- plugin: measure plugin hooks in JavaScript, report them from Rust (#10508) by @IWANABETHATGUY
- plugin: include external dynamic imports in chunk metadata (#10557) by @hyfdev
- plugin: report plugin timings after closeBundle has run (#10521) by @IWANABETHATGUY
- browser: avoid using node builtin modules (#10542) by @sapphi-red

### 🚜 Refactor

- plugin: give the build's own clocks their own type (#10520) by @shulaoda

### 📚 Documentation

- correct stale `buildStart` comment in `ScanStageCache::merge` (#10577) by @shulaoda
- update outdated pluginutils references (#10574) by @dogledogle

### ⚡ Performance

- external: drop the runtime import from chunks that never wrap (#10517) by @IWANABETHATGUY
- plugin: clock the build only when it is being measured (#10558) by @IWANABETHATGUY

### 🧪 Testing

- vite-tests: drop the dead `@rolldown/pluginutils` pnpm override (#10575) by @IWANABETHATGUY
- transform: group the transform-target fixtures and say why each exists (#10569) by @IWANABETHATGUY
- dev: fix hmr-hot-update-hook-vite fixture on Windows (#10565) by @h-a-n-a
- dev: match Vite's renamed full-reload log (#10547) by @shulaoda

### ⚙️ Miscellaneous Tasks

- deps: update napi (#10576) by @renovate[bot]
- deps: bump `@napi-rs/wasm-runtime` to 1.2.2 (#10570) by @shulaoda
- deps: update npm packages (#10583) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to ^0.28.0 (#10588) by @renovate[bot]
- deps: update taiki-e/install-action action to v2.85.5 (#10587) by @renovate[bot]
- deps: update codspeedhq/action action to v5 (#10584) by @renovate[bot]
- deps: update github actions (#10582) by @renovate[bot]
- deps: update rust crates (#10581) by @renovate[bot]
- deps: update dependency vite-plus to v0.2.7 (#10568) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.27.14 (#10531) by @renovate[bot]
- deps: update pnpm to v11.17.0 (#10571) by @renovate[bot]
- deps: update @napi-rs/wasm-runtime to 1.2.1 (#10545) by @sapphi-red

### ❤️ New Contributors

* @sekyungk made their first contribution in [#10564](#10564)
* @nicolo-ribaudo made their first contribution in [#10526](#10526)

Co-authored-by: shulaoda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants