Skip to content

Comments

fix(watch): add paths to watcher in batch#5068

Merged
shulaoda merged 3 commits intorolldown:mainfrom
branchseer:fix/watch-batch
Jul 3, 2025
Merged

fix(watch): add paths to watcher in batch#5068
shulaoda merged 3 commits intorolldown:mainfrom
branchseer:fix/watch-batch

Conversation

@branchseer
Copy link
Contributor

@branchseer branchseer commented Jun 25, 2025

fixes #3890 (comment).

notify-rs PR: notify-rs/notify#692

@branchseer branchseer changed the title Fix/watch batch fix(watch): add paths to watcher in batch Jun 25, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 25, 2025

Open in StackBlitz

@rolldown/browser

npm i https://pkg.pr.new/@rolldown/browser@5068

@rolldown/debug

npm i https://pkg.pr.new/@rolldown/debug@5068

@rolldown/pluginutils

npm i https://pkg.pr.new/@rolldown/pluginutils@5068

rolldown

npm i https://pkg.pr.new/rolldown@5068

@rolldown/binding-darwin-arm64

npm i https://pkg.pr.new/@rolldown/binding-darwin-arm64@5068

@rolldown/binding-darwin-x64

npm i https://pkg.pr.new/@rolldown/binding-darwin-x64@5068

@rolldown/binding-freebsd-x64

npm i https://pkg.pr.new/@rolldown/binding-freebsd-x64@5068

@rolldown/binding-linux-arm-gnueabihf

npm i https://pkg.pr.new/@rolldown/binding-linux-arm-gnueabihf@5068

@rolldown/binding-linux-arm64-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-arm64-gnu@5068

@rolldown/binding-linux-arm64-musl

npm i https://pkg.pr.new/@rolldown/binding-linux-arm64-musl@5068

@rolldown/binding-linux-x64-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-x64-gnu@5068

@rolldown/binding-linux-x64-musl

npm i https://pkg.pr.new/@rolldown/binding-linux-x64-musl@5068

@rolldown/binding-wasm32-wasi

npm i https://pkg.pr.new/@rolldown/binding-wasm32-wasi@5068

@rolldown/binding-win32-arm64-msvc

npm i https://pkg.pr.new/@rolldown/binding-win32-arm64-msvc@5068

@rolldown/binding-win32-ia32-msvc

npm i https://pkg.pr.new/@rolldown/binding-win32-ia32-msvc@5068

@rolldown/binding-win32-x64-msvc

npm i https://pkg.pr.new/@rolldown/binding-win32-x64-msvc@5068

commit: fc24e4f

@shulaoda
Copy link
Member

shulaoda commented Jun 25, 2025

Most of the performance issues stem from the watch configuration:

watch: {
  skipWrite: false,
  include: files,
}

where include: files explicitly includes all files. This causes the logic at watcher_task.rs#L126-L133 to become very slow.

This PR fixes issues related to notify, so during testing the include option should not be set and all files are included by default.

You can set the input option in the user configuration to './src/index.ts', which is the correct usage and facilitates reproduction and testing.

@branchseer
Copy link
Contributor Author

@shulaoda Thanks for the suggestion. The repro example is updated accordingly at branchseer/rolldown-repro-3890@7b68705.

[email protected]:

> node rolldown2.mjs
BuildStart in 10 ms
Transform in 14 ms
BuildEnd in 53 ms
RenderStart in 56 ms
- Bundle completed in 65 ms
BuildStart in 1 ms
Watcher started
Bundling started...
Transform in 0 ms
BuildEnd in 23 ms
RenderStart in 2262 ms
Bundle completed in 2265 ms
All bundles completed
^C

With this fix:

> node rolldown2.mjs
BuildStart in 10 ms
Transform in 16 ms
BuildEnd in 67 ms
RenderStart in 69 ms
- Bundle completed in 78 ms
BuildStart in 1 ms
Watcher started
Bundling started...
Transform in 0 ms
BuildEnd in 23 ms
RenderStart in 55 ms
Bundle completed in 66 ms
All bundles completed

@shulaoda
Copy link
Member

