Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Nov 28, 2024
1 parent 2f6a95d commit c0a8154
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions crates/next-api/src/module_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ impl SingleModuleGraph {

/// Implements layout segment optimization to compute a graph "chain" for each layout segment
async fn get_module_graph_for_page(
entry: Vc<Box<dyn Module>>,
entry: ResolvedVc<Box<dyn Module>>,
) -> Result<Vec<ResolvedVc<SingleModuleGraph>>> {
let ServerEntries {
server_utils,
server_component_entries,
} = &*find_server_entries(entry).await?;
} = &*find_server_entries(*entry).await?;

let graph = SingleModuleGraph::new_with_entries_visited(
server_utils.clone(),
server_utils.iter().map(|m| **m).collect(),
Vc::cell(Default::default()),
)
.to_resolved()
Expand All @@ -126,11 +126,11 @@ async fn get_module_graph_for_page(
let mut graphs = vec![graph];
for module in server_component_entries
.iter()
.map(|m| Vc::upcast::<Box<dyn Module>>(*m))
.map(|m| ResolvedVc::upcast::<Box<dyn Module>>(*m))
.chain(std::iter::once(entry))
{
let graph = SingleModuleGraph::new_with_entries_visited(
vec![module],
vec![*module],
Vc::cell(visited_modules.clone()),
)
.to_resolved()
Expand Down Expand Up @@ -269,7 +269,7 @@ impl ReducedGraphs {
#[turbo_tasks::function]
pub async fn get_reduced_graphs_for_page(
project: Vc<Project>,
entry: Vc<Box<dyn Module>>,
entry: ResolvedVc<Box<dyn Module>>,
// TODO should this happen globally or per page? Do they all have the same context?
client_asset_context: Vc<Box<dyn AssetContext>>,
) -> Result<Vc<ReducedGraphs>> {
Expand Down
6 changes: 3 additions & 3 deletions crates/next-api/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,9 +684,9 @@ impl Project {
let entrypoints = self.entrypoints().await?;

modules.extend(self.client_main_modules().await?.iter().copied());
add_endpoint(entrypoints.pages_error_endpoint, &mut modules).await?;
add_endpoint(entrypoints.pages_app_endpoint, &mut modules).await?;
add_endpoint(entrypoints.pages_document_endpoint, &mut modules).await?;
add_endpoint(*entrypoints.pages_error_endpoint, &mut modules).await?;
add_endpoint(*entrypoints.pages_app_endpoint, &mut modules).await?;
add_endpoint(*entrypoints.pages_document_endpoint, &mut modules).await?;

if let Some(middleware) = &entrypoints.middleware {
add_endpoint(middleware.endpoint, &mut modules).await?;
Expand Down

0 comments on commit c0a8154

Please sign in to comment.