Skip to content

Comments

feat(dev): add scheduleBuildIfStale method to DevEngine#6087

Merged
hyf0 merged 1 commit intomainfrom
09-09-feat_dev_add_schedulebuildifstale_method_to_devengine
Sep 9, 2025
Merged

feat(dev): add scheduleBuildIfStale method to DevEngine#6087
hyf0 merged 1 commit intomainfrom
09-09-feat_dev_add_schedulebuildifstale_method_to_devengine

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Sep 9, 2025

Added scheduleBuildIfStale method to DevEngine to know whether the build is triggered.

refs vitejs/rolldown-vite#401

Copy link
Member Author

sapphi-red commented Sep 9, 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.

@sapphi-red sapphi-red requested a review from hyf0 September 9, 2025 06:29
@sapphi-red sapphi-red force-pushed the 09-09-feat_dev_return_changed_files_in_onhmrupdates_callback branch from 5c70c60 to aa06291 Compare September 9, 2025 06:30
@sapphi-red sapphi-red force-pushed the 09-09-feat_dev_add_schedulebuildifstale_method_to_devengine branch from 28d2e34 to a807db9 Compare September 9, 2025 06:30
@sapphi-red sapphi-red marked this pull request as ready for review September 9, 2025 06:33
@hyf0 hyf0 requested a review from Copilot September 9, 2025 06:48
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 adds a scheduleBuildIfStale method to the DevEngine API that allows callers to determine whether a new build is triggered when requesting a build. The method returns a boolean indicating if a build was scheduled rather than waiting for the build to complete.

  • Adds scheduleBuildIfStale method to DevEngine that returns whether a build was triggered
  • Exposes ScheduledBuild type through binding exports
  • Updates build driver to return tuple indicating if build was already scheduled

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/rolldown/src/api/dev/dev-engine.ts Implements new scheduleBuildIfStale method that returns boolean indicating if build was scheduled
crates/rolldown_binding/src/binding_dev_engine.rs Adds Rust binding for schedule_build_if_stale and ScheduledBuild struct
crates/rolldown/src/dev/build_driver.rs Updates schedule_build_if_stale to return tuple with build future and already-scheduled flag
packages/rolldown/src/binding.js Exports new ScheduledBuild type
packages/rolldown/src/rolldown-binding.wasi.cjs Exports ScheduledBuild for WASI CommonJS build
packages/rolldown/src/rolldown-binding.wasi-browser.js Exports ScheduledBuild for WASI browser build

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@hyf0 hyf0 left a comment

Choose a reason for hiding this comment

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

I leave comment here https://github.com/vitejs/rolldown-vite/pull/401/files#r2332202442. No matter if they overlap, we should do fast shipping and then polish them later.

Copy link
Member

hyf0 commented Sep 9, 2025

Merge activity

  • Sep 9, 6:52 AM UTC: The merge label 'graphite: merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 9, 6:52 AM UTC: hyf0 added this pull request to the Graphite merge queue.
  • Sep 9, 7:09 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #6086.
  • Sep 9, 7:09 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #6086.
  • Sep 9, 7:42 AM UTC: The merge label 'graphite: merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 9, 7:57 AM UTC: hyf0 added this pull request to the Graphite merge queue.
  • Sep 9, 8:26 AM UTC: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI: 'browser-test (macos-latest) / WASI Test').

@graphite-app graphite-app bot force-pushed the 09-09-feat_dev_return_changed_files_in_onhmrupdates_callback branch from aa06291 to e81583d Compare September 9, 2025 06:53
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

Benchmarks Rust

  • target: 09-09-feat_dev_return_changed_files_in_onhmrupdates_callback(8217f6a)
  • pr: 09-09-feat_dev_add_schedulebuildifstale_method_to_devengine(9d53ea1)
group                                                        pr                                     target
-----                                                        --                                     ------
bundle/bundle@multi-duplicated-top-level-symbol              1.08     86.5±2.20ms        ? ?/sec    1.00     79.9±1.63ms        ? ?/sec
bundle/bundle@multi-duplicated-top-level-symbol-sourcemap    1.09     97.2±1.74ms        ? ?/sec    1.00     89.5±1.61ms        ? ?/sec
bundle/bundle@rome_ts                                        1.02    123.5±3.20ms        ? ?/sec    1.00    120.9±1.66ms        ? ?/sec
bundle/bundle@rome_ts-sourcemap                              1.03    144.9±2.30ms        ? ?/sec    1.00    140.9±1.47ms        ? ?/sec
bundle/bundle@threejs                                        1.06     48.0±2.53ms        ? ?/sec    1.00     45.5±2.62ms        ? ?/sec
bundle/bundle@threejs-sourcemap                              1.04     55.9±0.99ms        ? ?/sec    1.00     53.6±0.72ms        ? ?/sec
bundle/bundle@threejs10x                                     1.03    488.8±6.73ms        ? ?/sec    1.00    473.3±7.13ms        ? ?/sec
bundle/bundle@threejs10x-sourcemap                           1.03    565.7±4.95ms        ? ?/sec    1.00    551.8±3.62ms        ? ?/sec
scan/scan@rome_ts                                            1.07    100.5±1.66ms        ? ?/sec    1.00     93.5±1.29ms        ? ?/sec
scan/scan@threejs                                            1.09     36.1±0.57ms        ? ?/sec    1.00     33.2±0.32ms        ? ?/sec
scan/scan@threejs10x                                         1.01    355.8±4.53ms        ? ?/sec    1.00    351.8±6.61ms        ? ?/sec