Nice!

@branchseer
Copy link
Contributor Author

notify-rs/notify#692 merged. Let's wait for the release.

@branchseer branchseer marked this pull request as ready for review July 3, 2025 13:27
@shulaoda shulaoda added this pull request to the merge queue Jul 3, 2025
Merged via the queue into rolldown:main with commit 84263e1 Jul 3, 2025
20 checks passed
@branchseer branchseer deleted the fix/watch-batch branch July 3, 2025 14:06
@github-actions github-actions bot mentioned this pull request Jul 5, 2025
hyf0 pushed a commit that referenced this pull request Jul 5, 2025
## [1.0.0-beta.24] - 2025-07-05

### 🚀 Features

- support `inlineConst` for imported variable (#5165) by @IWANABETHATGUY
- rust: skip transform hook for modules starts with `rolldown:` (#5169)
by @hyf0
- print rolldown version (#5163) by @btea
- add optimization.inlineConst option (#5164) by @IWANABETHATGUY
- hmr: introduce `rolldown_plugin_hmr` to inject runtime code (#5159) by
@hyf0
- rolldown: oxc v0.75.1 (#5157) by @Boshen

### 🐛 Bug Fixes

- generate correct CSS filename in `preserveModules` mode (#5175) by
@shulaoda
- rolldown_plugin_build_import_analysis: avoid `default` keyword error
(#5166) by @shulaoda
- watch: add paths to watcher in batch (#5068) by @branchseer
- debug: should emit chunk data after computing cross chunk links
(#5156) by @hyf0
- simplify commonjs interop `default` prop optimization (#5142) by
@IWANABETHATGUY
- should include modules contain `exports * from '...'` forcefully if
they reexport any wrapped module (#5143) by @hyf0
- use canonical runtime time for `__name` (#5140) by @IWANABETHATGUY
- `options.jsx` is ignored when `options.transform` is set (#5137) by
@shulaoda

### 🚜 Refactor

- polyfill `flatten_iter` for wasm target (#5180) by @IWANABETHATGUY
- rolldown_plugin_dynamic_import_vars: remove unnecessary validity
checks (#5172) by @shulaoda
- hmr: remove hmr-related hacky hard-code (#5168) by @hyf0
- rolldown_plugin_dynamic_import_vars: align with rolldown-vite (#5171)
by @shulaoda
- hmr: use `rolldown:hmr` to load hmr runtime code (#5162) by @hyf0
- rust: remove special fields of `Asset` (#5155) by @hyf0
- rust: make `Asset#originate_from` optional (#5153) by @hyf0
- rust: isolate mutations on assets data (#5152) by @hyf0
- rust: remove unnecessary usage of index vec on assets (#5151) by @hyf0
- merge different member expr in `try_rewrite_member_expr` (#5146) by
@IWANABETHATGUY
- remove unused code (#5144) by @IWANABETHATGUY
- use `self.result.ast_usage` directly (#5135) by @IWANABETHATGUY

### 📚 Documentation

- update syntax lowering transform info (#5145) by @TheAlexLichter

### 🧪 Testing

- rust/hmr: hide hmr runtime code in snapshots (#5160) by @hyf0

### ⚙️ Miscellaneous Tasks

- rolldown_testing: avoid unnecessary snapshots (#5181) by @shulaoda
- fix `flatten_iter` compile error (#5179) by @IWANABETHATGUY
- expose `optimization.inlineConst` option (#5177) by @IWANABETHATGUY
- infra: update `pnpm-lock.yaml` (#5178) by @shulaoda
- rust: remove unnecessary crate `rolldown_loader_utils` (#5173) by
@shulaoda
- print build time use green color (#5158) by @btea
- deps: update dependency rolldown-plugin-dts to v0.13.13 (#5148) by
@renovate[bot]
- deps: update dependency rolldown-plugin-dts to v0.13.13 (#5138) by
@renovate[bot]
- allow only test without generate snapshot (#5134) by @IWANABETHATGUY

Co-authored-by: shulaoda <[email protected]>
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.

Watch mode seems to hang in larger project

2 participants