Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add any_content_changed_of_output_assets #5513

Merged
merged 1 commit into from
Jul 13, 2023
Merged
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
15 changes: 15 additions & 0 deletions crates/turbopack-core/src/changed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use turbo_tasks::{

use crate::{
asset::{Asset, AssetVc},
output::OutputAssetsVc,
reference::all_referenced_assets,
};

Expand Down Expand Up @@ -33,6 +34,20 @@ pub async fn any_content_changed(root: AssetVc) -> Result<CompletionVc> {
Ok(CompletionsVc::cell(completions).completed())
}

/// Returns a completion that changes when any content of any asset in the given
/// output asset graphs changes.
#[turbo_tasks::function]
pub async fn any_content_changed_of_output_assets(roots: OutputAssetsVc) -> Result<CompletionVc> {
Ok(CompletionsVc::cell(
roots
.await?
.iter()
.map(|&a| any_content_changed(a.into()))
.collect(),
)
.completed())
}

/// Returns a completion that changes when the content of the given asset
/// changes.
#[turbo_tasks::function]
Expand Down
Loading