Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses issues with watching symlinked node_modules when using unsafe/persistent cache and ensures the module graph records correct file dependencies so changes are detected.
Changes:
- Add a new watch test case for symlinked
node_modulesunder unsafe cache, including configuration and filter. - Enhance the legacy
copyDiffhelper to correctly copy and update symlinks instead of treating them as regular files/directories. - Update the Rust factorization repair path to propagate
file_dependencieswhen creating/factorizing modules.
Reviewed changes
Copilot reviewed 5 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/rspack-test/watchCases/cache/unsafe-cache-node-modules-symlink/test.filter.js | Controls when the new symlink/unsafe-cache watch test runs based on nativeWatcher experiment. |
| tests/rspack-test/watchCases/cache/unsafe-cache-node-modules-symlink/rspack.config.js | Configures a development build with unsafeCache on node_modules for the new test. |
| tests/rspack-test/watchCases/cache/unsafe-cache-node-modules-symlink/0/index.js | Adds the watch assertion verifying that symlinked node_modules changes are observed across watch steps. |
| packages/rspack-test-tools/src/helper/legacy/copyDiff.js | Adjusts the test helper to handle symlinks correctly when copying fixtures, ensuring watch tests see correct filesystem state. |
| crates/rspack_core/src/compilation/build_module_graph/graph_updater/repair/factorize.rs | Ensures factorization repair reuses create_data.file_dependencies instead of a default, so file dependencies are tracked properly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🎉 Size decreased by 256bytes from 48.31MB to 48.31MB (⬇️0.00%) |
Merging this PR will not alter performance
Comparing Footnotes
|
|
📝 Benchmark detail: Open
|
Summary
This PR addresses issues with watching symlinked
node_moduleswhen using unsafe/persistent cache and ensures the module graph records correct file dependencies so changes are detected.Fix #12875
Related links
Checklist