Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbopack: Chunking Refactoring #56756

Merged
merged 34 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d303183
link
sokra Oct 9, 2023
ad323da
WIP
sokra Oct 9, 2023
7e662ea
Merge remote-tracking branch 'origin/canary' into jrl-chunking-refact…
sokra Oct 10, 2023
f500f01
update snapshots
sokra Oct 10, 2023
4c9a885
remove isolated parallel
sokra Oct 10, 2023
bfa49ec
link
sokra Oct 10, 2023
f92b978
link
sokra Oct 10, 2023
0219a40
Merge branch 'canary' into jrl-chunking-refactor-4
sokra Oct 10, 2023
2f3717d
make test more specific
sokra Oct 10, 2023
851dbd9
Merge branch 'jrl-chunking-refactor-4' into jrl-chunking-refactor-5
sokra Oct 10, 2023
45d4a91
Update link
jridgewell Oct 11, 2023
3a5057d
Merge branch 'canary' into jrl-chunking-refactor-5
sokra Oct 11, 2023
ab72f03
Merge branch 'canary' into jrl-chunking-refactor-4
sokra Oct 11, 2023
2748c75
Merge branch 'jrl-chunking-refactor-4' into jrl-chunking-refactor-5
sokra Oct 11, 2023
d86cc56
link
sokra Oct 11, 2023
ca930e2
fixup lockfile
sokra Oct 11, 2023
266ad26
link
sokra Oct 11, 2023
8f1b99d
Merge branch 'jrl-chunking-refactor-4' into jrl-chunking-refactor-5
sokra Oct 11, 2023
6187802
link
sokra Oct 11, 2023
0b9ecd3
fix externals test case
sokra Oct 11, 2023
c882c10
link
sokra Oct 11, 2023
9fa4496
link
sokra Oct 11, 2023
73ce3a6
link
sokra Oct 11, 2023
c2548d9
Merge branch 'canary' into jrl-chunking-refactor-6
sokra Oct 11, 2023
7147de3
link
sokra Oct 12, 2023
8c24518
remove chunk_group_root, remove AsynModule::is_async
sokra Oct 12, 2023
6ddb127
link
sokra Oct 12, 2023
33a8aaf
Merge branch 'canary' into jrl-chunking-refactor-7
sokra Oct 12, 2023
eb26eb9
add tracing to next-core
sokra Oct 13, 2023
f6d7309
Merge remote-tracking branch 'origin/canary' into jrl-chunking-refact…
sokra Oct 13, 2023
120c792
link
sokra Oct 13, 2023
64c8ca0
exclude flaky test
sokra Oct 13, 2023
8e0726c
Merge branch 'canary' into jrl-chunking-refactor-7
sokra Oct 13, 2023
0e7edd3
update turbopack
sokra Oct 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 35 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ swc_core = { version = "0.83.28", features = [
testing = { version = "0.34.1" }

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

# General Deps

Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/crates/next-api/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ impl AppEndpoint {
.app_project
.project()
.rsc_chunking_context()
.entry_chunk(
.entry_chunk_group(
server_path.join(format!(
"app{original_name}.js",
original_name = app_entry.original_name
Expand Down
7 changes: 5 additions & 2 deletions packages/next-swc/crates/next-api/src/pages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,11 @@ impl PageEndpoint {

let ssr_entry_chunk_path_string = format!("pages{asset_path}");
let ssr_entry_chunk_path = node_path.join(ssr_entry_chunk_path_string);
let ssr_entry_chunk =
chunking_context.entry_chunk(ssr_entry_chunk_path, ssr_module, runtime_entries);
let ssr_entry_chunk = chunking_context.entry_chunk_group(
ssr_entry_chunk_path,
ssr_module,
runtime_entries,
);

Ok(SsrChunk::NodeJs {
entry: ssr_entry_chunk,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ pub async fn compute_app_entries_chunks(
.entry(Vc::upcast(app_entry.rsc_entry))
.await?;

let rsc_chunk = rsc_chunking_context.entry_chunk(
let rsc_chunk = rsc_chunking_context.entry_chunk_group(
node_root.join(format!(
"server/app/{original_name}.js",
original_name = app_entry.original_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ pub async fn compute_page_entries_chunks(
let pathname = page_entry.pathname.await?;
let asset_path: String = get_asset_path_from_pathname(&pathname, ".js");

let ssr_entry_chunk = ssr_chunking_context.entry_chunk(
let ssr_entry_chunk = ssr_chunking_context.entry_chunk_group(
node_root.join(format!("server/pages/{asset_path}")),
Vc::upcast(page_entry.ssr_module),
page_entries.ssr_runtime_entries,
Expand Down
1 change: 1 addition & 0 deletions packages/next-swc/crates/next-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ allsorts = { workspace = true }
futures = { workspace = true }
lazy_static = { workspace = true }
thiserror = { workspace = true }
tracing = { workspace = true }
turbopack-binding = { workspace = true, features = [
"__swc_transform_modularize_imports",
"__swc_transform_relay",
Expand Down
1 change: 0 additions & 1 deletion packages/next-swc/crates/next-core/src/loader_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ impl LoaderTreeBuilder {
)?;
self.imports.push(formatdoc!(
r#"
("TURBOPACK {{ chunking-type: isolatedParallel }}");
import {}, {{ chunks as {} }} from "COMPONENT_{}";
"#,
identifier,
Expand Down
Loading
Loading