Repository navigation
fix(dev): align import.meta.hot.accept deps with Vite - #10997
Conversation
✅ Deploy Preview for rolldown-rs canceled.
|
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. |
d0b5db4 to
169e79f
Compare
Merge activity
|
Rolldown now reads `import.meta.hot.accept()` deps the same way Vite's unbundled dev does (`lexAcceptedHmrDeps` in `packages/vite/src/node/server/hmr.ts`).
### Supported forms
| Call | Rolldown | Vite |
|---|---|---|
| `accept()` | self-accept | self-accept |
| `accept(cb)` | self-accept | self-accept |
| `accept(null, cb)`, `accept(someVar, cb)` (any first argument that is not a string or an array) | self-accept | self-accept |
| `accept('./dep')` (one argument) | accepts `./dep` | accepts `./dep` |
| `accept('./dep', cb)` | accepts `./dep` | accepts `./dep` |
| `accept('./dep', cb, extra)` (three or more arguments) | accepts `./dep` | accepts `./dep` |
| ``accept(`./dep`, cb)`` (template literal without `${}`) | accepts `./dep` | accepts `./dep` |
| `accept(['./a', './b'], cb)` | accepts `./a` and `./b` | accepts `./a` and `./b` |
| ``accept(['./a', `./b`], cb)`` | accepts `./a` and `./b` | accepts `./a` and `./b` |
| `accept([, './a'], cb)` (array with holes) | accepts `./a`, holes are skipped | accepts `./a`, holes are skipped |
In every "accepts" case, the dep string in the output is rewritten to the module's stable id, so the runtime can match it.
### Rejected forms
These now fail with a build error. Vite's unbundled dev rejects them too.
| Call | Why | Rolldown | Vite |
|---|---|---|---|
| ``accept(`./${name}`, cb)`` | template literal with `${}` | build error | transform error |
| `accept(['./a', someVar], cb)` | array item that is not a static string | build error | transform error |
| `accept([...deps], cb)` | spread in the array | build error | transform error |
169e79f to
e2be5e1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 169e79f124
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Rolldown now reads `import.meta.hot.accept()` deps the same way Vite's unbundled dev does (`lexAcceptedHmrDeps` in `packages/vite/src/node/server/hmr.ts`).
### Supported forms
| Call | Rolldown | Vite |
|---|---|---|
| `accept()` | self-accept | self-accept |
| `accept(cb)` | self-accept | self-accept |
| `accept(null, cb)`, `accept(someVar, cb)` (any first argument that is not a string or an array) | self-accept | self-accept |
| `accept('./dep')` (one argument) | accepts `./dep` | accepts `./dep` |
| `accept('./dep', cb)` | accepts `./dep` | accepts `./dep` |
| `accept('./dep', cb, extra)` (three or more arguments) | accepts `./dep` | accepts `./dep` |
| ``accept(`./dep`, cb)`` (template literal without `${}`) | accepts `./dep` | accepts `./dep` |
| `accept(['./a', './b'], cb)` | accepts `./a` and `./b` | accepts `./a` and `./b` |
| ``accept(['./a', `./b`], cb)`` | accepts `./a` and `./b` | accepts `./a` and `./b` |
| `accept([, './a'], cb)` (array with holes) | accepts `./a`, holes are skipped | accepts `./a`, holes are skipped |
In every "accepts" case, the dep string in the output is rewritten to the module's stable id, so the runtime can match it.
### Rejected forms
These now fail with a build error. Vite's unbundled dev rejects them too.
| Call | Why | Rolldown | Vite |
|---|---|---|---|
| ``accept(`./${name}`, cb)`` | template literal with `${}` | build error | transform error |
| `accept(['./a', someVar], cb)` | array item that is not a static string | build error | transform error |
| `accept([...deps], cb)` | spread in the array | build error | transform error |
e2be5e1 to
b082026
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
## [1.2.12] - 2026-09-30 ### 🚀 Features - inline common chunks containing import() and deduplicate shared code in lazy chunks (#11034) by @hyfdev - experimental `inlineCommonChunks` support (#10899) by @hyfdev - dev: ship imported bindings for HMR partial accept (#10856) by @h-a-n-a ### 🐛 Bug Fixes - chunking: re-derive chunk exec orders after the runtime leaves its host chunk (#11005) by @hyfdev - code-splitting: gate member-read init paths on the reading statement (#11039) by @hyfdev - code-splitting: retain initialization paths through re-exported namespaces (#11037) by @hyfdev - dev: reject non-ESM output formats in dev mode (#11038) by @h-a-n-a - dev: align `import.meta.hot.accept` deps with Vite (#10997) by @h-a-n-a - dev: clear the resolver cache when a file is created or deleted (#10986) by @waltuov - error: name the resolved specifier in unresolved import diagnostics (#11014) by @linyiru - make entries-aware chunk merging deterministic (#11002) by @hyfdev - watch: avoid restarting macOS watcher for unchanged paths (#10992) by @sep2 ### 🚜 Refactor - dev: ship the dev runtime entry as one file (#10998) by @h-a-n-a - binding: remove `__internalForcePanic` (#10989) by @IWANABETHATGUY ### 📚 Documentation - fix cloudflare preview builds (#10996) by @sapphi-red - fix build config loader warning (#10994) by @sapphi-red - deps: use Vite 8 (#10993) by @sapphi-red ### ⚡ Performance - dev: only ship rows with dynamic edges in registerGraph (#11019) by @h-a-n-a ### 🧪 Testing - code-splitting: cover more re-exported namespace shapes (#11042) by @hyfdev - webcontainer: cover the WebContainer download fallback in plain Node (#10966) by @shulaoda - dev: pin the runtime entry file layout that Vite serves (#10983) by @h-a-n-a ### ⚙️ Miscellaneous Tasks - pin VOID_API_URL for the docs deploy (#11041) by @shulaoda - opt into the WebContainer smoke test for napi bumps and loader changes (#10967) by @shulaoda - deps: upgrade oxc to 0.152.0 (#11018) by @camc314 - deps: update rust crates (#11012) by @renovate[bot] - deps: update npm packages (#11011) by @renovate[bot] - deps: update crate-ci/typos action to v1.50.3 (#11023) by @renovate[bot] - deps: update test262 submodule for tests (#11022) by @rolldown-guard[bot] - deps: update rollup submodule for tests to v4.63.5 (#11021) by @rolldown-guard[bot] - deps: update dependency vite-plus to v1 (#11017) by @renovate[bot] - deps: update github actions (#11010) by @renovate[bot] - remove `CLAUDE.md` (#10925) by @iiio2 - verify release debug info by matching file IDs (#10988) by @IWANABETHATGUY - deps: update rollup submodule for tests to v4.63.4 (#10940) by @rolldown-guard[bot] ### ❤️ New Contributors * @waltuov made their first contribution in [#10986](#10986) * @linyiru made their first contribution in [#11014](#11014) * @sep2 made their first contribution in [#10992](#10992) Co-authored-by: shulaoda <[email protected]>

Rolldown now reads
import.meta.hot.accept()deps the same way Vite's unbundled dev does (lexAcceptedHmrDepsinpackages/vite/src/node/server/hmr.ts).Supported forms
accept()accept(cb)accept(null, cb),accept(someVar, cb)(any first argument that is not a string or an array)accept('./dep')(one argument)./dep./depaccept('./dep', cb)./dep./depaccept('./dep', cb, extra)(three or more arguments)./dep./depaccept(`./dep`, cb)(template literal without${})./dep./depaccept(['./a', './b'], cb)./aand./b./aand./baccept(['./a', `./b`], cb)./aand./b./aand./baccept([, './a'], cb)(array with holes)./a, holes are skipped./a, holes are skippedIn every "accepts" case, the dep string in the output is rewritten to the module's stable id, so the runtime can match it.
Rejected forms
These now fail with a build error. Vite's unbundled dev rejects them too.
accept(`./${name}`, cb)${}accept(['./a', someVar], cb)accept([...deps], cb)