Skip to content

feat(watch): expose watcher.compareContentsForPolling#8526

Merged
graphite-app[bot] merged 1 commit intomainfrom
03-02-feat_watch_expose_watcher.comparecontentsforpolling_
Mar 3, 2026
Merged

feat(watch): expose watcher.compareContentsForPolling#8526
graphite-app[bot] merged 1 commit intomainfrom
03-02-feat_watch_expose_watcher.comparecontentsforpolling_

Conversation

@hyf0
Copy link
Member

@hyf0 hyf0 commented Mar 2, 2026

Copy link
Member Author

hyf0 commented Mar 2, 2026

@hyf0 hyf0 marked this pull request as ready for review March 2, 2026 15:36
Copilot AI review requested due to automatic review settings March 2, 2026 15:36
@graphite-app graphite-app bot changed the base branch from 03-02-refactor_rust_remove_old_watch_mode_implementation to graphite-base/8526 March 2, 2026 15:38
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

This PR exposes a new watch option to control whether poll-based watchers compare file contents (not just metadata) to detect changes, wiring it through the TypeScript option surface into the Rust watcher configuration.

Changes:

  • Add watch.watcher.compareContentsForPolling to the TS input options + validation schema.
  • Pass the new option through the JS→binding conversion layer and binding type definitions.
  • Plumb the option into Rust WatchOption/WatcherConfig and forward it into FsWatcherConfig.

Reviewed changes

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

Show a summary per file
File Description
packages/rolldown/src/utils/validator.ts Accepts and describes compareContentsForPolling in the watch options validator schema.
packages/rolldown/src/utils/bindingify-input-options.ts Forwards compareContentsForPolling from user options into binding input options.
packages/rolldown/src/options/input-options.ts Documents the new WatcherFileWatcherOptions.compareContentsForPolling option.
packages/rolldown/src/binding.d.cts Updates binding TS declarations to include compareContentsForPolling.
crates/rolldown_watcher/src/watcher.rs Extends WatcherConfig and forwards the flag into FsWatcherConfig.
crates/rolldown_common/src/inner_bundler_options/types/watch_option.rs Adds compare_contents_for_polling to the internal watch option type.
crates/rolldown_binding/src/watcher.rs Extracts the flag from configs and constructs WatcherConfig with it.
crates/rolldown_binding/src/options/binding_input_options/binding_watch_option.rs Adds the binding field and maps it into rolldown_common::WatchOption.

@graphite-app graphite-app bot force-pushed the graphite-base/8526 branch from b77facc to c1fd676 Compare March 2, 2026 15:52
@graphite-app graphite-app bot force-pushed the 03-02-feat_watch_expose_watcher.comparecontentsforpolling_ branch from 97fa5be to dcb2aa0 Compare March 2, 2026 15:52
@graphite-app graphite-app bot changed the base branch from graphite-base/8526 to main March 2, 2026 15:52
@graphite-app graphite-app bot force-pushed the 03-02-feat_watch_expose_watcher.comparecontentsforpolling_ branch from dcb2aa0 to 7af3e53 Compare March 2, 2026 15:52
@netlify
Copy link

netlify bot commented Mar 2, 2026

Deploy Preview for rolldown-rs canceled.

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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

Benchmarks Rust

  • target: main(c1fd676)
  • pr: 03-02-feat_watch_expose_watcher.comparecontentsforpolling_(7f780ac)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     81.9±2.25ms        ? ?/sec    1.03     84.0±3.22ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.04     91.9±3.08ms        ? ?/sec    1.00     88.5±2.83ms        ? ?/sec
bundle/bundle@rome_ts                                        1.08    186.8±7.80ms        ? ?/sec    1.00    172.8±9.68ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.01    185.8±4.61ms        ? ?/sec    1.00    184.2±7.49ms        ? ?/sec
bundle/bundle@threejs                                        1.00     77.0±3.71ms        ? ?/sec    1.00     77.0±3.73ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     85.9±7.92ms        ? ?/sec    1.02     87.4±4.54ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00   809.5±20.63ms        ? ?/sec    1.01   814.1±17.15ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.02   922.5±15.80ms        ? ?/sec    1.00   908.8±15.07ms        ? ?/sec
scan/scan@rome_ts                                            1.02     78.4±3.02ms        ? ?/sec    1.00     77.0±1.89ms        ? ?/sec
scan/scan@threejs                                            1.01     27.8±0.77ms        ? ?/sec    1.00     27.5±1.71ms        ? ?/sec
scan/scan@threejs10x                                         1.02    274.5±7.03ms        ? ?/sec    1.00    267.9±4.76ms        ? ?/sec

@hyf0 hyf0 requested review from Copilot, sapphi-red and shulaoda March 2, 2026 16:18
@hyf0 hyf0 force-pushed the 03-02-feat_watch_expose_watcher.comparecontentsforpolling_ branch from 7af3e53 to 7f780ac Compare March 2, 2026 16:24
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

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

Copy link
Member Author

hyf0 commented Mar 3, 2026

Merge activity

