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
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 @@ -50,7 +50,7 @@ pub struct NextDynamicGraphs(Vec<ResolvedVc<NextDynamicGraph>>);

#[turbo_tasks::value_impl]
impl NextDynamicGraphs {
#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
async fn new_operation(
graphs: ResolvedVc<ModuleGraph>,
is_single_page: bool,
Expand All @@ -71,7 +71,7 @@ impl NextDynamicGraphs {
Ok(Self(next_dynamic).cell())
}

#[turbo_tasks::function]
#[turbo_tasks::function(root)]
pub async fn new(graphs: ResolvedVc<ModuleGraph>, is_single_page: bool) -> Result<Vc<Self>> {
// TODO get rid of this function once everything inside of
// `get_global_information_for_endpoint_inner` calls `take_collectibles()` when needed
Expand Down Expand Up @@ -248,7 +248,7 @@ pub struct ServerActionsGraphs(Vec<ResolvedVc<ServerActionsGraph>>);

#[turbo_tasks::value_impl]
impl ServerActionsGraphs {
#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
async fn new_operation(
graphs: ResolvedVc<ModuleGraph>,
is_single_page: bool,
Expand All @@ -269,7 +269,7 @@ impl ServerActionsGraphs {
Ok(Self(server_actions).cell())
}

#[turbo_tasks::function]
#[turbo_tasks::function(root)]
pub async fn new(graphs: ResolvedVc<ModuleGraph>, is_single_page: bool) -> Result<Vc<Self>> {
// TODO get rid of this function once everything inside of
// `get_global_information_for_endpoint_inner` calls `take_collectibles()` when needed
Expand Down Expand Up @@ -426,7 +426,7 @@ pub struct ClientReferencesGraphs(Vec<ResolvedVc<ClientReferencesGraph>>);

#[turbo_tasks::value_impl]
impl ClientReferencesGraphs {
#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
async fn new_operation(
graphs: ResolvedVc<ModuleGraph>,
is_single_page: bool,
Expand All @@ -447,7 +447,7 @@ impl ClientReferencesGraphs {
Ok(Self(client_references).cell())
}

#[turbo_tasks::function]
#[turbo_tasks::function(root)]
pub async fn new(graphs: ResolvedVc<ModuleGraph>, is_single_page: bool) -> Result<Vc<Self>> {
// TODO get rid of this function once everything inside of
// `get_global_information_for_endpoint_inner` calls `take_collectibles()` when needed
Expand Down
6 changes: 3 additions & 3 deletions crates/next-api/src/operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub struct EntrypointsOperation {

/// Removes 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)]
#[turbo_tasks::function(operation, root)]
async fn entrypoints_without_collectibles_operation(
entrypoints: OperationVc<Entrypoints>,
) -> Result<Vc<Entrypoints>> {
Expand All @@ -45,7 +45,7 @@ async fn entrypoints_without_collectibles_operation(

#[turbo_tasks::value_impl]
impl EntrypointsOperation {
#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
pub async fn new(entrypoints: OperationVc<Entrypoints>) -> Result<Vc<Self>> {
let e = entrypoints.connect().await?;
let entrypoints = entrypoints_without_collectibles_operation(entrypoints);
Expand Down Expand Up @@ -143,7 +143,7 @@ pub struct OptionEndpoint(Option<ResolvedVc<Box<dyn Endpoint>>>);
/// Given a selector and the `Entrypoints` operation that it comes from, connect the operation and
/// return an `OperationVc` containing the selected value. The returned operation will keep the
/// entire `Entrypoints` operation alive.
#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
async fn pick_endpoint(
op: OperationVc<Entrypoints>,
selector: EndpointSelector,
Expand Down
18 changes: 9 additions & 9 deletions crates/next-api/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ pub struct ProjectContainer {

#[turbo_tasks::value_impl]
impl ProjectContainer {
#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
pub fn new_operation(name: RcStr, dev: bool) -> Result<Vc<Self>> {
Ok(ProjectContainer {
name,
Expand All @@ -481,17 +481,17 @@ impl ProjectContainer {
}
}

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
fn project_operation(project: ResolvedVc<ProjectContainer>) -> Vc<Project> {
project.project()
}

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
fn project_fs_operation(project: ResolvedVc<Project>) -> Vc<DiskFileSystem> {
project.project_fs()
}

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
fn output_fs_operation(project: ResolvedVc<Project>) -> Vc<DiskFileSystem> {
project.project_fs()
}
Expand Down Expand Up @@ -606,7 +606,7 @@ impl ProjectContainer {
}
this.options_state.set(Some(options));

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
fn project_from_container_operation(
container: OperationVc<ProjectContainer>,
) -> Vc<Project> {
Expand Down Expand Up @@ -654,7 +654,7 @@ impl ProjectContainer {
// to upgrade the `ResolvedVc` to an `OperationVc`. This is mostly okay
// because we can assume the `ProjectContainer` was originally resolved with
// strong consistency, and is rarely updated.
#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
fn project_container_operation_hack(
container: ResolvedVc<ProjectContainer>,
) -> Vc<ProjectContainer> {
Expand Down Expand Up @@ -1508,7 +1508,7 @@ impl Project {

/// Computes the whole app module graph, dropping issues in development mode so that
/// individual routes don't each report every issue from the shared graph.
#[turbo_tasks::function]
#[turbo_tasks::function(root)]
pub async fn whole_app_module_graphs(
self: ResolvedVc<Self>,
) -> Result<Vc<BaseAndFullModuleGraph>> {
Expand Down Expand Up @@ -2408,7 +2408,7 @@ impl Project {
// sessions.
let _ = session;

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
async fn hmr_version_operation(
this: ResolvedVc<Project>,
chunk_name: RcStr,
Expand Down Expand Up @@ -2726,7 +2726,7 @@ async fn any_output_changed(
Ok(Vc::<Completions>::cell(completions).completed())
}

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
fn all_assets_from_entries_operation(
operation: OperationVc<OutputAssets>,
) -> Result<Vc<ExpandedOutputAssets>> {
Expand Down
2 changes: 1 addition & 1 deletion crates/next-api/src/project_asset_hashes_manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ pub async fn expand_outputs(

#[turbo_tasks::value_impl]
impl Asset for AssetHashesManifestAsset {
#[turbo_tasks::function(root)]
#[turbo_tasks::function]
async fn content(&self) -> Result<Vc<AssetContent>> {
let output_assets = expand_outputs(*self.project, self.asset_root.clone()).await?;

Expand Down
6 changes: 3 additions & 3 deletions crates/next-api/src/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ async fn endpoint_output_assets_operation(
Ok(*output.connect().await?.output_assets)
}

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
pub async fn endpoint_write_to_disk_operation(
endpoint: OperationVc<OptionEndpoint>,
) -> Result<Vc<EndpointOutputPaths>> {
Expand All @@ -231,7 +231,7 @@ pub async fn endpoint_write_to_disk_operation(
})
}

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
pub async fn endpoint_server_changed_operation(
endpoint: OperationVc<OptionEndpoint>,
) -> Result<Vc<Completion>> {
Expand All @@ -242,7 +242,7 @@ pub async fn endpoint_server_changed_operation(
})
}

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
pub async fn endpoint_client_changed_operation(
endpoint: OperationVc<OptionEndpoint>,
) -> Result<Vc<Completion>> {
Expand Down
4 changes: 2 additions & 2 deletions crates/next-api/src/versioned_content_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ type GetEntriesResultT = Vec<(FileSystemPath, ResolvedVc<Box<dyn OutputAsset>>)>
#[turbo_tasks::value(transparent)]
struct GetEntriesResult(GetEntriesResultT);

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
async fn get_entries(assets: OperationVc<ExpandedOutputAssets>) -> Result<Vc<GetEntriesResult>> {
let assets_ref = assets.connect().await?;
let entries = assets_ref
Expand All @@ -281,7 +281,7 @@ async fn get_entries(assets: OperationVc<ExpandedOutputAssets>) -> Result<Vc<Get
Ok(Vc::cell(entries))
}

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
fn compute_entry_operation(
map: ResolvedVc<VersionedContentMap>,
assets_operation: OperationVc<ExpandedOutputAssets>,
Expand Down
8 changes: 4 additions & 4 deletions crates/next-build-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub async fn main_inner(

tracing::info!("collecting endpoints");

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
fn project_entrypoints_operation(project: ResolvedVc<ProjectContainer>) -> Vc<Entrypoints> {
project.entrypoints()
}
Expand Down Expand Up @@ -248,7 +248,7 @@ pub async fn render_routes(
async fn endpoint_write_to_disk_with_apply(
endpoint: ResolvedVc<Box<dyn Endpoint>>,
) -> Result<ReadRef<EndpointOutputPaths>> {
#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
fn inner_operation(endpoint: ResolvedVc<Box<dyn Endpoint>>) -> Vc<EndpointOutputPaths> {
// we must wrap this in an operation so we can get the Effects collectibles
endpoint_write_to_disk(*endpoint)
Expand All @@ -260,7 +260,7 @@ async fn endpoint_write_to_disk_with_apply(
effects: Effects,
}

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
pub async fn inner_operation_with_effects(
endpoint: ResolvedVc<Box<dyn Endpoint>>,
) -> Result<Vc<WithEffects>> {
Expand Down Expand Up @@ -291,7 +291,7 @@ async fn hmr(
tracing::info!("HMR...");
let session = TransientInstance::new(());

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
fn project_hmr_chunk_names_operation(project: ResolvedVc<ProjectContainer>) -> Vc<Vec<RcStr>> {
project.hmr_chunk_names(HmrTarget::Client)
}
Expand Down
4 changes: 2 additions & 2 deletions crates/next-napi-bindings/src/next_api/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub struct WriteAnalyzeResult {
pub effects: Arc<Effects>,
}

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
pub async fn write_analyze_data_with_issues_operation(
project: ResolvedVc<ProjectContainer>,
app_dir_only: bool,
Expand All @@ -34,7 +34,7 @@ pub async fn write_analyze_data_with_issues_operation(
Ok(WriteAnalyzeResult { issues, effects }.cell())
}

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
async fn write_analyze_data_with_issues_operation_inner(
project: ResolvedVc<ProjectContainer>,
app_dir_only: bool,
Expand Down
4 changes: 2 additions & 2 deletions crates/next-napi-bindings/src/next_api/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ struct WrittenEndpointWithIssues {
effects: Arc<Effects>,
}

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
async fn get_written_endpoint_with_issues_operation(
endpoint_op: OperationVc<OptionEndpoint>,
) -> Result<Vc<WrittenEndpointWithIssues>> {
Expand Down Expand Up @@ -222,7 +222,7 @@ impl PartialEq for EndpointIssuesAndDiags {

impl Eq for EndpointIssuesAndDiags {}

#[turbo_tasks::function(operation)]
#[turbo_tasks::function(operation, root)]
async fn subscribe_issues_and_diags_operation(
endpoint_op: OperationVc<OptionEndpoint>,
should_include_issues: bool,
Expand Down
Loading
Loading