From 7737a0d49655420ba023671deb884bab3e3b338b Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 15 Sep 2023 17:22:03 +0200 Subject: [PATCH] rust check --- .../crates/core/src/react_server_components.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/next-swc/crates/core/src/react_server_components.rs b/packages/next-swc/crates/core/src/react_server_components.rs index 22f9e13837930..1b0f9f1190d04 100644 --- a/packages/next-swc/crates/core/src/react_server_components.rs +++ b/packages/next-swc/crates/core/src/react_server_components.rs @@ -71,8 +71,7 @@ impl VisitMut for ReactServerComponents { self.to_module_ref(module, is_cjs); return; } else if self.bundle_target == "server" { - // Only assert server graph if file's bundle target is "server" - // e.g. + // Only assert server graph if file's bundle target is "server", e.g. // * server components pages // * pages bundles on SSR layer // * middleware @@ -80,15 +79,13 @@ impl VisitMut for ReactServerComponents { self.assert_server_graph(&imports, module); } } else { - // Only assert client graph if the file is not an action file, and bundle target - // is "client" e.g. + // Only assert client graph if the file is not an action file, + // and bundle target is "client" e.g. // * client components pages // * pages bundles on browser layer - if !is_action_file { - if self.bundle_target == "client" { - self.assert_client_graph(&imports); - self.assert_invalid_api(module, true); - } + if !is_action_file && self.bundle_target == "client" { + self.assert_client_graph(&imports); + self.assert_invalid_api(module, true); } if is_client_entry { self.prepend_comment_node(module, is_cjs);