Skip to content

Commit b8df148

Browse files
committed
Turbopack: Use FromScriptSrc chunk suffix to avoid depending on deployment id
1 parent b55c643 commit b8df148

File tree

3 files changed

+1
-19
lines changed

3 files changed

+1
-19
lines changed

crates/next-api/src/project.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,6 @@ impl Project {
11441144
client_root: self.client_relative_path().owned().await?,
11451145
client_root_to_root_path: rcstr!("/ROOT"),
11461146
asset_prefix: self.next_config().computed_asset_prefix(),
1147-
chunk_suffix: self.next_config().chunk_suffix(),
11481147
environment: self.client_compile_time_info().environment(),
11491148
module_id_strategy: self.module_ids(),
11501149
export_usage: self.export_usage(),

crates/next-core/src/next_client/context.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ pub struct ClientChunkingContextOptions {
414414
pub client_root: FileSystemPath,
415415
pub client_root_to_root_path: RcStr,
416416
pub asset_prefix: Vc<RcStr>,
417-
pub chunk_suffix: Vc<ChunkSuffix>,
418417
pub environment: Vc<Environment>,
419418
pub module_id_strategy: Vc<Box<dyn ModuleIdStrategy>>,
420419
pub export_usage: Vc<OptionExportUsageInfo>,
@@ -437,7 +436,6 @@ pub async fn get_client_chunking_context(
437436
client_root,
438437
client_root_to_root_path,
439438
asset_prefix,
440-
chunk_suffix,
441439
environment,
442440
module_id_strategy,
443441
export_usage,
@@ -452,7 +450,6 @@ pub async fn get_client_chunking_context(
452450

453451
let next_mode = mode.await?;
454452
let asset_prefix = asset_prefix.owned().await?;
455-
let chunk_suffix = chunk_suffix.to_resolved().await?;
456453
let mut builder = BrowserChunkingContext::builder(
457454
root_path,
458455
client_root.clone(),
@@ -464,7 +461,7 @@ pub async fn get_client_chunking_context(
464461
next_mode.runtime_type(),
465462
)
466463
.chunk_base_path(Some(asset_prefix.clone()))
467-
.chunk_suffix(chunk_suffix)
464+
.chunk_suffix(ChunkSuffix::FromScriptSrc.resolved_cell())
468465
.minify_type(if *minify.await? {
469466
MinifyType::Minify {
470467
mangle: (!*no_mangling.await?).then_some(MangleType::OptimalSize),

crates/next-core/src/next_config.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use turbopack::module_options::{
1616
ConditionItem, ConditionPath, LoaderRuleItem, WebpackRules,
1717
module_options_context::MdxTransformOptions,
1818
};
19-
use turbopack_browser::ChunkSuffix;
2019
use turbopack_core::{
2120
chunk::SourceMapsType,
2221
issue::{Issue, IssueExt, IssueStage, OptionStyledString, StyledString},
@@ -1674,19 +1673,6 @@ impl NextConfig {
16741673
}
16751674
}
16761675

1677-
/// Returns the suffix to use for chunk loading.
1678-
#[turbo_tasks::function]
1679-
pub async fn chunk_suffix(self: Vc<Self>) -> Result<Vc<ChunkSuffix>> {
1680-
let this = self.await?;
1681-
1682-
match &this.deployment_id {
1683-
Some(deployment_id) => {
1684-
Ok(ChunkSuffix::Constant(format!("?dpl={deployment_id}").into()).cell())
1685-
}
1686-
None => Ok(ChunkSuffix::None.cell()),
1687-
}
1688-
}
1689-
16901676
#[turbo_tasks::function]
16911677
pub fn enable_taint(&self) -> Vc<bool> {
16921678
Vc::cell(self.experimental.taint.unwrap_or(false))

0 commit comments

Comments
 (0)