Skip to content

Commit

Permalink
Also capture issues and effects
Browse files Browse the repository at this point in the history
  • Loading branch information
bgw committed Jan 15, 2025
1 parent a093670 commit dd3eb93
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions crates/next-api/src/operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ use indexmap::IndexMap;
use serde::{Deserialize, Serialize};
use turbo_rcstr::RcStr;
use turbo_tasks::{
debug::ValueDebugFormat, trace::TraceRawVcs, CollectiblesSource, NonLocalValue, OperationVc,
ResolvedVc, Vc,
debug::ValueDebugFormat, get_effects, trace::TraceRawVcs, CollectiblesSource, NonLocalValue,
OperationVc, ResolvedVc, Vc,
};
use turbopack_core::diagnostics::Diagnostic;
use turbopack_core::{diagnostics::Diagnostic, issue::IssueDescriptionExt};

use crate::{
entrypoints::Entrypoints,
Expand Down Expand Up @@ -41,23 +41,25 @@ fn entrypoints_wrapper(entrypoints: OperationVc<Entrypoints>) -> Vc<Entrypoints>
entrypoints.connect()
}

/// Removes diagnostics from the top-level `entrypoints` operation so that they're not duplicated
/// across many different individual.
/// Removes diagnostics, issues, and effects from the top-level `entrypoints` operation so that
/// they're not duplicated across many different individual entrypoints or routes.
#[turbo_tasks::function(operation)]
fn entrypoints_without_diagnostics_operation(
async fn entrypoints_without_collectibles_operation(
entrypoints: OperationVc<Entrypoints>,
) -> Vc<Entrypoints> {
) -> Result<Vc<Entrypoints>> {
let entrypoints = entrypoints_wrapper(entrypoints);
let _ = entrypoints.take_collectibles::<Box<dyn Diagnostic>>();
entrypoints.connect()
let _ = entrypoints.take_issues_with_path().await?;
let _ = get_effects(entrypoints);

Check failure on line 53 in crates/next-api/src/operation.rs

View workflow job for this annotation

GitHub Actions / rust check / build

non-binding `let` on a future
Ok(entrypoints.connect())
}

#[turbo_tasks::value_impl]
impl EntrypointsOperation {
#[turbo_tasks::function(operation)]
pub async fn new(entrypoints: OperationVc<Entrypoints>) -> Result<Vc<Self>> {
let e = entrypoints.connect().await?;
let entrypoints = entrypoints_without_diagnostics_operation(entrypoints);
let entrypoints = entrypoints_without_collectibles_operation(entrypoints);
Ok(Self {
routes: e
.routes
Expand Down

0 comments on commit dd3eb93

Please sign in to comment.