test(dev): expect preserved hot.data in hmr-whole-chain-dispose#10380
Merged
Conversation
The `hmr-whole-chain-dispose` browser fixture runs on Vite's full-bundle client (the `vite/` checkout, `rolldown-canary`). That client now preserves `import.meta.hot.data` across a module's HMR generations — the disposer receives the existing bag and direct writes into `hot.data` survive — which is Vite's documented contract (vitejs/vite#23001). The test and fixtures still asserted the old "fresh data bag per generation" behavior, so it failed once the client started preserving: `expected 'baz-own-write' to be null`. Rewrite the fixtures and assertions to expect preservation: rename the `leak` probe to `own` and assert each module's own direct write is read back by the next generation. Whole-chain dispose coverage (foo, bar, and the boundary all dispose each generation) is unchanged.
✅ Deploy Preview for rolldown-rs canceled.
|
hyfdev
approved these changes
Jul 22, 2026
shulaoda
approved these changes
Jul 22, 2026
Member
Merge activity
|
Brooooooklyn
added a commit
that referenced
this pull request
Jul 22, 2026
Catches the branch up to main so CI can run again (the PR was CONFLICTING against the advanced base) and pulls in the fixes that target this branch's red dev-server tests: #10380 test(dev): expect preserved hot.data in hmr-whole-chain-dispose — Vite's rolldown-canary client now preserves import.meta.hot.data; this branch had the stale pre-#10380 assertion. Taken from main. #10363/#10381 tokio runtime acquire/release pairing + release-on-reject. Conflicts resolved to this branch's side (--ours) — the branch's shared tokio-free runtime supersedes main's tokio-refcount work: - dev-engine.ts / experimental.ts / rolldown-build.ts / watch/watcher.ts: main wraps shutdownAsyncRuntime() in try/finally (#10381). This branch already releases via the RuntimeLease abstraction inside a `finally` (release-on-reject guaranteed) plus AggregateError cleanup — a strict superset, so #10381 is subsumed. Verified main touched only the lease/startAsyncRuntime lines in these files. - crates/rolldown_binding/src/lib.rs + generated binding.d.cts: main adds the ACTIVE_TASK_COUNT tokio refcount to start/shutdown_async_runtime (#10363). This branch removed tokio, so those exports are compatibility no-ops (napi env lifecycle owns teardown; the legacy tokio-WASI path uses the old binding's own code). Verified main's changes here are entirely the refcount + its doc comments. No lockfile/catalog conflicts: main touched no manifests in aa73a68..c07a55c. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
hmr-whole-chain-disposebrowser fixture runs on Vite's full-bundle client (the provisionedvite/checkout,vitejs/viterolldown-canary), not rolldown's native runtime — see the note infull-bundle-dev-environment.ts. That client'shandleModuleCacheRemovalwas recently fixed to preserveimport.meta.hot.dataacross a module's HMR generations, matching Vite's documented contract:On
rolldown-canarythe client (renamed tobundledDevHmrClient.ts) now does:But this test + fixtures still asserted the old "each generation gets a fresh data bag" behavior, so once the client started preserving, CI failed:
(
'baz-own-write'is a directhot.datawrite from generation 0 that correctly survived into generation 1.)Change
Align the fixtures and assertions with the preserved-data contract:
leakprobe (which meant "a direct write that must NOT survive") toown, and assert each module's own directhot.datawrite is read back by the next generation (own === \${id}-own-write``).gen0bags are still empty (gen: null,own: null); the disposer-writtengencounter still advances1 → 2— those were already passing and are unchanged.Validation
vp check(lint/format) via the commit hook.node-dev-server-test); it requires the provisionedvite/checkout + native build, so it was not run locally. Expectations were derived from the preserved-data semantics and confirmed againstrolldown-canary's currentbundledDevHmrClient.tsand the exact CI failure value.Note: the separate
Vite Testjob failing on the same runs is the Vite-side manifestation of the same behavior change and is not addressed here (it lives in thevite/checkout, not this repo).