feat!: use defer_options for build_module_artifact#12578
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the build_module_graph_artifact field in the Compilation struct to use DerefOption wrapper, replacing direct usage of std::mem operations with DerefOption's methods.
Key Changes:
- Changed
build_module_graph_artifacttype fromBuildModuleGraphArtifacttoDerefOption<BuildModuleGraphArtifact> - Replaced all
mem::takecalls withDerefOption::take()method - Wrapped all assignments with
DerefOption::new()to maintain the wrapper - Updated
swap_build_module_graph_artifactto useDerefOption::swap()method - Removed unused
memimport from the use statement (thoughstd::memis still used elsewhere with fully qualified paths)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 8.88KB from 48.00MB to 48.01MB (⬆️0.02%) |
CodSpeed Performance ReportMerging #12578 will not alter performanceComparing Summary
Footnotes
|
Summary
use derefOption for build_module_graph_artifact to support runtime exclusive check in the future,
It will panic if js access incomplete module_graph
Breaking!
ModuleGraph is not accessible during loader phase now since it's not finished and mutual write & read access from both rust and js side is undefined behavior
Related links
Checklist