Skip to content

Commit

Permalink
rust check
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Sep 15, 2023
1 parent 797739a commit 7737a0d
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions packages/next-swc/crates/core/src/react_server_components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,21 @@ impl<C: Comments> VisitMut for ReactServerComponents<C> {
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
// * app/pages api routes
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);
Expand Down

0 comments on commit 7737a0d

Please sign in to comment.