Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkirsz committed Feb 28, 2023
1 parent 9ec6422 commit 19f426a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions crates/turbopack-core/src/chunk/list/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ pub(super) async fn update_chunk_list(

let content = content.await?;

// There are two kind of updates nested within a chunk list update:
// * merged updates; and
// * single chunk updates.
// In order to compute merged updates, we first need to group mergeable chunks
// by common mergers. Then, we compute the update of each group separately.
// Single chunk updates are computed separately and only require a stable chunk
// path to identify the chunk across versions.
let mut by_merger = IndexMap::<_, Vec<_>>::new();
let mut by_path = IndexMap::<_, _>::new();

Expand Down
3 changes: 2 additions & 1 deletion crates/turbopack-ecmascript/src/chunk/evaluate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ pub struct EcmascriptChunkEvaluate {
/// All chunks of this chunk group need to be ready for execution to start.
/// When None, it will use a chunk group created from the current chunk.
pub chunk_group: Option<ChunkGroupVc>,
/// The path to the chunk list file.
/// The path to the chunk list asset. This will be used to register the
/// chunk list when this chunk is evaluated.
pub chunk_list_path: Option<FileSystemPathVc>,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ impl ChunkItem for ManifestLoaderItem {
}
.cell()
.into(),
// This creates the chunk list corresponding to the manifest chunk's chunk group.
ChunkListReferenceVc::new(
this.context.output_root(),
this.manifest.chunk_group(),
Expand Down
1 change: 1 addition & 0 deletions crates/turbopack-ecmascript/src/chunk_group_files_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ impl ChunkItem for ChunkGroupFilesChunkItem {
.map(Into::into)
.collect();

// This creates the chunk list corresponding to this chunk group.
references.push(
ChunkListReferenceVc::new(
self.inner.await?.server_root,
Expand Down

0 comments on commit 19f426a

Please sign in to comment.