Skip to content

Commit 0eb2deb

Browse files
committed
add comment
1 parent e1c6bc9 commit 0eb2deb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

turbopack/crates/turbopack-core/src/output.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,13 @@ pub struct OutputAssetsSet(FxIndexSet<ResolvedVc<Box<dyn OutputAsset>>>);
112112
#[turbo_tasks::value(shared)]
113113
#[derive(Clone)]
114114
pub struct OutputAssetsWithReferenced {
115+
/// Primary output assets. These are e. g. the chunks needed for a chunk group.
115116
pub assets: ResolvedVc<OutputAssets>,
117+
/// Secondary output assets that are referenced by the primary assets.
116118
pub referenced_assets: ResolvedVc<OutputAssets>,
119+
/// Secondary output assets that are referenced by the primary assets. These are unresolved
120+
/// `OutputAssetsReference`s and need to be expanded to get the actual assets. These are e. g.
121+
/// async loaders that reference other chunk groups.
117122
pub references: ResolvedVc<OutputAssetsReferences>,
118123
}
119124

@@ -187,11 +192,15 @@ impl OutputAssetsWithReferenced {
187192
Ok(Vc::cell(self.expand_assets(false).await?))
188193
}
189194

195+
/// Returns only primary asset entries. Doesn't expand OutputAssets. Doesn't return referenced
196+
/// assets.
190197
#[turbo_tasks::function]
191198
pub fn assets(&self) -> Vc<OutputAssets> {
192199
*self.assets
193200
}
194201

202+
/// Returns only secondary referenced asset entries. Doesn't expand OutputAssets. Doesn't return
203+
/// primary assets.
195204
#[turbo_tasks::function]
196205
pub async fn referenced_assets(&self) -> Result<Vc<OutputAssets>> {
197206
Ok(Vc::cell(

0 commit comments

Comments
 (0)