Skip to content

refactor(rust/watch): tweak struct/function names#8464

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-25-refactor_rust_watch_tweak_struct_function_names
Mar 1, 2026
Merged

refactor(rust/watch): tweak struct/function names#8464
graphite-app[bot] merged 1 commit intomainfrom
02-25-refactor_rust_watch_tweak_struct_function_names

Conversation

@hyf0
Copy link
Member

@hyf0 hyf0 commented Feb 25, 2026

No description provided.

Copy link
Member Author

hyf0 commented Feb 25, 2026

@hyf0 hyf0 requested review from sapphi-red and shulaoda and removed request for Copilot February 25, 2026 15:54
Copilot AI review requested due to automatic review settings February 25, 2026 15:55
@hyf0 hyf0 review requested due to automatic review settings February 25, 2026 15:55
@github-actions
Copy link
Contributor

github-actions bot commented Feb 25, 2026

Benchmarks Rust

  • target: main(bc1eff2)
  • pr: 02-25-refactor_rust_watch_tweak_struct_function_names(850f783)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.00     82.1±2.29ms        ? ?/sec    1.01     83.1±2.60ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.00     91.2±2.07ms        ? ?/sec    1.00     90.9±2.52ms        ? ?/sec
bundle/bundle@rome_ts                                        1.01    165.8±5.44ms        ? ?/sec    1.00    163.6±5.45ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.02    186.7±5.48ms        ? ?/sec    1.00    182.2±4.96ms        ? ?/sec
bundle/bundle@threejs                                        1.01     73.6±3.61ms        ? ?/sec    1.00     73.0±1.58ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.00     79.6±1.71ms        ? ?/sec    1.03     81.7±1.74ms        ? ?/sec
bundle/bundle@threejs10x                                     1.00    764.7±5.04ms        ? ?/sec    1.00    765.8±6.69ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.00    876.0±6.49ms        ? ?/sec    1.00    874.3±5.69ms        ? ?/sec
scan/scan@rome_ts                                            1.00     77.7±1.71ms        ? ?/sec    1.01     78.5±1.74ms        ? ?/sec
scan/scan@threejs                                            1.00     27.7±1.10ms        ? ?/sec    1.00     27.6±0.47ms        ? ?/sec
scan/scan@threejs10x                                         1.00    269.4±4.25ms        ? ?/sec    1.01    270.8±3.93ms        ? ?/sec

Copilot AI review requested due to automatic review settings February 25, 2026 16:33
@hyf0 hyf0 force-pushed the 02-25-refactor_rust_watch_tweak_struct_function_names branch from 21d9c5b to a9713cd Compare February 25, 2026 16:33
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 performs a refactoring of the rolldown_watcher crate to improve naming clarity and code organization. The changes rename and reorganize struct names, function names, and file names to better reflect their purpose in the watch mode implementation.

Changes:

  • Renamed ChangeEntry to FileChangeEvent and moved it to a dedicated file with a type change from ArcStr to String for the path field
  • Renamed WatcherMsg::FsEvent to WatcherMsg::FileChanges and moved message types to watcher_msg.rs
  • Moved WatcherState from state.rs to watcher_state.rs for consistency
  • Extracted TaskFsEventHandler from watcher.rs to its own file task_fs_event_handler.rs with simplified event mapping logic
  • Renamed method invalidate() to mark_needs_rebuild() for clarity
  • Renamed method process_fs_event() to process_file_changes() to reflect its actual purpose
  • Updated extensive documentation in meta/design/watch-mode.md and added new meta/design/module-id.md design document

Reviewed changes

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

Show a summary per file
File Description
meta/design/watch-mode.md Updated architecture diagrams, file structure listings, and detailed debouncing explanation to reflect refactored names
meta/design/module-id.md New design document describing module ID handling, path identity, and normalization across the bundler
crates/rolldown_watcher/src/watcher_state.rs Renamed from state.rs; updated to use FileChangeEvent instead of ChangeEntry
crates/rolldown_watcher/src/watcher_msg.rs New file containing WatcherMsg enum (moved from deleted msg.rs) with renamed FileChanges variant
crates/rolldown_watcher/src/watcher.rs Removed inline TaskFsEventHandler struct and updated imports
crates/rolldown_watcher/src/watch_task.rs Renamed invalidate() method to mark_needs_rebuild() for clarity
crates/rolldown_watcher/src/watch_coordinator.rs Renamed process_fs_event() to process_file_changes() and simplified to accept pre-mapped events
crates/rolldown_watcher/src/task_fs_event_handler.rs New file containing extracted and refactored TaskFsEventHandler with simplified event mapping
crates/rolldown_watcher/src/msg.rs Deleted; contents moved to watcher_msg.rs
crates/rolldown_watcher/src/lib.rs Updated module declarations and public exports to reflect new file structure
crates/rolldown_watcher/src/file_change_event.rs New file containing FileChangeEvent struct (renamed from ChangeEntry) with String path field

@graphite-app graphite-app bot force-pushed the 02-24-refactor_watch_rename_taskstart_taskend_to_bundlestart_bundleend branch from 76864d5 to 8dde365 Compare February 26, 2026 03:26
@graphite-app graphite-app bot force-pushed the 02-24-refactor_watch_rename_taskstart_taskend_to_bundlestart_bundleend branch from 8dde365 to b14dd3b Compare February 26, 2026 03:27
@graphite-app graphite-app bot force-pushed the 02-25-refactor_rust_watch_tweak_struct_function_names branch from a9713cd to fe06c42 Compare February 26, 2026 03:27
@graphite-app graphite-app bot changed the base branch from 02-24-refactor_watch_rename_taskstart_taskend_to_bundlestart_bundleend to graphite-base/8464 February 26, 2026 04:16
@graphite-app graphite-app bot force-pushed the 02-25-refactor_rust_watch_tweak_struct_function_names branch from fe06c42 to cd11c19 Compare February 26, 2026 04:28
@graphite-app graphite-app bot force-pushed the graphite-base/8464 branch from b14dd3b to 061a9b3 Compare February 26, 2026 04:28
@graphite-app graphite-app bot changed the base branch from graphite-base/8464 to main February 26, 2026 04:28
@graphite-app graphite-app bot force-pushed the 02-25-refactor_rust_watch_tweak_struct_function_names branch from cd11c19 to 4ef73e1 Compare February 26, 2026 04:29
@netlify
Copy link

netlify bot commented Feb 26, 2026

Deploy Preview for rolldown-rs canceled.

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

@hyf0 hyf0 force-pushed the 02-25-refactor_rust_watch_tweak_struct_function_names branch from 4ef73e1 to d9b1ab3 Compare February 26, 2026 13:31
Copilot AI review requested due to automatic review settings February 26, 2026 13:31
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 11 out of 11 changed files in this pull request and generated no new comments.

@hyf0 hyf0 force-pushed the 02-25-refactor_rust_watch_tweak_struct_function_names branch from d9b1ab3 to 850f783 Compare March 1, 2026 08:57
Copy link
Member Author

hyf0 commented Mar 1, 2026

Merge activity

Copilot AI review requested due to automatic review settings March 1, 2026 11:03
@graphite-app graphite-app bot force-pushed the 02-25-refactor_rust_watch_tweak_struct_function_names branch from 850f783 to f62ae0f Compare March 1, 2026 11:03
@hyf0 hyf0 review requested due to automatic review settings March 1, 2026 11:03
@graphite-app graphite-app bot merged commit f62ae0f into main Mar 1, 2026
34 checks passed
@graphite-app graphite-app bot deleted the 02-25-refactor_rust_watch_tweak_struct_function_names branch March 1, 2026 11:13
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants