Unverified Commit cb8361ac authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

put app code into a separate layer (#56800)

### What?

app code is different from pages code and need to be in a separate layer

### Why?

Otherwise it tries to share chunks and will cause conflicting writes

### How?


Closes WEB-1778
parent 489a5280
...@@ -516,7 +516,7 @@ impl AppEndpoint { ...@@ -516,7 +516,7 @@ impl AppEndpoint {
.ident() .ident()
.with_modifier(Vc::cell("client_shared_chunks".to_string())), .with_modifier(Vc::cell("client_shared_chunks".to_string())),
this.app_project.client_runtime_entries(), this.app_project.client_runtime_entries(),
this.app_project.project().client_chunking_context(), this.app_project.project().app_client_chunking_context(),
); );
let mut client_shared_chunks_paths = vec![]; let mut client_shared_chunks_paths = vec![];
...@@ -570,8 +570,8 @@ impl AppEndpoint { ...@@ -570,8 +570,8 @@ impl AppEndpoint {
if ssr_and_client { if ssr_and_client {
let client_references_chunks = get_app_client_references_chunks( let client_references_chunks = get_app_client_references_chunks(
client_reference_types, client_reference_types,
this.app_project.project().client_chunking_context(), this.app_project.project().app_client_chunking_context(),
this.app_project.project().ssr_chunking_context(), this.app_project.project().app_ssr_chunking_context(),
); );
let client_references_chunks_ref = client_references_chunks.await?; let client_references_chunks_ref = client_references_chunks.await?;
...@@ -642,8 +642,8 @@ impl AppEndpoint { ...@@ -642,8 +642,8 @@ impl AppEndpoint {
app_entry.original_name.clone(), app_entry.original_name.clone(),
client_references, client_references,
client_references_chunks, client_references_chunks,
this.app_project.project().client_chunking_context(), this.app_project.project().app_client_chunking_context(),
Vc::upcast(this.app_project.project().ssr_chunking_context()), Vc::upcast(this.app_project.project().app_ssr_chunking_context()),
this.app_project this.app_project
.project() .project()
.next_config() .next_config()
......
...@@ -505,6 +505,13 @@ impl Project { ...@@ -505,6 +505,13 @@ impl Project {
)) ))
} }
#[turbo_tasks::function]
pub(super) fn app_client_chunking_context(
self: Vc<Self>,
) -> Vc<Box<dyn EcmascriptChunkingContext>> {
self.client_chunking_context().with_layer("app".to_string())
}
#[turbo_tasks::function] #[turbo_tasks::function]
fn server_chunking_context(self: Vc<Self>) -> Vc<BuildChunkingContext> { fn server_chunking_context(self: Vc<Self>) -> Vc<BuildChunkingContext> {
get_server_chunking_context( get_server_chunking_context(
...@@ -609,6 +616,12 @@ impl Project { ...@@ -609,6 +616,12 @@ impl Project {
self.server_chunking_context().with_layer("ssr".to_string()) self.server_chunking_context().with_layer("ssr".to_string())
} }
#[turbo_tasks::function]
pub(super) fn app_ssr_chunking_context(self: Vc<Self>) -> Vc<BuildChunkingContext> {
self.server_chunking_context()
.with_layer("app ssr".to_string())
}
#[turbo_tasks::function] #[turbo_tasks::function]
pub(super) fn edge_ssr_chunking_context( pub(super) fn edge_ssr_chunking_context(
self: Vc<Self>, self: Vc<Self>,
......
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