Skip to content

feat(watch): support directories in addWatchFile - #10944

Merged
shulaoda merged 1 commit into
mainfrom
09-22-feat_watch_support_directories_in_addwatchfile
Sep 22, 2026
Merged

shulaoda merged 1 commit into
mainfrom
09-22-feat_watch_support_directories_in_addwatchfile

Conversation

@shulaoda

@shulaoda shulaoda commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Watch directories passed to this.addWatchFile recursively, so a change below them triggers a rebuild or an HMR update.

@shulaoda
shulaoda added this pull request to stack #10947 September 22, 2026 02:43
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Failed ❌

View logs ↗
5ae9a42 2026-09-22T06:26:34.311Z View logs ↗
  • Build: Failed ❌

View logs ↗
53ab114 2026-09-22T06:16:25.032Z View logs ↗
  • Build: Failed ❌

View logs ↗
c4ece27 2026-09-22T06:06:53.882Z View logs ↗
  • Build: Failed ❌

View logs ↗
9e4ed77 2026-09-22T02:56:54.275Z View logs ↗
  • Build: Failed ❌

View logs ↗
cdcbce5 2026-09-22T02:47:45.319Z View logs ↗
  • Build: Failed ❌

View logs ↗
af64a87 2026-09-22T02:45:06.239Z View logs ↗

@netlify

netlify Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 5ae9a42
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6ab21ef3a7b51b0009b14a98

@shulaoda
shulaoda force-pushed the 09-22-feat_watch_support_directories_in_addwatchfile branch from cdcbce5 to 9e4ed77 Compare September 22, 2026 02:55
@shulaoda
shulaoda marked this pull request as ready for review September 22, 2026 05:32
@codspeed

codspeed Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 7 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing 09-22-feat_watch_support_directories_in_addwatchfile (5ae9a42) with main (ed71de4)2

Open in CodSpeed

Footnotes

  1. 10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (3462e36) during the generation of this report, so ed71de4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@h-a-n-a

h-a-n-a commented Sep 22, 2026

Copy link
Copy Markdown
Member

We can add a generated file check just like what Rollup did. Not a blocker.

@shulaoda
shulaoda force-pushed the 09-22-feat_watch_support_directories_in_addwatchfile branch from 9e4ed77 to c4ece27 Compare September 22, 2026 06:04
Base automatically changed from 09-22-refactor_watch_identify_watch_files_by_normalized_path to main September 22, 2026 06:13
@shulaoda
shulaoda force-pushed the 09-22-feat_watch_support_directories_in_addwatchfile branch from c4ece27 to 53ab114 Compare September 22, 2026 06:13
@shulaoda
shulaoda force-pushed the 09-22-feat_watch_support_directories_in_addwatchfile branch 2 times, most recently from 53ab114 to 5ae9a42 Compare September 22, 2026 06:23
@shulaoda
shulaoda merged commit 1551cf8 into main Sep 22, 2026
36 of 37 checks passed
@shulaoda
shulaoda deleted the 09-22-feat_watch_support_directories_in_addwatchfile branch September 22, 2026 06:32
Brooooooklyn added a commit that referenced this pull request Sep 22, 2026
Merge origin/main (5c676e5) into the tokio-free runtime branch.

Resolved conflicts (9 files):
- Cargo.lock: kept our napi-async-runtime 0.2.2 block; cargo
  metadata --locked passes with no lock change.
- crates/rolldown_dev/Cargo.toml: tokio and sugar_path are both
  dev-dependencies only.
- crates/rolldown_dev/src/bundle_coordinator.rs: our union-based
  update_watch_paths_including and always-commit flow, on main's
  WatchPath-typed watched_files.
- crates/rolldown_dev/src/dev_context.rs: main's doc text, our
  async_lock-backed TokioMutex field types.
- crates/rolldown_plugin/src/plugin_driver/mod.rs: drop both the
  sugar_path and tokio broadcast imports (no users remain).
- crates/rolldown_watcher/src/watch_task.rs: our group watcher and
  group_registered_files, retyped to WatchPath.
- internal-docs/dev-engine/implementation.md: merged method table,
  both paragraphs, and corrected the BindingResult users list.
