Skip to content

Commit 998347d

Browse files
committed
Turbopack: remove global_information struct
1 parent 589f468 commit 998347d

File tree

3 files changed

+307
-280
lines changed

3 files changed

+307
-280
lines changed

crates/next-api/src/app.rs

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ use crate::{
7575
dynamic_imports::{NextDynamicChunkAvailability, collect_next_dynamic_chunks},
7676
font::FontManifest,
7777
loadable_manifest::create_react_loadable_manifest,
78-
module_graph::get_global_information_for_endpoint,
78+
module_graph::{ClientReferencesGraphs, NextDynamicGraphs, ServerActionsGraphs},
7979
nft_json::NftJsonAsset,
8080
paths::{
8181
all_paths_in_root, all_server_paths, get_asset_paths_from_root, get_js_paths_from_root,
@@ -1253,22 +1253,22 @@ impl AppEndpoint {
12531253
(AvailabilityInfo::Root, vec![])
12541254
};
12551255

1256-
let global_information = get_global_information_for_endpoint(
1257-
*module_graphs.base,
1258-
*project.per_page_module_graph().await?,
1259-
);
1260-
let next_dynamic_imports = global_information
1261-
.get_next_dynamic_imports_for_endpoint(*rsc_entry)
1262-
.await?;
1256+
let per_page_module_graph = *project.per_page_module_graph().await?;
12631257

1264-
let client_references = global_information
1265-
.get_client_references_for_endpoint(
1266-
*rsc_entry,
1267-
matches!(this.ty, AppEndpointType::Page { .. }),
1268-
project.next_mode().await?.is_production(),
1269-
)
1270-
.to_resolved()
1271-
.await?;
1258+
let next_dynamic_imports =
1259+
NextDynamicGraphs::new(*module_graphs.base, per_page_module_graph)
1260+
.get_next_dynamic_imports_for_endpoint(*rsc_entry)
1261+
.await?;
1262+
1263+
let client_references =
1264+
ClientReferencesGraphs::new(*module_graphs.base, per_page_module_graph)
1265+
.get_client_references_for_endpoint(
1266+
*rsc_entry,
1267+
matches!(this.ty, AppEndpointType::Page { .. }),
1268+
project.next_mode().await?.is_production(),
1269+
)
1270+
.to_resolved()
1271+
.await?;
12721272

12731273
let client_references_chunks = get_app_client_references_chunks(
12741274
*client_references,
@@ -1395,13 +1395,14 @@ impl AppEndpoint {
13951395
}
13961396
}
13971397

1398-
let actions = global_information.get_server_actions_for_endpoint(
1399-
*rsc_entry,
1400-
match runtime {
1401-
NextRuntime::Edge => Vc::upcast(this.app_project.edge_rsc_module_context()),
1402-
NextRuntime::NodeJs => Vc::upcast(this.app_project.rsc_module_context()),
1403-
},
1404-
);
1398+
let actions = ServerActionsGraphs::new(*module_graphs.base, per_page_module_graph)
1399+
.get_server_actions_for_endpoint(
1400+
*rsc_entry,
1401+
match runtime {
1402+
NextRuntime::Edge => Vc::upcast(this.app_project.edge_rsc_module_context()),
1403+
NextRuntime::NodeJs => Vc::upcast(this.app_project.rsc_module_context()),
1404+
},
1405+
);
14051406

14061407
let server_action_manifest = create_server_actions_manifest(
14071408
actions,
@@ -2074,7 +2075,7 @@ impl Endpoint for AppEndpoint {
20742075
let rsc_entry = app_entry.rsc_entry;
20752076
let runtime = app_entry.config.await?.runtime.unwrap_or_default();
20762077

2077-
let actions = get_global_information_for_endpoint(
2078+
let actions = ServerActionsGraphs::new(
20782079
graph,
20792080
*this.app_project.project().per_page_module_graph().await?,
20802081
)

0 commit comments

Comments
 (0)