-
-
Notifications
You must be signed in to change notification settings - Fork 734
fix: side effects optimize panic when remove lib file #11939
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 panic that occurs when removing a library file during incremental compilation with side effects optimization enabled. The fix ensures proper handling of missing modules and dependencies in the optimization artifact, preventing the panic while maintaining correct incremental build behavior.
Key changes:
- Modified side effects optimization to validate both dependency and target module existence before processing
- Changed the optimization artifact type to eliminate
Optionwrapper, simplifying the data structure - Added comprehensive e2e test case demonstrating the fix for file removal scenarios
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/playwright.config.ts | Added conditional check to prevent overriding incremental configuration when already defined |
| tests/e2e/cases/incremental/remove-optimized-module/rspack.config.js | Test configuration enabling incremental caching with side effects optimization |
| tests/e2e/cases/incremental/remove-optimized-module/package.json | Package configuration marking modules as side effect-free |
| tests/e2e/cases/incremental/remove-optimized-module/index.test.ts | E2e test verifying no panic occurs when removing optimized modules |
| tests/e2e/cases/incremental/remove-optimized-module/index.js | Test entry point importing component to be removed |
| tests/e2e/cases/incremental/remove-optimized-module/comp/index.js | Component barrel export file |
| tests/e2e/cases/incremental/remove-optimized-module/comp/Button.js | Component module that gets removed during test |
| crates/rspack_plugin_javascript/src/plugin/side_effects_flag_plugin.rs | Core fix: validates module existence before processing and refactored artifact collection to use streaming approach |
| crates/rspack_core/src/module_graph/mod.rs | Reformatted conditional to improve readability |
| crates/rspack_core/src/exports/target.rs | Changed function visibility from public to private |
| crates/rspack_core/src/artifacts/side_effects_do_optimize_artifact.rs | Simplified artifact type by removing Option wrapper |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📦 Binary Size-limit
🎉 Size decreased by 1.00KB from 47.85MB to 47.85MB (⬇️0.00%) |
CodSpeed Performance ReportMerging #11939 will not alter performanceComparing Summary
|
16771d7 to
ef3b76e
Compare
ef3b76e to
dbfc44a
Compare
8441dd5 to
dc1bedf
Compare
dc1bedf to
6be67c5
Compare
Summary
Related links
Checklist