Skip to content

Comments

refactor(rust/watcher): polish API of Watcher struct#7551

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-17-refactor_rust_watcher_polish_api_of_watcher_struct
Dec 19, 2025
Merged

refactor(rust/watcher): polish API of Watcher struct#7551
graphite-app[bot] merged 1 commit intomainfrom
12-17-refactor_rust_watcher_polish_api_of_watcher_struct

Conversation

@hyf0
Copy link
Member

@hyf0 hyf0 commented Dec 17, 2025

No description provided.

@hyf0 hyf0 marked this pull request as ready for review December 17, 2025 14:16
Copilot AI review requested due to automatic review settings December 17, 2025 14:16
Copy link
Member Author

hyf0 commented Dec 17, 2025


How to use the Graphite Merge Queue

Add the label graphite: merge 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.

@hyf0 hyf0 requested review from sapphi-red and shulaoda and removed request for Copilot December 17, 2025 14:16
@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

Benchmarks Rust

  • target: main(12d1044)
  • pr: 12-17-refactor_rust_watcher_polish_api_of_watcher_struct(9cd1226)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     68.2±1.98ms        ? ?/sec    1.02     69.7±2.41ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     74.6±1.67ms        ? ?/sec    1.02     76.3±2.91ms        ? ?/sec
bundle/bundle@rome_ts                                        1.02    113.3±2.84ms        ? ?/sec    1.00    111.4±2.68ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.02    126.2±2.21ms        ? ?/sec    1.00    124.2±3.92ms        ? ?/sec
bundle/bundle@threejs                                        1.00     41.3±0.80ms        ? ?/sec    1.01     41.5±1.00ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     45.0±1.13ms        ? ?/sec    1.00     44.9±1.31ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    404.5±5.74ms        ? ?/sec    1.00    404.0±5.02ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    465.2±5.59ms        ? ?/sec    1.00    466.8±5.54ms        ? ?/sec
scan/scan@rome_ts                                            1.00     86.8±1.71ms        ? ?/sec    1.02     88.8±2.83ms        ? ?/sec
scan/scan@threejs                                            1.00     29.1±0.51ms        ? ?/sec    1.03     30.1±1.65ms        ? ?/sec
scan/scan@threejs10x                                         1.00    301.0±4.92ms        ? ?/sec    1.02    308.1±5.68ms        ? ?/sec

@hyf0 hyf0 force-pushed the 12-17-refactor_rust_watcher_polish_api_of_watcher_struct branch from 305869c to 3f657af Compare December 18, 2025 02:53
Copilot AI review requested due to automatic review settings December 18, 2025 02:53
@hyf0 hyf0 force-pushed the 12-17-refactor_watch_construct_the_bundler_within_watcher_itself branch from 84a8218 to 19d5a93 Compare December 18, 2025 02:53
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 refactors the Watcher struct's API to improve ergonomics by distinguishing between single-config and multi-config use cases. The refactoring introduces a new new() method for the common single-config case and renames the existing constructor to with_configs() for clarity when working with multiple configurations. This follows the same pattern used in the Bundler struct where new() accepts a single item and with_plugins() accepts multiple items.

Key Changes

  • Introduced Watcher::new(config, notify_option) for single-config use cases
  • Renamed the original multi-config constructor to Watcher::with_configs(configs, notify_option)
  • Updated all call sites to use the more appropriate method

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
crates/rolldown/src/watcher.rs Added new new() method for single config, renamed original to with_configs(), updated parameter names for clarity
crates/rolldown_binding/src/watcher.rs Updated binding layer to use with_configs() since it handles multiple bundler options
crates/rolldown/examples/watch.rs Simplified example to use new() with single config instead of wrapping in a vec

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 18, 2025

Merge activity

  • Dec 18, 4:06 AM UTC: hyf0 added this pull request to the Graphite merge queue.
  • Dec 18, 4:24 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #7550.
  • Dec 18, 4:24 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #7550.
  • Dec 18, 8:01 AM UTC: The merge label 'graphite: merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 18, 8:01 AM UTC: hyf0 added this pull request to the Graphite merge queue.
  • Dec 18, 8:26 AM UTC: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI: 'node-test (ubuntu-latest) / Node Test', 'node-test (macos-latest) / Node Test', 'node-test (windows-latest) / Node Test').
  • Dec 18, 2:05 PM UTC: sapphi-red added this pull request to the Graphite merge queue.
  • Dec 18, 2:26 PM UTC: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI: 'cargo-test (ubuntu-latest) / Cargo Test', 'cargo-test (windows-latest) / Cargo Test').
  • Dec 19, 1:57 AM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app bot changed the base branch from 12-17-refactor_watch_construct_the_bundler_within_watcher_itself to graphite-base/7551 December 18, 2025 04:07
@graphite-app graphite-app bot force-pushed the graphite-base/7551 branch from 19d5a93 to 9ee271e Compare December 18, 2025 05:10
@graphite-app graphite-app bot force-pushed the 12-17-refactor_rust_watcher_polish_api_of_watcher_struct branch from 3f657af to 66840f2 Compare December 18, 2025 05:10
@graphite-app graphite-app bot changed the base branch from graphite-base/7551 to main December 18, 2025 05:10
@graphite-app graphite-app bot force-pushed the 12-17-refactor_rust_watcher_polish_api_of_watcher_struct branch from 66840f2 to 16226c1 Compare December 18, 2025 05:10
@netlify
Copy link

netlify bot commented Dec 18, 2025

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 3f539ce
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6944ae8c0f8757000768034b

