Skip to content

Commit

Permalink
refactor get_module_graph_for_app_without_issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Nov 29, 2024
1 parent 42d2f75 commit 51ad471
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions crates/next-api/src/module_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,20 @@ 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<Modules>,
) -> Result<Vc<SingleModuleGraph>> {
let vc = SingleModuleGraph::new_with_entries(entries);
let graph = vc.resolve_strongly_consistent().await?;
let _issues = vc.take_collectibles::<Box<dyn Issue>>();
// println!(
// "taking {:?}",
// _issues.iter().map(|i| i.dbg()).try_join().await?
// );
Ok(graph)
}

#[turbo_tasks::value]
pub struct NextDynamicGraph {
is_single_page: bool,
Expand Down Expand Up @@ -321,10 +335,9 @@ pub async fn get_reduced_graphs_for_endpoint(
false,
vec![
async move {
let vc = SingleModuleGraph::new_with_entries(project.get_all_entries());
let vc = vc.resolve_strongly_consistent().await?;
let _ = vc.take_collectibles::<Box<dyn Issue>>();
vc.to_resolved().await
get_module_graph_for_app_without_issues(project.get_all_entries())
.to_resolved()
.await
}
.instrument(tracing::info_span!("module graph for app"))
.await?,
Expand Down

0 comments on commit 51ad471

Please sign in to comment.