-
-
Notifications
You must be signed in to change notification settings - Fork 746
fix: should not cache dependency instance in DynamicEntryPlugin #11888
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.
|
📦 Binary Size-limit
❌ Size increased by 4.38KB from 47.66MB to 47.67MB (⬆️0.01%) |
0e7f548 to
3a18076
Compare
CodSpeed Performance ReportMerging #11888 will not alter performanceComparing Summary
|
3a18076 to
2478a2c
Compare
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
Fix caching in DynamicEntryPlugin to store DependencyId instead of EntryDependency instances, preserving FactorizeInfo and enabling correct cleanup of dynamic entry subtrees across compilations.
- Cache DependencyId per entry/options and rebuild the mapping each compilation
- Update make() to resolve dependencies by id from the ModuleGraph
- Add a watch test case ensuring entry subtree is removed when a dynamic 404 entry disappears
Reviewed Changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rspack_plugin_dynamic_entry/src/lib.rs | Switch to caching DependencyId behind an async mutex and adjust make() logic to reuse or recreate entry dependencies by id |
| tests/rspack-test/watchCases/entries/loader-as-dynamic-entry/rspack.config.js | Dynamic entry config and plugin to mark missing files for watch, exercising cleanup behavior |
| tests/rspack-test/watchCases/entries/loader-as-dynamic-entry/test.config.js | Test harness config for this watch case |
| tests/rspack-test/watchCases/entries/loader-as-dynamic-entry/0/404-page-loader.js | Loader producing a require of 404.js to form the subtree |
| tests/rspack-test/watchCases/entries/loader-as-dynamic-entry/2/404.js | Fixture to simulate removal of the 404 entry |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary
Cache DependencyId in DynamicEntryPlugin instead of EntryDependency instances to preserve build information across compilations.
Caching instances loses
FactorizeInfoand other metadata, preventing proper removal of entry dependency subtrees.Related links
Checklist