Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions crates/next-api/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ impl AppProject {
server_component_entries,
} = &*find_server_entries(*rsc_entry).await?;

let graph = SingleModuleGraph::new_with_entries_visited(
let graph = SingleModuleGraph::new_with_entries_visited_intern(
vec![
(
server_utils
Expand All @@ -851,7 +851,7 @@ impl AppProject {
let mut visited_modules = VisitedModules::from_graph(graph);

for module in server_component_entries.iter() {
let graph = SingleModuleGraph::new_with_entries_visited(
let graph = SingleModuleGraph::new_with_entries_visited_intern(
vec![(vec![ResolvedVc::upcast(*module)], ChunkGroupType::Entry)],
visited_modules,
);
Expand All @@ -872,15 +872,15 @@ impl AppProject {
}
visited_modules
} else {
let graph = SingleModuleGraph::new_with_entries_visited(
let graph = SingleModuleGraph::new_with_entries_visited_intern(
vec![(client_shared_entries, ChunkGroupType::Evaluated)],
VisitedModules::empty(),
);
graphs.push(graph);
VisitedModules::from_graph(graph)
};

let graph = SingleModuleGraph::new_with_entries_visited(
let graph = SingleModuleGraph::new_with_entries_visited_intern(
vec![(vec![ResolvedVc::upcast(rsc_entry)], ChunkGroupType::Entry)],
visited_modules,
);
Expand All @@ -889,7 +889,7 @@ impl AppProject {

let base = ModuleGraph::from_graphs(graphs.clone());
let additional_entries = endpoint.additional_entries(base);
let additional_module_graph = SingleModuleGraph::new_with_entries_visited(
let additional_module_graph = SingleModuleGraph::new_with_entries_visited_intern(
additional_entries.owned().await?,
visited_modules,
);
Expand Down
6 changes: 2 additions & 4 deletions crates/next-api/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1735,10 +1735,8 @@ async fn whole_app_module_graph_operation(
let base = ModuleGraph::from_single_graph(base_single_module_graph);
let additional_entries = project.get_all_additional_entries(base);

let additional_module_graph = SingleModuleGraph::new_with_entries_visited(
additional_entries.owned().await?,
base_visited_modules,
);
let additional_module_graph =
SingleModuleGraph::new_with_entries_visited(additional_entries, base_visited_modules);

let full = ModuleGraph::from_graphs(vec![base_single_module_graph, additional_module_graph]);
Ok(ModuleGraphs {
Expand Down
8 changes: 8 additions & 0 deletions turbopack/crates/turbopack-core/src/module_graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,14 @@ impl SingleModuleGraph {

#[turbo_tasks::function]
pub async fn new_with_entries_visited(
entries: Vc<GraphEntries>,
visited_modules: Vc<VisitedModules>,
) -> Result<Vc<Self>> {
SingleModuleGraph::new_inner(&*entries.await?, &visited_modules.await?.modules).await
}

#[turbo_tasks::function]
pub async fn new_with_entries_visited_intern(
// This must not be a Vc<Vec<_>> to ensure layout segment optimization hits the cache
entries: GraphEntriesT,
visited_modules: Vc<VisitedModules>,
Expand Down
Loading