Skip to content

Commit

Permalink
Updates to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bgw committed Dec 20, 2024
1 parent 2768f83 commit c6fe120
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 0 additions & 1 deletion crates/next-api/src/versioned_content_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ use turbopack_core::{
NonLocalValue,
)]
struct MapEntry {
// must not be resolved
assets_operation: OperationVc<OutputAssets>,
/// Precomputed map for quick access to output asset by filepath
path_to_asset: HashMap<ResolvedVc<FileSystemPath>, ResolvedVc<Box<dyn OutputAsset>>>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ pub(super) struct EcmascriptDevChunkListVersion {
#[turbo_tasks(trace_ignore)]
pub by_path: FxIndexMap<String, VersionTraitRef>,
/// A map from chunk merger to the version of the merged contents of chunks.
//
// TODO: This trace_ignore is *very* wrong, and could cause problems if/when we add a GC!
// Version is also expected not to contain `Vc`/`ResolvedVc`/`OperationVc`, and
// `turbopack_core::version::TotalUpdate` assumes it doesn't.
#[turbo_tasks(trace_ignore)]
pub by_merger: FxIndexMap<ResolvedVc<Box<dyn VersionedContentMerger>>, VersionTraitRef>,
}
Expand Down
11 changes: 8 additions & 3 deletions turbopack/crates/turbopack-core/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ impl VersionedContentExt for AssetContent {
}
}

/// Describes the current version of an object, and how to update them from an
/// earlier version.
/// Describes the current version of an object, and how to update them from an earlier version.
///
/// **Important:** Implementations must not contain instances of [`Vc`]! This should describe a
/// specific version, and the value of a [`Vc`] can change due to invalidations or cache eviction.
#[turbo_tasks::value_trait]
pub trait Version {
/// Get a unique identifier of the version as a string. There is no way
Expand Down Expand Up @@ -191,7 +193,10 @@ pub enum Update {
#[derive(PartialEq, Eq, Debug, Clone, TraceRawVcs, ValueDebugFormat, NonLocalValue)]
pub struct TotalUpdate {
/// The version this update will bring the object to.
// TODO: This trace_ignore is *very* wrong, and could cause problems if/when we add a GC
//
// TODO: This trace_ignore is wrong, and could cause problems if/when we add a GC. While
// `Version` assumes the implementation does not contain `Vc`, `EcmascriptDevChunkListVersion`
// is broken and violates this assumption.
#[turbo_tasks(trace_ignore)]
pub to: TraitRef<Box<dyn Version>>,
}
Expand Down

0 comments on commit c6fe120

Please sign in to comment.