Skip to content

Commit df6faf4

Browse files
committed
Revert "BrowserChunkingContext::chunk_path only depends on a selected subset of fields"
This reverts commit 96329dd.
1 parent 613c6f6 commit df6faf4

File tree

1 file changed

+5
-27
lines changed

1 file changed

+5
-27
lines changed

turbopack/crates/turbopack-browser/src/chunking_context.rs

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -399,17 +399,6 @@ impl BrowserChunkingContext {
399399
pub fn minify_type(&self) -> Vc<MinifyType> {
400400
self.minify_type.cell()
401401
}
402-
403-
/// Returns the minify type.
404-
#[turbo_tasks::function]
405-
fn chunk_path_info(&self) -> Vc<ChunkPathInfo> {
406-
ChunkPathInfo {
407-
root_path: self.root_path.clone(),
408-
chunk_root_path: self.chunk_root_path.clone(),
409-
content_hashing: self.content_hashing,
410-
}
411-
.cell()
412-
}
413402
}
414403

415404
#[turbo_tasks::value_impl]
@@ -450,7 +439,7 @@ impl ChunkingContext for BrowserChunkingContext {
450439

451440
#[turbo_tasks::function]
452441
async fn chunk_path(
453-
self: Vc<Self>,
442+
&self,
454443
asset: Option<Vc<Box<dyn Asset>>>,
455444
ident: Vc<AssetIdent>,
456445
prefix: Option<RcStr>,
@@ -460,15 +449,11 @@ impl ChunkingContext for BrowserChunkingContext {
460449
extension.starts_with("."),
461450
"`extension` should include the leading '.', got '{extension}'"
462451
);
463-
let ChunkPathInfo {
464-
chunk_root_path,
465-
content_hashing,
466-
root_path,
467-
} = &*self.chunk_path_info().await?;
468-
let name = match *content_hashing {
452+
let root_path = self.chunk_root_path.clone();
453+
let name = match self.content_hashing {
469454
None => {
470455
ident
471-
.output_name(root_path.clone(), prefix, extension)
456+
.output_name(self.root_path.clone(), prefix, extension)
472457
.owned()
473458
.await?
474459
}
@@ -493,7 +478,7 @@ impl ChunkingContext for BrowserChunkingContext {
493478
}
494479
}
495480
};
496-
Ok(chunk_root_path.join(&name)?.cell())
481+
Ok(root_path.join(&name)?.cell())
497482
}
498483

499484
#[turbo_tasks::function]
@@ -813,10 +798,3 @@ impl ChunkingContext for BrowserChunkingContext {
813798
Ok(Vc::cell(self.await?.debug_ids))
814799
}
815800
}
816-
817-
#[turbo_tasks::value]
818-
struct ChunkPathInfo {
819-
root_path: FileSystemPath,
820-
chunk_root_path: FileSystemPath,
821-
content_hashing: Option<ContentHashing>,
822-
}

0 commit comments

Comments
 (0)