Unverified Commit 42ccb2ee authored by Sam Poder's avatar Sam Poder Committed by GitHub

[turbopack] Clean up `server_chunking_context` (#95908)

https://github.com/vercel/next.js/pull/95539/changes#r3598998062
parent 20f58093
...@@ -1334,17 +1334,27 @@ impl AppEndpoint { ...@@ -1334,17 +1334,27 @@ impl AppEndpoint {
let client_chunking_context = project.client_chunking_context().to_resolved().await?; let client_chunking_context = project.client_chunking_context().to_resolved().await?;
let server_chunking_context = match runtime { let server_chunking_context = if process_ssr || is_app_page {
NextRuntime::NodeJs => Vc::upcast(project.server_chunking_context(true)), Some(
NextRuntime::Edge => this match runtime {
.app_project NextRuntime::NodeJs => Vc::upcast(project.server_chunking_context(true)),
.project() NextRuntime::Edge => this
.edge_chunking_context(process_client_assets), .app_project
} .project()
.to_resolved() .edge_chunking_context(process_client_assets),
.await?; }
.to_resolved()
.await?,
)
} else {
None
};
let ssr_chunking_context = process_ssr.then_some(server_chunking_context); let ssr_chunking_context = if process_ssr {
server_chunking_context
} else {
None
};
let per_page_module_graph = *project.per_page_module_graph().await?; let per_page_module_graph = *project.per_page_module_graph().await?;
...@@ -1600,7 +1610,11 @@ impl AppEndpoint { ...@@ -1600,7 +1610,11 @@ impl AppEndpoint {
ssr_chunking_context, ssr_chunking_context,
// Only pages need `rscModuleMapping`; route handlers and // Only pages need `rscModuleMapping`; route handlers and
// metadata routes keep emitting no module mappings. // metadata routes keep emitting no module mappings.
rsc_chunking_context: is_app_page.then_some(server_chunking_context), rsc_chunking_context: if is_app_page {
server_chunking_context
} else {
None
},
async_module_info: module_graphs.full.async_module_info().to_resolved().await?, async_module_info: module_graphs.full.async_module_info().to_resolved().await?,
next_config: project.next_config().to_resolved().await?, next_config: project.next_config().to_resolved().await?,
runtime, runtime,
......
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