Skip to content

Commit 04bad16

Browse files
sokrajridgewell
andauthored
Turbopack: Chunking Refactoring (#56756)
### What? see vercel/turborepo#6160 ### Turbopack Changes * vercel/turborepo#6116 * vercel/turborepo#6140 * vercel/turborepo#6118 * vercel/turborepo#6128 * vercel/turborepo#6129 * vercel/turborepo#6160 Closes WEB-1772 Co-authored-by: Justin Ridgewell <[email protected]>
1 parent e8a92a9 commit 04bad16

File tree

20 files changed

+91
-89
lines changed

20 files changed

+91
-89
lines changed

Cargo.lock

Lines changed: 35 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ swc_core = { version = "0.83.28", features = [
4040
testing = { version = "0.34.1" }
4141

4242
# Turbo crates
43-
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231006.4" }
43+
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231013.2" }
4444
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
45-
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231006.4" }
45+
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231013.2" }
4646
# [TODO]: need to refactor embed_directory! macro usage in next-core
47-
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231006.4" }
47+
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231013.2" }
4848

4949
# General Deps
5050

packages/next-swc/crates/next-api/src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ impl AppEndpoint {
834834
.app_project
835835
.project()
836836
.rsc_chunking_context()
837-
.entry_chunk(
837+
.entry_chunk_group(
838838
server_path.join(format!(
839839
"app{original_name}.js",
840840
original_name = app_entry.original_name

packages/next-swc/crates/next-api/src/pages.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,8 +629,11 @@ impl PageEndpoint {
629629

630630
let ssr_entry_chunk_path_string = format!("pages{asset_path}");
631631
let ssr_entry_chunk_path = node_path.join(ssr_entry_chunk_path_string);
632-
let ssr_entry_chunk =
633-
chunking_context.entry_chunk(ssr_entry_chunk_path, ssr_module, runtime_entries);
632+
let ssr_entry_chunk = chunking_context.entry_chunk_group(
633+
ssr_entry_chunk_path,
634+
ssr_module,
635+
runtime_entries,
636+
);
634637

635638
Ok(SsrChunk::NodeJs {
636639
entry: ssr_entry_chunk,

packages/next-swc/crates/next-build/src/next_app/app_entries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ pub async fn compute_app_entries_chunks(
291291
.entry(Vc::upcast(app_entry.rsc_entry))
292292
.await?;
293293

294-
let rsc_chunk = rsc_chunking_context.entry_chunk(
294+
let rsc_chunk = rsc_chunking_context.entry_chunk_group(
295295
node_root.join(format!(
296296
"server/app/{original_name}.js",
297297
original_name = app_entry.original_name

packages/next-swc/crates/next-build/src/next_pages/page_entries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ pub async fn compute_page_entries_chunks(
387387
let pathname = page_entry.pathname.await?;
388388
let asset_path: String = get_asset_path_from_pathname(&pathname, ".js");
389389

390-
let ssr_entry_chunk = ssr_chunking_context.entry_chunk(
390+
let ssr_entry_chunk = ssr_chunking_context.entry_chunk_group(
391391
node_root.join(format!("server/pages/{asset_path}")),
392392
Vc::upcast(page_entry.ssr_module),
393393
page_entries.ssr_runtime_entries,

packages/next-swc/crates/next-core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ allsorts = { workspace = true }
2929
futures = { workspace = true }
3030
lazy_static = { workspace = true }
3131
thiserror = { workspace = true }
32+
tracing = { workspace = true }
3233
turbopack-binding = { workspace = true, features = [
3334
"__swc_transform_modularize_imports",
3435
"__swc_transform_relay",

packages/next-swc/crates/next-core/src/loader_tree.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ impl LoaderTreeBuilder {
116116
)?;
117117
self.imports.push(formatdoc!(
118118
r#"
119-
("TURBOPACK {{ chunking-type: isolatedParallel }}");
120119
import {}, {{ chunks as {} }} from "COMPONENT_{}";
121120
"#,
122121
identifier,

0 commit comments

Comments
 (0)