Skip to content

refactor(fs_watcher): unify the way of constructing watcher#8571

Merged
graphite-app[bot] merged 1 commit intomainfrom
03-07-refactor_fs_watcher_unify_the_way_of_constructing_watcher
Mar 7, 2026
Merged

refactor(fs_watcher): unify the way of constructing watcher#8571
graphite-app[bot] merged 1 commit intomainfrom
03-07-refactor_fs_watcher_unify_the_way_of_constructing_watcher

Conversation

@hyf0
Copy link
Member

@hyf0 hyf0 commented Mar 7, 2026

No description provided.

Copy link
Member Author

hyf0 commented Mar 7, 2026


How to use the Graphite Merge Queue

Add 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.

@netlify
Copy link

netlify bot commented Mar 7, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit ec246ba
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69abfc2da9d7cc00083a1595

@hyf0 hyf0 force-pushed the 03-07-refactor_fs_watcher_unify_the_way_of_constructing_watcher branch from 38981cb to 901c3f5 Compare March 7, 2026 06:25
@hyf0 hyf0 requested review from sapphi-red and shulaoda March 7, 2026 06:25
@hyf0 hyf0 marked this pull request as ready for review March 7, 2026 06:25
Copilot AI review requested due to automatic review settings March 7, 2026 06:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors filesystem watcher construction by centralizing watcher selection logic inside rolldown_fs_watcher, and updating consumers to use that factory so watcher setup is consistent across dev and watch APIs.

Changes:

  • Added rolldown_fs_watcher::create_fs_watcher() as the canonical factory for constructing non-noop watchers.
  • Extended FsWatcherConfig with use_polling / use_debounce selection flags (and wired them through rolldown_dev / rolldown_watcher).
  • Replaced duplicated watcher-selection branching in rolldown_dev and rolldown_watcher with the new factory call.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
crates/rolldown_watcher/src/watcher.rs Routes watcher creation through create_fs_watcher() and propagates polling selection into FsWatcherConfig.
crates/rolldown_fs_watcher/src/lib.rs Introduces create_fs_watcher() factory encapsulating polling/debounce watcher selection.
crates/rolldown_fs_watcher/src/fs_watcher_config.rs Adds use_polling/use_debounce fields to support centralized selection logic.
crates/rolldown_dev/src/dev_engine.rs Switches watcher construction to create_fs_watcher() and passes the new config flags through.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2026

Benchmarks Rust

  • target: main(468a4b3)
  • pr: 03-07-refactor_fs_watcher_unify_the_way_of_constructing_watcher(901c3f5)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.05     89.3±3.00ms        ? ?/sec    1.00     85.0±2.27ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.07     99.3±3.30ms        ? ?/sec    1.00     92.5±1.90ms        ? ?/sec
bundle/bundle@rome_ts                                        1.00    167.7±6.82ms        ? ?/sec    1.10    184.0±3.65ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.00    192.1±6.20ms        ? ?/sec    1.04    199.0±3.88ms        ? ?/sec
bundle/bundle@threejs                                        1.00     73.3±3.01ms        ? ?/sec    1.21     88.6±3.75ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     85.6±4.82ms        ? ?/sec    1.07     91.8±3.57ms        ? ?/sec
bundle/bundle@threejs10x                                     1.01    809.1±8.57ms        ? ?/sec    1.00    799.0±9.14ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.01   913.3±10.87ms        ? ?/sec    1.00    907.2±8.27ms        ? ?/sec
scan/scan@rome_ts                                            1.01     81.6±1.87ms        ? ?/sec    1.00     80.4±2.28ms        ? ?/sec
scan/scan@threejs                                            1.00     28.2±0.82ms        ? ?/sec    1.02     28.8±1.81ms        ? ?/sec
scan/scan@threejs10x                                         1.00    276.2±3.81ms        ? ?/sec    1.00    275.9±3.26ms        ? ?/sec

Copy link
Member

sapphi-red commented Mar 7, 2026

Merge activity

  • Mar 7, 10:20 AM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 7, 10:20 AM UTC: sapphi-red added this pull request to the Graphite merge queue.
  • Mar 7, 10:30 AM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app bot force-pushed the 03-07-refactor_fs_watcher_unify_the_way_of_constructing_watcher branch from 901c3f5 to ec246ba Compare March 7, 2026 10:21
@graphite-app graphite-app bot merged commit ec246ba into main Mar 7, 2026
38 checks passed
@graphite-app graphite-app bot deleted the 03-07-refactor_fs_watcher_unify_the_way_of_constructing_watcher branch March 7, 2026 10:30
@github-actions github-actions bot mentioned this pull request Mar 9, 2026
shulaoda added a commit that referenced this pull request Mar 9, 2026
## [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>
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.

4 participants