refactor(watch): remove auto watch for fail imports#8585
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. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
✅ Deploy Preview for rolldown-rs canceled.
|
There was a problem hiding this comment.
Pull request overview
This PR refactors rolldown’s watch mode to stop auto-rebuilding when previously-missing imports appear on disk, aligning behavior with Rollup’s “only watch successfully loaded modules” approach.
Changes:
- Removes “missing import directory” tracking and rebuild-on-create behavior from the Rust watcher/plugin pipeline.
- Updates watch-mode design docs and the relevant watch tests to reflect the new recovery workflow (create missing file, then touch a watched file).
- Adds a new
examples/watchworkspace project for watch-mode usage.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds examples/watch as a workspace importer dependency on rolldown. |
| packages/rolldown/tests/watch/watch.test.ts | Adjusts tests to trigger rebuild via touching an already-watched file after fixing missing imports. |
| meta/design/watch-mode.md | Updates design documentation to describe manual recovery instead of auto-watching missing import directories. |
| examples/watch/rolldown.config.js | Adds a watch-mode example config using defineConfig. |
| examples/watch/package.json | Adds the watch example workspace package definition. |
| examples/watch/index.ts | Adds example entrypoint (currently logs hello() result). |
| examples/watch/hello.ts | Adds example module for the watch demo. |
| crates/rolldown_watcher/src/watch_task.rs | Removes missing-import directory watching and simplifies rebuild invalidation to watched files only. |
| crates/rolldown_watcher/src/watch_coordinator.rs | Updates coordinator to call the new mark_needs_rebuild(&path) signature. |
| crates/rolldown_plugin/src/plugin_driver/plugin_driver_factory.rs | Removes initialization of missing_import_dirs from PluginDriver. |
| crates/rolldown_plugin/src/plugin_driver/mod.rs | Removes missing_import_dirs storage and its lifecycle clearing. |
| crates/rolldown/src/module_loader/resolve_utils.rs | Removes missing-import tracking during resolution failures. |
| crates/rolldown/src/bundle/bundle.rs | Removes get_missing_import_dirs() API from Bundle. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Benchmarks Rust |
Merge activity
|
4bc4a11 to
5622d0f
Compare
## [1.0.0-rc.8] - 2026-03-09 ### 🚀 Features - watch: enable full functional fs watcher in wasm (#8575) by @hyf0 - watch: expose debounce related options (#8572) by @hyf0 ### 🐛 Bug Fixes - detect new URL(…, import.meta.url) with no-sub template literal (#8565) by @char - devtools: trace dynamic imports in devtools (#8581) by @cal-gooo - watch: rebuild when a previously missing file is created (#8562) by @hyf0-agent - watch: filter out Access events to prevent infinite rebuild loop on Linux (#8557) by @hyf0-agent ### 🚜 Refactor - watch: remove auto watch for fail imports (#8585) by @hyf0 - fs_watcher: unify the way of constructing watcher (#8571) by @hyf0 - cli: migrate CLI to CAC (#8551) by @h-a-n-a - switch asset module support from hard-code to builtin plugin (#8546) by @hyf0 ### 📚 Documentation - fix subject-verb agreement in why-bundlers.md (#8591) by @brandonzylstra - maintenance: align release and canary workflow guide (#8538) by @minsoo-web - add `format` option to directives example config (#8590) by @shulaoda - fix: change twitter to x logo in team (#8552) by @mdong1909 - correct composable filter support explanation (#8550) by @sapphi-red ### ⚡ Performance - testing: share tokio runtime across fixture tests (#8567) by @Boshen ### 🧪 Testing - hmr: fix infinite loop in dev server test retry logic (#8576) by @hyf0-agent - cli: add more cli-e2e test cases (#8548) by @h-a-n-a ### ⚙️ Miscellaneous Tasks - docs: update in-depth/directives for `output.strict` option (#8535) by @minsoo-web - add PNPM_HOME Dev Drive mapping to Windows CI workflows (#8589) by @Boshen - deps: update github-actions (#8588) by @renovate[bot] - move Windows cargo target dir to Dev Drive (#8586) by @Boshen - optimize cache keys to fix race conditions and reduce usage (#8578) by @Boshen - remove WASI build & test pipeline (#8580) by @Boshen - remove unnecessary submodule checkouts (#8577) by @Boshen - use Dev Drive for Windows CI jobs (#8574) by @Boshen - skip redundant native binding build for browser and remove standalone job (#8573) by @Boshen - parallelize Node tests on ubuntu, single Node 24 on macOS/windows (#8570) by @Boshen - docs: bump @voidzero-dev/vitepress-theme to 4.8.0 (#8558) by @crusty-voidzero - dedupe type-check from dev server workflow (#8554) by @Boshen ### ❤️ New Contributors * @brandonzylstra made their first contribution in [#8591](#8591) * @char made their first contribution in [#8565](#8565) * @cal-gooo made their first contribution in [#8581](#8581) * @hyf0-agent made their first contribution in [#8562](#8562) * @h-a-n-a made their first contribution in [#8551](#8551) Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>

Partially reverts #8562 but still keeps the fix for #8560