Skip to content

Commit

Permalink
place all pages in the same intermediate output directory (vercel/tur…
Browse files Browse the repository at this point in the history
…borepo#4081)

### Description

The isolation is unnecessary and we can reuse files when we share
directories

### Testing Instructions

Open multiple pages without client-side navigation in multiple tabs
concurrently.
  • Loading branch information
sokra committed Mar 7, 2023
1 parent ed9bcff commit 9df85d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
18 changes: 4 additions & 14 deletions crates/next-core/src/app_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use anyhow::{anyhow, Result};
use indexmap::indexmap;
use turbo_tasks::{TryJoinIterExt, Value, ValueToString};
use turbo_tasks_env::{CustomProcessEnvVc, EnvMapVc, ProcessEnvVc};
use turbo_tasks_fs::{rebase, rope::RopeBuilder, File, FileContent, FileSystemPathVc};
use turbo_tasks_fs::{rope::RopeBuilder, File, FileContent, FileSystemPathVc};
use turbopack::{
ecmascript::EcmascriptInputTransform,
transition::{TransitionVc, TransitionsByNameVc},
Expand Down Expand Up @@ -394,9 +394,7 @@ async fn create_app_source_for_directory(
intermediate_output_path_root: FileSystemPathVc,
) -> Result<ContentSourceVc> {
let AppStructure {
item,
ref children,
directory,
item, ref children, ..
} = *app_structure.await?;
let mut sources = Vec::new();

Expand Down Expand Up @@ -428,11 +426,7 @@ async fn create_app_source_for_directory(
page_path: page,
target,
project_path,
intermediate_output_path: rebase(
directory,
project_path,
intermediate_output_path_root,
),
intermediate_output_path: intermediate_output_path_root,
}
.cell()
.into(),
Expand Down Expand Up @@ -461,11 +455,7 @@ async fn create_app_source_for_directory(
server_root,
entry_path: route,
project_path,
intermediate_output_path: rebase(
directory,
project_path,
intermediate_output_path_root,
),
intermediate_output_path: intermediate_output_path_root,
output_root: intermediate_output_path_root,
}
.cell()
Expand Down
6 changes: 3 additions & 3 deletions crates/next-core/src/page_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use turbo_tasks::{
Value,
};
use turbo_tasks_env::{CustomProcessEnvVc, EnvMapVc, ProcessEnvVc};
use turbo_tasks_fs::{rebase, FileContent, FileSystemPathVc};
use turbo_tasks_fs::{FileContent, FileSystemPathVc};
use turbopack::{transition::TransitionsByNameVc, ModuleAssetContextVc};
use turbopack_core::{
asset::AssetVc,
Expand Down Expand Up @@ -575,7 +575,7 @@ async fn create_page_source_for_directory(
server_root,
url,
false,
rebase(page, project_path, output_root),
output_root,
output_root,
));
}
Expand All @@ -598,7 +598,7 @@ async fn create_page_source_for_directory(
server_root,
url,
true,
rebase(api, project_path, output_root),
output_root,
output_root,
));
}
Expand Down

0 comments on commit 9df85d6

Please sign in to comment.