refactor: move exports info out of module graph#13055
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the codebase to separate exports information from the module graph by introducing a new ExportsInfoArtifact. The refactoring moves exports-related data and operations out of the ModuleGraph into a dedicated artifact, improving separation of concerns and enabling better incremental compilation support.
Changes:
- Introduces
ExportsInfoArtifactto manage exports information separately from the module graph - Updates compilation hooks and plugin interfaces to pass the new artifact
- Refactors module graph to remove exports info storage and operations
- Updates all plugins and dependencies to use the new artifact structure
Reviewed changes
Copilot reviewed 124 out of 124 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
crates/rspack_core/src/artifacts/exports_info_artifact.rs |
New artifact implementation managing exports information |
crates/rspack_core/src/module_graph/mod.rs |
Removed exports info storage and related methods |
crates/rspack_core/src/module_graph/module.rs |
Removed exports field from ModuleGraphModule |
crates/rspack_core/src/module_graph/exports_info.rs |
Deleted file - functionality moved to artifact |
crates/rspack_core/src/compilation/mod.rs |
Added exports_info_artifact field and helper methods |
crates/rspack_core/src/compilation/optimize_dependencies/mod.rs |
Updated to steal and restore exports info artifact |
crates/rspack_core/src/compilation/finish_modules/mod.rs |
Split into separate pass with artifact checkpointing |
crates/rspack_core/src/compilation/build_module_graph/* |
Updated graph building to create and manage exports info |
crates/rspack_plugin_*/ |
Updated all plugins to accept and use ExportsInfoArtifact |
crates/rspack_core/src/exports/*.rs |
Updated target resolution and export info operations |
crates/rspack_core/src/cache/*.rs |
Updated cache implementations for new artifact |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5804aef to
0e8d611
Compare
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
❌ Size increased by 35.88KB from 48.68MB to 48.72MB (⬆️0.07%) |
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
Move exports info out of module graph
Remaining todo: currently
ExportsInfoArtifact::PassisBUILD_MODULE_GRAPH, because it's initialized at module factorize, we may consider move it toFINISH_MODULESand initilizing at finish_modules pass (which is a breaking change) in the future PRRelated links
Checklist