Copilot AI review requested due to automatic review settings December 18, 2025 08:18
@graphite-app graphite-app bot force-pushed the 12-17-refactor_rust_watcher_polish_api_of_watcher_struct branch from 16226c1 to d4a01a0 Compare December 18, 2025 08:18
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@hyf0 hyf0 force-pushed the 12-17-refactor_rust_watcher_polish_api_of_watcher_struct branch from d4a01a0 to 9cd1226 Compare December 18, 2025 09:11
Copilot AI review requested due to automatic review settings December 18, 2025 14:24
@graphite-app graphite-app bot force-pushed the 12-17-refactor_rust_watcher_polish_api_of_watcher_struct branch from 9cd1226 to 381e76f Compare December 18, 2025 14: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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@graphite-app graphite-app bot force-pushed the 12-17-refactor_rust_watcher_polish_api_of_watcher_struct branch from 381e76f to 3f539ce Compare December 19, 2025 01:46
@graphite-app graphite-app bot merged commit 3f539ce into main Dec 19, 2025
31 checks passed
@graphite-app graphite-app bot deleted the 12-17-refactor_rust_watcher_polish_api_of_watcher_struct branch December 19, 2025 01:57
shulaoda added a commit that referenced this pull request Dec 22, 2025
## [1.0.0-beta.56] - 2025-12-22

### 💥 BREAKING CHANGES

- rename `MIXED_EXPORT` error to `MIXED_EXPORTS` (#7565) by @sapphi-red

### 🚀 Features

- rename `id` property to `exporter` in CIRCULAR_REEXPORT error (#7592) by @sapphi-red
- add `ids` property to `CIRCULAR_DEPENDENCY` error (#7591) by @sapphi-red
- node/dev: expose `devMode.lazy` (#7549) by @hyf0
- set log and pos properties for `parseAst` function errors (#7568) by @sapphi-red
- set log and pos properties for logs (#7567) by @sapphi-red
- test-dev-sever: support to manually configure port, run tests in concurrent (#7576) by @hyf0
- add `exporter` property to `MISSING_EXPORT` error (#7564) by @sapphi-red
- add `id` property to `PARSE_ERROR` error (#7563) by @sapphi-red
- support ImporterId hook filter (#7540) by @IWANABETHATGUY

### 🐛 Bug Fixes

- types: better "go to definition" experience for interface `OutputPlugin` (#7610) by @KazariEX
- `postBanner` content should be placed after shebang (#7583) by @btea
- use sanitized filename for preserve modules chunk name (#7603) by @IWANABETHATGUY
- correct filter out unused cjs namespace  (#7602) by @IWANABETHATGUY
- watch: property respect `notify.pollInternal` and `notify.compareContents` (#7595) by @sapphi-red
- make `cleanDir` work with default output directory (#7579) by @shulaoda
- merge `MISSING_NAME_OPTION_FOR_UMD_EXPORT` error to `MISSING_NAME_OPTION_FOR_IIFE_EXPORT` error (#7566) by @sapphi-red
- dev/hmr: ensure cjs modules with no exports reference correct `module` identifier (#7544) by @leegeunhyeok

### 🚜 Refactor

- remove `stable_id` field from `PARSE_ERROR` error (#7593) by @sapphi-red
- make include_runtime_symbol reuseable after linking stage (#7580) by @IWANABETHATGUY
- rust/dev: construct the bundler within itself (#7553) by @hyf0
- rust/watcher: polish API of `Watcher` struct (#7551) by @hyf0
- use `LinkingMetadata::stmt_info_included` to check if a stmt_info is included (#7572) by @IWANABETHATGUY
- use `LinkingMetadata::is_included` to check if a module is included (#7571) by @IWANABETHATGUY
- store module and stmt_info is included info to module meta (#7570) by @IWANABETHATGUY
- make include_* method reunsable after linking stage (#7552) by @IWANABETHATGUY
- rust/watcher: construct the bundler within watcher itself (#7550) by @hyf0
- extract make include_runtime_symbol reusable (#7546) by @IWANABETHATGUY

### ⚙️ Miscellaneous Tasks

- renovate: add `kill-port` in `ignoreDeps` in renovate.json (#7619) by @sapphi-red
- deps: update rust crates (#7617) by @renovate[bot]
- deps: update npm packages (#7616) by @renovate[bot]
- deps: update github-actions (#7615) by @renovate[bot]
- ci: skip benchmark workflows on draft PRs (#7611) by @Copilot
- deps: update dependency rolldown-plugin-dts to ^0.19.0 (#7607) by @renovate[bot]
- deps: update dependency oxlint-tsgolint to v0.10.0 (#7601) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.18.4 (#7599) by @renovate[bot]
- deps: update notify (#7594) by @sapphi-red
- test-dev-server: add retry mechanism to hmr-full-bundle-mode tests (#7588) by @Copilot
- deps: update napi to v3.7.1 (#7590) by @renovate[bot]
- add JSDoc documentation for memfs type (#7587) by @Copilot
- deps: update dependency oxlint to v1.34.0 (#7589) by @renovate[bot]
- move some tests in ignored-by-unsupported-features that are passing (#7569) by @sapphi-red
- deps: update dependency oxlint-tsgolint to v0.9.2 (#7582) by @renovate[bot]
- deps: update oxc resolver to v11.16.0 (#7574) by @renovate[bot]
- test/dev-server: don't run `pnpm install` during tests (#7560) by @hyf0
- test/dev-server: use `kill-port@1` to improve performance (#7575) by @hyf0
- normalize error object to make some Rollup tests pass (#7562) by @sapphi-red
- ci: separate dev-server(hmr) tests and normal tests (#7558) by @hyf0
- ci: make native rolldown build reusable (#7557) by @hyf0
- resolve some TODOs (#7561) by @sapphi-red

### ❤️ New Contributors

* @KazariEX made their first contribution in [#7610](#7610)
* @leegeunhyeok made their first contribution in [#7544](#7544)

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