Repository navigation
feat(dev): add hotUpdate dev option to gate the hotUpdate hook - #10837
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. |
✅ Deploy Preview for rolldown-rs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://feat-dev-hot-update-hook-option-rolldown-rs.voidzero-docs.workers.dev (commit bba03da)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
a4a2956 to
a9554f0
Compare
Merge activity
|
Merging this PR will not alter performance
Comparing Footnotes
|
…10837) <!-- - What is this PR solving? Write a clear and concise description. - Reference the issues it solves (e.g. `fixes #123`). - What other alternatives have you explored? - Are there any parts you think require more attention from reviewers? Also, please make sure you do the following: - Read the Contributing Guidelines at https://rolldown.rs/contribution-guide/. - Check that there isn't already a PR that solves the problem the same way. If you find a duplicate, please help us review it. - Update the corresponding documentation if needed. - Include relevant tests that fail without this PR but pass with it. If the tests are not included, explain why. Thank you for contributing to Rolldown! --> Add `dev.hotUpdate` option to gate `hotUpdate` hook.
a9554f0 to
bba03da
Compare
## [1.2.8] - 2026-09-09 ### 🚀 Features - dev: add `hotUpdate` dev option to gate the `hotUpdate` hook (#10837) by @h-a-n-a - docs: add wrangler (#10821) by @mdong1909 ### 🐛 Bug Fixes - dev: clean stale dynamic entry references after partial scans (#10846) by @shulaoda - include external wildcard re-exports in `OutputChunk.imports` (#10845) by @isker ### 📚 Documentation - document dynamic entry cache merging after partial scans (#10848) by @shulaoda ### ⚡ Performance - cache `getModuleInfo` during code splitting (#10838) by @hyfdev ### 🧪 Testing - dev: cover stale dynamic entry references after partial scans (#10847) by @shulaoda ### ⚙️ Miscellaneous Tasks - deps: update dependency @napi-rs/cli to v3.9.0 (#10816) by @renovate[bot] - deps: update dependency rolldown-plugin-dts to v0.28.5 (#10827) by @renovate[bot] - deps: update dependency vite-plus to v0.3.1 (#10842) by @renovate[bot] - deps: upgrade oxc to 0.149.0 (#10834) by @camc314 - deps: update rust crates (#10830) by @renovate[bot] - deps: update npm packages (#10832) by @renovate[bot] - deps: update crate-ci/typos action to v1.50.1 (#10824) by @renovate[bot] - deps: update test262 submodule for tests (#10836) by @rolldown-guard[bot] - deps: update github actions (#10831) by @renovate[bot] - deps: update dependency rust to v1.98.1 (#10819) by @renovate[bot] ### ❤️ New Contributors * @isker made their first contribution in [#10845](#10845) Co-authored-by: shulaoda <[email protected]>
…tion via hotUpdate (#10550) Part of #10059 ## Problem Vite's JS plugin keeps the result of a glob fresh from a `hotUpdate` hook. Under bundled dev the native plugin replaces it, and the native plugin only implemented `transform`. #10549 makes the file events arrive, but nothing maps them to the module that owns the glob. ## What this PR does Implements `hotUpdate` in the native plugin, the way Vite's plugin does it. - Each `import.meta.glob` call gets one matcher in dev mode. It is built with globstar from the absolute globs of the call, with the options Vite passes to picomatch. `dot` follows `exhaustive`, case folding follows `caseSensitive`, and `**/node_modules/**` is excluded unless `exhaustive` is set. - The glob syntax in the literal part of a path is escaped, like Vite's `globSafeResolvedPath`. - For a created or deleted file, the hook adds every module with a matcher that matches the file to the affected set. - A content edit is declined. It cannot change which files a glob matches. The walk in `transform` is not changed. It still matches with `fast_glob`. ## Note The `hotUpdate` hook is off by default (`dev.hotUpdate`, #10837), and Vite does not pass the option yet (vitejs/vite#22956). This PR takes effect once the option is on. The hook is as simple as Vite's, so it inherits what the watcher and the engine do differently from Vite: - A file saved by renaming a temporary file over it is reported as created, so the module of the glob is updated with it. - A deleted directory is reported without its files, and no glob matches a directory. - The matchers of a deleted module stay, like in Vite, but the engine still knows the module.

Add
dev.hotUpdateoption to gatehotUpdatehook.