Skip to content

Commit

Permalink
Remove can_be_in_same_chunk (vercel/turborepo#8029)
Browse files Browse the repository at this point in the history
This is unused.


Closes PACK-2995
  • Loading branch information
wbinnssmith authored Apr 24, 2024
1 parent 417ced8 commit 7d95210
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 43 deletions.
18 changes: 0 additions & 18 deletions crates/turbopack-browser/src/chunking_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,24 +310,6 @@ impl ChunkingContext for BrowserChunkingContext {
Ok(Vc::cell(source_maps))
}

#[turbo_tasks::function]
async fn can_be_in_same_chunk(
&self,
asset_a: Vc<Box<dyn Module>>,
asset_b: Vc<Box<dyn Module>>,
) -> Result<Vc<bool>> {
let parent_dir = asset_a.ident().path().parent().await?;

let path = asset_b.ident().path().await?;
if let Some(rel_path) = parent_dir.get_path_to(&path) {
if !rel_path.starts_with("node_modules/") && !rel_path.contains("/node_modules/") {
return Ok(Vc::cell(true));
}
}

Ok(Vc::cell(false))
}

#[turbo_tasks::function]
async fn asset_path(
&self,
Expand Down
7 changes: 0 additions & 7 deletions crates/turbopack-core/src/chunk/chunking_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::{
chunk::{ChunkItem, ModuleId},
environment::Environment,
ident::AssetIdent,
module::Module,
output::{OutputAsset, OutputAssets},
};

Expand Down Expand Up @@ -62,12 +61,6 @@ pub trait ChunkingContext {
/// Reference Source Map Assets for chunks
fn reference_chunk_source_maps(self: Vc<Self>, chunk: Vc<Box<dyn OutputAsset>>) -> Vc<bool>;

fn can_be_in_same_chunk(
self: Vc<Self>,
asset_a: Vc<Box<dyn Module>>,
asset_b: Vc<Box<dyn Module>>,
) -> Vc<bool>;

/// Returns a URL (relative or absolute, depending on the asset prefix) to
/// the static asset based on its `ident`.
fn asset_url(self: Vc<Self>, ident: Vc<AssetIdent>) -> Result<Vc<String>>;
Expand Down
18 changes: 0 additions & 18 deletions crates/turbopack-nodejs/src/chunking_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,24 +274,6 @@ impl ChunkingContext for NodeJsChunkingContext {
Vc::cell(true)
}

#[turbo_tasks::function]
async fn can_be_in_same_chunk(
&self,
asset_a: Vc<Box<dyn Module>>,
asset_b: Vc<Box<dyn Module>>,
) -> Result<Vc<bool>> {
let parent_dir = asset_a.ident().path().parent().await?;

let path = asset_b.ident().path().await?;
if let Some(rel_path) = parent_dir.get_path_to(&path) {
if !rel_path.starts_with("node_modules/") && !rel_path.contains("/node_modules/") {
return Ok(Vc::cell(true));
}
}

Ok(Vc::cell(false))
}

#[turbo_tasks::function]
async fn asset_path(
&self,
Expand Down

0 comments on commit 7d95210

Please sign in to comment.