-
-
Notifications
You must be signed in to change notification settings - Fork 760
refactor: make &compilation for optimization_dependencies #12576
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 refactors the CompilationOptimizeDependencies hook to accept &Compilation (immutable reference) instead of &mut Compilation (mutable reference), passing BuildModuleGraphArtifact as a separate mutable parameter. This allows better separation of concerns and more granular control over what can be mutated during dependency optimization.
Key Changes:
- Modified
CompilationOptimizeDependencieshook signature to take&Compilationand&mut BuildModuleGraphArtifactseparately - Removed the
Compilation::get_make_module_graph_mutstatic method in favor of direct access viabuild_module_graph_artifact.get_module_graph_mut() - Updated all plugins implementing the hook to use the new signature
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
crates/rspack_core/src/compilation/mod.rs |
Updated hook definition, removed static helper method, refactored add_entry and call sites to use direct access pattern |
crates/rspack_plugin_progress/src/lib.rs |
Updated hook implementation signature and added import for BuildModuleGraphArtifact |
crates/rspack_plugin_javascript/src/plugin/side_effects_flag_plugin.rs |
Updated hook signature and changed to use new artifact parameter for module graph access |
crates/rspack_plugin_javascript/src/plugin/inline_exports_plugin.rs |
Updated hook signature, added import, changed module graph access pattern |
crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs |
Refactored proxy struct and methods to accept separate compilation and artifact parameters |
crates/rspack_plugin_javascript/src/plugin/flag_dependency_exports_plugin.rs |
Updated to use direct access instead of static method |
crates/rspack_plugin_dll/src/flag_all_modules_as_used_plugin.rs |
Updated hook signature and module graph access |
crates/rspack_plugin_rslib/src/import_external.rs |
Changed from static method to direct access pattern |
crates/rspack_plugin_library/src/modern_module_library_plugin.rs |
Changed from static method to direct access pattern |
crates/rspack_plugin_library/src/export_property_library_plugin.rs |
Changed from static method to direct access pattern |
crates/rspack_plugin_library/src/assign_library_plugin.rs |
Changed from static method to direct access pattern |
crates/rspack_plugin_lazy_compilation/src/plugin.rs |
Changed from static method to direct access pattern |
crates/rspack_plugin_esm_library/src/plugin.rs |
Changed from static method to direct access pattern |
crates/rspack_binding_api/src/exports_info.rs |
Changed from static method to direct access pattern |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
crates/rspack_plugin_javascript/src/plugin/flag_dependency_usage_plugin.rs
Show resolved
Hide resolved
crates/rspack_plugin_javascript/src/plugin/inline_exports_plugin.rs
Outdated
Show resolved
Hide resolved
📦 Binary Size-limit
🎉 Size decreased by 1.38KB from 47.85MB to 47.85MB (⬇️0.00%) |
7651281 to
1388182
Compare
1388182 to
b2501aa
Compare
Rsdoctor Bundle Diff Analysis
Found 5 projects in monorepo, 1 project with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 romePath:
📦 Download Diff Report: rome Bundle Diff Generated by Rsdoctor GitHub Action |
CodSpeed Performance ReportMerging #12576 will not alter performanceComparing Summary
Footnotes
|
Summary
change &mut compilation to &compilation to avoid direct mutate compilation in optimize_dependencies phase
Related links
Checklist