Unverified Commit 9375bc3d authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Turbopack: remove global_information struct (#86089)

This was always unnecessary.

Or is this worse now as there are fewer strongly consistent reads?
parent c0e51be2
...@@ -75,7 +75,7 @@ use crate::{ ...@@ -75,7 +75,7 @@ use crate::{
dynamic_imports::{NextDynamicChunkAvailability, collect_next_dynamic_chunks}, dynamic_imports::{NextDynamicChunkAvailability, collect_next_dynamic_chunks},
font::FontManifest, font::FontManifest,
loadable_manifest::create_react_loadable_manifest, loadable_manifest::create_react_loadable_manifest,
module_graph::get_global_information_for_endpoint, module_graph::{ClientReferencesGraphs, NextDynamicGraphs, ServerActionsGraphs},
nft_json::NftJsonAsset, nft_json::NftJsonAsset,
paths::{ paths::{
all_paths_in_root, all_server_paths, get_asset_paths_from_root, get_js_paths_from_root, all_paths_in_root, all_server_paths, get_asset_paths_from_root, get_js_paths_from_root,
...@@ -1253,22 +1253,22 @@ impl AppEndpoint { ...@@ -1253,22 +1253,22 @@ impl AppEndpoint {
(AvailabilityInfo::Root, vec![]) (AvailabilityInfo::Root, vec![])
}; };
let global_information = get_global_information_for_endpoint( let per_page_module_graph = *project.per_page_module_graph().await?;
*module_graphs.base,
*project.per_page_module_graph().await?,
);
let next_dynamic_imports = global_information
.get_next_dynamic_imports_for_endpoint(*rsc_entry)
.await?;
let client_references = global_information let next_dynamic_imports =
.get_client_references_for_endpoint( NextDynamicGraphs::new(*module_graphs.base, per_page_module_graph)
*rsc_entry, .get_next_dynamic_imports_for_endpoint(*rsc_entry)
matches!(this.ty, AppEndpointType::Page { .. }), .await?;
project.next_mode().await?.is_production(),
) let client_references =
.to_resolved() ClientReferencesGraphs::new(*module_graphs.base, per_page_module_graph)
.await?; .get_client_references_for_endpoint(
*rsc_entry,
matches!(this.ty, AppEndpointType::Page { .. }),
project.next_mode().await?.is_production(),
)
.to_resolved()
.await?;
let client_references_chunks = get_app_client_references_chunks( let client_references_chunks = get_app_client_references_chunks(
*client_references, *client_references,
...@@ -1395,13 +1395,14 @@ impl AppEndpoint { ...@@ -1395,13 +1395,14 @@ impl AppEndpoint {
} }
} }
let actions = global_information.get_server_actions_for_endpoint( let actions = ServerActionsGraphs::new(*module_graphs.base, per_page_module_graph)
*rsc_entry, .get_server_actions_for_endpoint(
match runtime { *rsc_entry,
NextRuntime::Edge => Vc::upcast(this.app_project.edge_rsc_module_context()), match runtime {
NextRuntime::NodeJs => Vc::upcast(this.app_project.rsc_module_context()), NextRuntime::Edge => Vc::upcast(this.app_project.edge_rsc_module_context()),
}, NextRuntime::NodeJs => Vc::upcast(this.app_project.rsc_module_context()),
); },
);
let server_action_manifest = create_server_actions_manifest( let server_action_manifest = create_server_actions_manifest(
actions, actions,
...@@ -2074,7 +2075,7 @@ impl Endpoint for AppEndpoint { ...@@ -2074,7 +2075,7 @@ impl Endpoint for AppEndpoint {
let rsc_entry = app_entry.rsc_entry; let rsc_entry = app_entry.rsc_entry;
let runtime = app_entry.config.await?.runtime.unwrap_or_default(); let runtime = app_entry.config.await?.runtime.unwrap_or_default();
let actions = get_global_information_for_endpoint( let actions = ServerActionsGraphs::new(
graph, graph,
*this.app_project.project().per_page_module_graph().await?, *this.app_project.project().per_page_module_graph().await?,
) )
......
This diff is collapsed.
...@@ -71,7 +71,7 @@ use crate::{ ...@@ -71,7 +71,7 @@ use crate::{
}, },
font::FontManifest, font::FontManifest,
loadable_manifest::create_react_loadable_manifest, loadable_manifest::create_react_loadable_manifest,
module_graph::get_global_information_for_endpoint, module_graph::{NextDynamicGraphs, validate_pages_css_imports},
nft_json::NftJsonAsset, nft_json::NftJsonAsset,
paths::{ paths::{
all_paths_in_root, all_server_paths, get_asset_paths_from_root, get_js_paths_from_root, all_paths_in_root, all_server_paths, get_asset_paths_from_root, get_js_paths_from_root,
...@@ -941,11 +941,7 @@ impl PageEndpoint { ...@@ -941,11 +941,7 @@ impl PageEndpoint {
let client_availability_info = self.client_chunk_group().await?.availability_info; let client_availability_info = self.client_chunk_group().await?.availability_info;
let client_module_graph = self.client_module_graph(); let client_module_graph = self.client_module_graph();
let per_page_module_graph = *project.per_page_module_graph().await?;
let global_information = get_global_information_for_endpoint(
client_module_graph,
*project.per_page_module_graph().await?,
);
// We only validate the global css imports when there is not a `app` folder at the // We only validate the global css imports when there is not a `app` folder at the
// root of the project. // root of the project.
...@@ -968,14 +964,19 @@ impl PageEndpoint { ...@@ -968,14 +964,19 @@ impl PageEndpoint {
.await? .await?
.module(); .module();
global_information validate_pages_css_imports(
.validate_pages_css_imports(self.client_module(), app_module) client_module_graph,
.await?; per_page_module_graph,
self.client_module(),
app_module,
)
.await?;
} }
let next_dynamic_imports = global_information let next_dynamic_imports =
.get_next_dynamic_imports_for_endpoint(self.client_module()) NextDynamicGraphs::new(client_module_graph, per_page_module_graph)
.await?; .get_next_dynamic_imports_for_endpoint(self.client_module())
.await?;
Some((next_dynamic_imports, client_availability_info)) Some((next_dynamic_imports, client_availability_info))
} else { } else {
None None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment