diff --git a/crates/next-api/src/module_graph.rs b/crates/next-api/src/module_graph.rs index c7629a9d1e7ab..ef964abfe018c 100644 --- a/crates/next-api/src/module_graph.rs +++ b/crates/next-api/src/module_graph.rs @@ -450,20 +450,6 @@ async fn get_module_graph_for_endpoint( Ok(Vc::cell(graphs)) } -#[turbo_tasks::function] -async fn get_module_graph_for_app_without_issues( - entries: Vc, -) -> Result> { - let vc = SingleModuleGraph::new_with_entries(entries); - let graph = vc.resolve_strongly_consistent().await?; - let _issues = vc.take_collectibles::>(); - // println!( - // "taking {:?}", - // _issues.iter().map(|i| i.dbg()).try_join().await? - // ); - Ok(graph) -} - #[turbo_tasks::value] pub struct NextDynamicGraph { is_single_page: bool, @@ -547,7 +533,7 @@ impl NextDynamicGraph { } } -/// The consumers of this shoudln't need to care about the exact contents since it's abstracted away +/// The consumers of this shouldn't need to care about the exact contents since it's abstracted away /// by the accessor functions, but /// - In dev, contains information about the modules of the current endpoint only /// - In prod, there is a single `ReducedGraphs` for the whole app, containing all pages @@ -613,7 +599,7 @@ async fn get_reduced_graphs_for_endpoint_inner( false, vec![ async move { - get_module_graph_for_app_without_issues(project.get_all_entries()) + SingleModuleGraph::new_with_entries(project.get_all_entries()) .to_resolved() .await } diff --git a/crates/next-api/src/project.rs b/crates/next-api/src/project.rs index e5c2d1370ce24..4ce61355561f7 100644 --- a/crates/next-api/src/project.rs +++ b/crates/next-api/src/project.rs @@ -68,7 +68,7 @@ use crate::{ instrumentation::InstrumentationEndpoint, middleware::MiddlewareEndpoint, pages::PagesProject, - route::{Endpoint, Route}, + route::{AppPageRoute, Endpoint, Route}, versioned_content_map::{OutputAssetsOperation, VersionedContentMap}, }; @@ -703,18 +703,21 @@ impl Project { match route { Route::Page { html_endpoint, - data_endpoint, + data_endpoint: _, } => { add_endpoint(**html_endpoint, &mut modules).await?; - add_endpoint(**data_endpoint, &mut modules).await?; } Route::PageApi { endpoint } => { add_endpoint(**endpoint, &mut modules).await?; } Route::AppPage(page_routes) => { - for page_route in page_routes { - add_endpoint(page_route.html_endpoint, &mut modules).await?; - add_endpoint(page_route.rsc_endpoint, &mut modules).await?; + for AppPageRoute { + original_name: _, + html_endpoint, + rsc_endpoint: _, + } in page_routes + { + add_endpoint(*html_endpoint, &mut modules).await?; } } Route::AppRoute { diff --git a/turbopack/crates/turbo-tasks/src/graph/adjacency_map.rs b/turbopack/crates/turbo-tasks/src/graph/adjacency_map.rs index 3e000a5236880..7d92520e62861 100644 --- a/turbopack/crates/turbo-tasks/src/graph/adjacency_map.rs +++ b/turbopack/crates/turbo-tasks/src/graph/adjacency_map.rs @@ -88,7 +88,7 @@ where } } - /// Returns an owned iterator over the nodes in reverse topological order, + /// Returns an owned iterator over all edges (node pairs) in breadth first order, /// starting from the roots. pub fn into_breadth_first_edges(self) -> IntoBreadthFirstEdges { IntoBreadthFirstEdges { @@ -212,7 +212,7 @@ where return Some((parent, current)); }; - if !self.visited.contains(¤t) { + if self.visited.insert(current.clone()) { self.stack.extend( neighbors .iter() @@ -220,7 +220,6 @@ where .map(|neighbor| (Some(current.clone()), neighbor.clone())), ); } - self.visited.insert(current.clone()); Some((parent, current)) }