Skip to content

Commit

Permalink
fix: do not clean up then watch graph monitoring module (#2027)
Browse files Browse the repository at this point in the history
  • Loading branch information
shulandmimi authored Dec 26, 2024
1 parent 3e01960 commit 43e0ea0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-carrots-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@farmfe/core": patch
---

do not clean up then watch graph monitoring module
3 changes: 1 addition & 2 deletions crates/compiler/src/update/handle_update_modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ fn resolve_watch_graph_paths(
.into_iter()
.flat_map(|(path, update_type)| {
let id = ModuleId::new(&path, "", &context.config.root);

if watch_graph.has_module(&id) {
let r: Vec<(String, UpdateType)> = watch_graph
.relation_roots(&id)
Expand All @@ -216,7 +215,7 @@ fn resolve_watch_graph_paths(
})
.collect();

if module_graph.has_module(&ModuleId::new(path.as_str(), "", &context.config.root)) {
if module_graph.has_module(&id) {
return [r, vec![(path, update_type)]].concat();
};

Expand Down
10 changes: 0 additions & 10 deletions crates/compiler/src/update/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,6 @@ impl Compiler {
.push(id.resolved_path(&self.context.config.root));
};
}

watch_diff_result.remove.extend(
old_watch_extra_resources
.into_iter()
.map(|r| r.resolved_path(&self.context.config.root)),
);
}

// If the module type is not script, we should skip render and generate update resource.
Expand Down Expand Up @@ -409,10 +403,6 @@ impl Compiler {
mut module,
resolve_module_id_result,
}) => {
let mut graph_watch = context.watch_graph.write();
graph_watch.delete_module(&module.id);
drop(graph_watch);

if resolve_module_id_result.resolve_result.external {
// insert external module to the graph
let module_id: ModuleId = resolve_param.source.as_str().into();
Expand Down
2 changes: 1 addition & 1 deletion js-plugins/postcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"license": "MIT",
"devDependencies": {
"@farmfe/cli": "workspace:*",
"@farmfe/core": "workspace:^1.6.0",
"@farmfe/core": "workspace:*",
"@farmfe/js-plugin-dts": "workspace:*",
"@types/postcss-import": "^14.0.3",
"@types/postcss-url": "^10.0.4",
Expand Down

0 comments on commit 43e0ea0

Please sign in to comment.