Skip to content

Commit

Permalink
Merge branch 'canary' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
dianacpg committed Oct 13, 2023
2 parents 6cb5bb5 + a40a350 commit 276dfee
Show file tree
Hide file tree
Showing 24 changed files with 151 additions and 178 deletions.
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
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.3" }
# [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.3" }
# [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.3" }

# General Deps

Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/crates/next-api/src/app.rs
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
11 changes: 6 additions & 5 deletions packages/next-swc/crates/next-api/src/pages.rs
Expand Up @@ -563,11 +563,9 @@ impl PageEndpoint {

client_chunks.push(Vc::upcast(PageLoaderAsset::new(
this.pages_project.project().client_root(),
client_module_context,
Vc::upcast(client_chunking_context),
self.source(),
this.pathname,
self.client_relative_path(),
Vc::cell(client_chunks.clone()),
)));

Ok(Vc::cell(client_chunks))
Expand Down Expand Up @@ -629,8 +627,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
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
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
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
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

0 comments on commit 276dfee

Please sign in to comment.