-
-
Notifications
You must be signed in to change notification settings - Fork 754
fix: persistent cache save lazy barrel affected modules #12384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this 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 fixes a bug in persistent cache saving for lazy barrel optimization by ensuring all affected modules are properly tracked. The issue was that newly added dependencies were not being synced to cache because only "updated" dependencies (those added, removed, then re-added) were being considered.
Key Changes:
- Changed cache save logic from
affected_dependencies.updated()toaffected_dependencies.active()to capture both newly added and updated dependencies - Expanded test coverage to include a third compiler run to validate cache persistence across multiple builds
- Added clarifying comments about dependency tracking in both process_dependencies and factorize tasks
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_core/src/cache/persistent/occasion/make/mod.rs | Fixed cache save to use active() instead of updated() to capture all affected dependencies |
| crates/rspack_core/src/compilation/build_module_graph/graph_updater/repair/process_dependencies.rs | Added comment explaining why all dependencies are marked here |
| crates/rspack_core/src/compilation/build_module_graph/graph_updater/repair/factorize.rs | Added comment explaining why dependencies from multiple sources are marked |
| tests/rspack-test/cacheCases/make/lazy-barrel/test.js | Added two more test transitions (lines 8-11) to test cache persistence |
| tests/rspack-test/cacheCases/make/lazy-barrel/index.js | Added third compiler run (COMPILER_INDEX == 2) to validate cache across multiple builds |
| tests/rspack-test/cacheCases/make/lazy-barrel/lib/index.js | Simplified diff display (no functional change to the exported values) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 5 project(s) in monorepo. 📁 react-10kPath:
📦 Download Diff Report: react-10k Bundle Diff 📁 react-1kPath:
📦 Download Diff Report: react-1k Bundle Diff 📁 react-5kPath:
📦 Download Diff Report: react-5k Bundle Diff 📁 romePath:
📦 Download Diff Report: rome Bundle Diff 📁 ui-componentsPath:
📦 Download Diff Report: ui-components Bundle Diff Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
❌ Size increased by 384bytes from 47.69MB to 47.69MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #12384 will not alter performanceComparing Summary
|
Summary
The lazy barrel might add some connections without building the parent module. This PR will update the parent module of any additional dependencies to ensure the persistence cache remains intact.
Related links
Checklist