- pnpm-workspace.yaml: keep miniflare plus main's oxc 0.151.0.
- pnpm-lock.yaml: @oxc-node/cli 0.1.3 plus our buffer entry, then
  pnpm install restored the scripts importer's wrangler 4.131.0
  closure that the text merge had dropped.

RecursiveMode::Recursive at the two sites git would have kept as
NonRecursive (main's addWatchFile(dir) support, #10944):
- crates/rolldown_watcher/src/watch_task.rs update_watch_files_from
  (second loop, outside the conflict hunks)
- crates/rolldown_dev/src/bundle_coordinator.rs
  update_watch_paths_from

Also updated internal-docs/watch-mode/implementation.md for the
WatchPath set types and recursive watching.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T34fMrYCf2V13Mg8BKmnda
@rolldown-guard rolldown-guard Bot mentioned this pull request Sep 23, 2026
shulaoda added a commit that referenced this pull request Sep 23, 2026
## [1.2.10] - 2026-09-23

### 🚀 Features

- rolldown_plugin_esm_external_require: prefer 'module.exports' over a namespace spread (#10901) by @isker
- watch: support directories in addWatchFile (#10944) by @shulaoda
- label code-splitting timing rows (#10896) by @IWANABETHATGUY
- separate code-splitting group timing rows (#10892) by @IWANABETHATGUY
- clarify callback owners in the timing report (#10890) by @IWANABETHATGUY
- add checks.bundlerTimings with deprecated pluginTimings alias (#10883) by @IWANABETHATGUY

### 🐛 Bug Fixes

- code-splitting: initialize leaves behind a re-exported namespace import (#10694) by @hyfdev
- node: record the WASI target on the WebContainer binding fallback (#10952) by @shulaoda
- dev: force incremental build on in DevEngine::new (#10958) by @o-alexandrov
- tree-shaking: propagate side effects through cycles (#10893) by @IWANABETHATGUY
- deconflict CJS locals that shadow a renamed require wrapper (#10793) by @logaretm
- include group indexes in labeled `codeSplitting` timing rows (#10916) by @IWANABETHATGUY
- docs: type-check Algolia `indices` option (#10934) by @shulaoda
- docs: restore Algolia search (#10929) by @isker
- tell code-splitting timing rows apart by position (#10903) by @IWANABETHATGUY

### 🚜 Refactor

- rolldown_fs_watcher: remove the single-path API (#10950) by @shulaoda
- dev: register watch files through FsWatcher (#10949) by @shulaoda
- watch: let FsWatcher own the watched paths (#10948) by @shulaoda
- watch: identify watch files by normalized absolute path (#10943) by @shulaoda
- plugin: build a plugin-resolved `ResolvedId` in one place (#10921) by @IWANABETHATGUY

### 📚 Documentation

- dev: add HMR design, align dev docs and engine comments (#10271) by @h-a-n-a

### ⚡ Performance

- batch `sourcemapPathTransform` calls (#10763) by @IWANABETHATGUY
- batch `sourcemapIgnoreList` calls (#10762) by @IWANABETHATGUY
- hmr: drop the unused kind argument from registerFactory (#10915) by @h-a-n-a

### 🧪 Testing

- handle Windows paths in sourcemap callback tests (#10942) by @IWANABETHATGUY

### ⚙️ Miscellaneous Tasks

- replace custom `ban-expect-assertions` JS lint with builtin `no-restricted-properties` (#10933) by @isker
- deps: update napi (#10959) by @renovate[bot]
- deps: upgrade oxc to 0.151.0 (#10939) by @camc314
- deps: update test262 submodule for tests (#10941) by @rolldown-guard[bot]
- deps: update npm packages (#10931) by @renovate[bot]
- deps: update napi (#10928) by @renovate[bot]
- deps: update dependency vite-plus to v0.3.3 (#10914) by @renovate[bot]
- deps: update rust crates (#10932) by @renovate[bot]
- deps: update github actions (#10930) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.28.6 (#10924) by @renovate[bot]
- deps: update crate-ci/typos action to v1.50.2 (#10917) by @renovate[bot]
- deps: update dependency @napi-rs/cli to v3.10.4 (#10913) by @renovate[bot]
- deps: update napi (#10897) by @renovate[bot]

### ❤️ New Contributors

* @o-alexandrov made their first contribution in [#10958](#10958)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants