feat(core): virtual file entry and native watcher for watch mode - #1550
Draft
stormslowly wants to merge 11 commits into
Draft
stormslowly wants to merge 11 commits into
stormslowly wants to merge 11 commits into
Conversation
Deploying rstest with
|
| Latest commit: |
19892c5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://909d15d8.rstest.pages.dev |
| Branch Preview URL: | https://virtual-file-and-native-watc.rstest.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
In watch mode the CLI "rerun all" shortcut re-ran tests without recompiling, so newly added test files were never picked up (the old
// TODO: should rerun compile with new entries).This PR drives every rerun through Rspack's compile pipeline by writing to a virtual entry module, and switches watch mode to Rspack's native (Rust) file watcher.
What
VirtualModulesPluginentry.triggerRerun()rewrites it with a fresh value to force a recompile, and the recompile drives the test run through the normalonAfterDevCompilepath.triggerRerun()+forceRerunOnceso it recompiles with the current entries instead of re-running the stale build.experiments.nativeWatcherin watch mode and lowerwatchOptions.aggregateTimeoutto5msfor snappier reruns.Verification
Locally verified the native watcher end-to-end on
examples/node:src/index.ts)Runtime-confirmed the flag selects the native FS:
experiments.nativeWatcher: true→NativeWatchFileSystem,false→NodeWatchFileSystem(rspack 1.5.0).