graphite-app bot pushed a commit that referenced this pull request Sep 9, 2025
Added `scheduleBuildIfStale` method to DevEngine to know whether the build is triggered.

refs vitejs/rolldown-vite#401
@graphite-app graphite-app bot force-pushed the 09-09-feat_dev_add_schedulebuildifstale_method_to_devengine branch from a3530c5 to 7951772 Compare September 9, 2025 06:53
Added `scheduleBuildIfStale` method to DevEngine to know whether the build is triggered.

refs vitejs/rolldown-vite#401
@graphite-app graphite-app bot force-pushed the 09-09-feat_dev_return_changed_files_in_onhmrupdates_callback branch from e81583d to 8217f6a Compare September 9, 2025 08:05
@graphite-app graphite-app bot force-pushed the 09-09-feat_dev_add_schedulebuildifstale_method_to_devengine branch from 7951772 to 9d53ea1 Compare September 9, 2025 08:05
Base automatically changed from 09-09-feat_dev_return_changed_files_in_onhmrupdates_callback to main September 9, 2025 08:21
@hyf0 hyf0 merged commit d733d8b into main Sep 9, 2025
22 of 23 checks passed
@hyf0 hyf0 deleted the 09-09-feat_dev_add_schedulebuildifstale_method_to_devengine branch September 9, 2025 09:25
sapphi-red added a commit that referenced this pull request Sep 10, 2025
graphite-app bot pushed a commit that referenced this pull request Sep 10, 2025
graphite-app bot pushed a commit that referenced this pull request Sep 10, 2025
Boshen added a commit that referenced this pull request Sep 10, 2025
## [1.0.0-beta.37] - 2025-09-10

### 🚀 Features

- partial align with const inline strategy with oxc in smart mode
(#6126) by @IWANABETHATGUY
- dev: use PathsMut for non-debounced RecommendedWatcher (#6120) by
@sapphi-red
- dev: return whether the build is already scheduled from
`scheduleBuildIfStale` method (#6116) by @sapphi-red
- handle errors from `BundlerBuilder#build` (#6104) by @shulaoda
- add debounceTickRate option for debounced watchers (#6113) by @hyf0
- support full build in `incrementalBuild` mode (#6098) by
@IWANABETHATGUY
- add compare_contents_for_polling option to dev watcher (#6108) by
@hyf0
- dev: add `scheduleBuildIfStale` method to DevEngine (#6087) by
@sapphi-red
- dev: return changed files in onHmrUpdates callback (#6086) by
@sapphi-red
- support function config with custom CLI arguments (#6076) by
@IWANABETHATGUY
- improve `MISSING_EXPORT` warning to suggest `type` modifier (#6085) by
@sapphi-red
- crates/rolldown_watcher: introduce `PathsMut` to batch watch/unwatch
behaviors (#6075) by @hyf0
- enable `treeshake.commonjs` by default (#6072) by @IWANABETHATGUY
- dev: add debounce control and PollWatcher support to DevWatchOptions
(#6070) by @hyf0

### 🐛 Bug Fixes

- use kqueue for file watch on mac (#6124) by @sapphi-red
- use patched notify for better file change event debouncing (#6125) by
@sapphi-red
- support passing all js primitive value for `alias` plugin (#6123) by
@IWANABETHATGUY
- track spans in member expression properties for accurate sourcemaps
(#6100) by @IWANABETHATGUY
- correctly handle inlined CommonJS exports in member expressions
(#6090) by @IWANABETHATGUY
- dev: ensure patch file names to be unique (#6096) by @sapphi-red
- dev: normalize slash on Windows before comparing paths (#6095) by
@sapphi-red
- dev/watch: debounce duration should default to 10 (#6078) by @hyf0

### 🚜 Refactor

- simplify `__export` runtime helper to create target object internally
(#6114) by @IWANABETHATGUY
- simplify module_namespace construction second try (#6118) by
@IWANABETHATGUY
- simplify module_namespace construction (#5939) by @IWANABETHATGUY
- optimize member expression creation in AstSnippet (#6091) by
@IWANABETHATGUY
- test-dev-server: sensible watcher configuration for CI env (#6077) by
@hyf0

### 🧪 Testing

- dev: apply HMR edits on Windows (#6094) by @sapphi-red

### ⚙️ Miscellaneous Tasks

- Revert "chore: adjust breaking change template of cliff (#6069)"
(#6130) by @IWANABETHATGUY
- test-dev-server: improve hmr test configuration (#6115) by @hyf0
- deps: update dependency rolldown-plugin-dts to v0.16.2 (#6128) by
@renovate[bot]
- Revert "refactor: simplify module_namespace construction (#5939)"
(#6117) by @IWANABETHATGUY
- test-dev-server: optimize test log output (#6107) by @hyf0
- enable compare_contents_for_polling and update poll interval for CI
test-dev-server (#6110) by @hyf0
- deps: update dependency vite to v7.1.5 [security] (#6111) by
@renovate[bot]
- fix warnings reported by `just lint` (#6105) by @shulaoda
- deps: update dependency tsdown to v0.15.0 (#6102) by @renovate[bot]
- use debug builds for browser tests in CI (#6092) by @hyf0
- test-dev-server: update polling interval and add retry logic for CI
tests (#6088) by @hyf0
- adjust breaking change template of cliff (#6069) by @IWANABETHATGUY

### ◀️ Revert

- "fix: replace_plugin does not work as expected with .ts config
(#5920)" (#6074) by @IWANABETHATGUY

Co-authored-by: Boshen <[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