Skip to content
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

refactor: split task in make stage #6258

Merged
merged 3 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions crates/rspack_core/src/compiler/compilation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,11 @@ impl Compilation {
self.id
}

pub fn swap_make_module_graph(&mut self, other: &mut Compilation) {
pub fn swap_make_module_graph_with_compilation(&mut self, other: &mut Compilation) {
std::mem::swap(&mut self.make_module_graph, &mut other.make_module_graph);
}
pub fn swap_module_graph_with_module_executor(&mut self, module_executor: &mut ModuleExecutor) {
std::mem::swap(
&mut self.make_module_graph,
&mut module_executor.make_module_graph,
);
pub fn swap_make_module_graph(&mut self, module_graph_partial: &mut ModuleGraphPartial) {
std::mem::swap(&mut self.make_module_graph, module_graph_partial);
}

pub fn get_module_graph(&self) -> ModuleGraph {
Expand Down
2 changes: 1 addition & 1 deletion crates/rspack_core/src/compiler/hmr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ where
// make stage used
self
.compilation
.swap_make_module_graph(&mut new_compilation);
.swap_make_module_graph_with_compilation(&mut new_compilation);
new_compilation.make_failed_dependencies =
std::mem::take(&mut self.compilation.make_failed_dependencies);
new_compilation.make_failed_module =
Expand Down
Loading
Loading