@graphite-app graphite-app bot force-pushed the 03-02-feat_watch_expose_watcher.comparecontentsforpolling_ branch from 7f780ac to 8fc5471 Compare March 3, 2026 02:36
@graphite-app graphite-app bot merged commit 8fc5471 into main Mar 3, 2026
34 of 35 checks passed
@graphite-app graphite-app bot deleted the 03-02-feat_watch_expose_watcher.comparecontentsforpolling_ branch March 3, 2026 02:47
This was referenced Mar 4, 2026
shulaoda added a commit that referenced this pull request Mar 5, 2026
## [1.0.0-rc.7] - 2026-03-05

⚡ Smarter Code Generation Defaults
- DCE-only minification and smart constant inlining are now enabled by default
- Produces cleaner, smaller output bundles without requiring explicit configuration

💡 LLM-Friendly Bundle Analyzer Reports
- New markdown output format for the bundle analyzer plugin with bundle summaries, module graphs, dependency chains, and optimization suggestions
- Optimization suggestions now also recommend using the entriesAware option when common chunks contain modules only reachable from specific entries


### 💥 BREAKING CHANGES

- enable minify: 'dce-only' by default (#8465) by @IWANABETHATGUY
- settings `inlineConst: { mode: 'smart', pass: 1}`  by default (#8444) by @IWANABETHATGUY

### 🚀 Features

- binding: add original getter to BindingMagicString (#8533) by @IWANABETHATGUY
- native-magic-string: add `offset` property support (#8531) by @IWANABETHATGUY
- add `output.strict` option to control `"use strict"` directive emission (#8489) by @Copilot
- watch: expose `watcher.compareContentsForPolling` (#8526) by @hyf0
- watch: use new watcher to support watch mode (#8475) by @hyf0
- rust/watch: handle bulk-change (#8466) by @hyf0
- add LLM-friendly markdown output format to bundle analyzer plugin (#8242) by @IWANABETHATGUY

### 🐛 Bug Fixes

- expose `plugins` on `NormalizedInputOptions` for `buildStart` hook (#8521) by @Copilot
- only uppercase facade symbols in JSX preserve mode (#8519) by @IWANABETHATGUY
- binding: export BindingResult in generated dts header (#8537) by @minsoo-web
- pre-resolve paths option to avoid `invoke_sync` deadlock (#8518) by @IWANABETHATGUY
- remove debug-only jsx_preset and UntranspiledSyntaxError (#8511) by @IWANABETHATGUY
- apply `topLevelVar` to exported `const`/`let` declarations (#8507) by @IWANABETHATGUY
- rolldown_plugin_vite_web_worker_post: avoid replacing `new.target` (#8488) by @sapphi-red
- update copyright year to 2026 (#8486) by @maciekzygmunt

### 🚜 Refactor

- rust: use Oxc's SymbolFlags::ConstVariable instead of custom IsConst flag (#8543) by @Dunqing
- rust: remove FacadeScoping, use Scoping::create_symbol for facade symbols (#8540) by @Dunqing
- rust/watch: remove hacky `reset_closed_for_watch_mode` (#8530) by @hyf0
- binding: return &str instead of String in filename() getter (#8534) by @IWANABETHATGUY
- rust: remove old watch mode implementation (#8525) by @hyf0
- rust/watch: simply watch logic in the binding layer (#8516) by @hyf0
- rust/watch: tweak struct/function names (#8464) by @hyf0

### 📚 Documentation

- explain how external modules work in rolldown (#8457) by @sapphi-red
- add some diagrams using graphviz (#8499) by @sapphi-red
- use `vitepress-plugin-graphviz` (#8498) by @sapphi-red
- list s390x/ppc64le prebuilt binaries (#8495) by @crusty-voidzero
- fix error type for `RolldownBuild.generate` and others (#8490) by @sapphi-red

### ⚡ Performance

- string_wizard: reduce allocations and add ASCII fast paths (#8541) by @IWANABETHATGUY
- use IndexBitSet to replace IndexVec<XXXIdx, bool> for module/stmt inclusion tracking (#8503) by @IWANABETHATGUY
- plugin: use IndexBitSet to optimize skipped plugins checking (#8497) by @ShroXd
- rust/tla: skip compute_tla if there is no module use TLA (#8487) by @ShroXd

### 🧪 Testing

- node/watch: make watch tests run in concurrent and retry-able (#8512) by @hyf0
- add test case for static flag tree-shaking (#8476) by @IWANABETHATGUY
- migrate post-banner sourcemap-with-shebang to Rust (#8477) by @Copilot

### ⚙️ Miscellaneous Tasks

- vscode: `formatOnSave` for markdown files using oxc formatter (#8536) by @minsoo-web
- deps: update test262 submodule for tests (#8528) by @sapphi-red
- remove `retry` workaround from output paths test fixtures (#8520) by @Copilot
- docs: add Shuyuan Wang (h-a-n-a) and remove from acknowledgements (#8509) by @Copilot
- consolidate top_level_var test cases using configVariants (#8508) by @IWANABETHATGUY
- add s390x and ppc64le linux gnu targets (#8493) by @Brooooooklyn

### ◀️ Revert

- fix(rolldown): increase tokio blocking threads size for watch mode (#8517) by @hyf0

### ❤️ New Contributors

* @minsoo-web made their first contribution in [#8536](#8536)
* @crusty-voidzero made their first contribution in [#8495](#8495)
* @maciekzygmunt made their first contribution in [#8486](#8486)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants