Skip to content

Commit a40a350

Browse files
authored
Chunking Refactoring followup fixes (#56789)
### What? fix some minor bugs Make the page-loader reuse the client chunks Closes WEB-1777
1 parent 04bad16 commit a40a350

File tree

9 files changed

+102
-131
lines changed

9 files changed

+102
-131
lines changed

Cargo.lock

Lines changed: 33 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-231013.2" }
43+
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231013.3" }
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-231013.2" }
45+
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231013.3" }
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-231013.2" }
47+
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231013.3" }
4848

4949
# General Deps
5050

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,9 @@ impl PageEndpoint {
563563

564564
client_chunks.push(Vc::upcast(PageLoaderAsset::new(
565565
this.pages_project.project().client_root(),
566-
client_module_context,
567-
Vc::upcast(client_chunking_context),
568-
self.source(),
569566
this.pathname,
570567
self.client_relative_path(),
568+
Vc::cell(client_chunks.clone()),
571569
)));
572570

573571
Ok(Vc::cell(client_chunks))

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -737,14 +737,6 @@ async fn insert_next_server_special_aliases(
737737
},
738738
),
739739
);
740-
import_map.insert_exact_alias(
741-
"server-only",
742-
request_to_import_mapping(app_dir, "next/dist/compiled/server-only"),
743-
);
744-
import_map.insert_exact_alias(
745-
"client-only",
746-
request_to_import_mapping(app_dir, "next/dist/compiled/client-only"),
747-
);
748740
import_map.insert_exact_alias(
749741
"react",
750742
request_to_import_mapping(
@@ -841,9 +833,9 @@ async fn insert_next_server_special_aliases(
841833
project_path,
842834
indexmap! {
843835
"server-only" => "next/dist/compiled/server-only/empty".to_string(),
844-
"client-only" => "next/dist/compiled/client-only/error".to_string(),
836+
"client-only" => "next/dist/compiled/client-only/index".to_string(),
845837
"next/dist/compiled/server-only" => "next/dist/compiled/server-only/empty".to_string(),
846-
"next/dist/compiled/client-only" => "next/dist/compiled/client-only/error".to_string(),
838+
"next/dist/compiled/client-only" => "next/dist/compiled/client-only/index".to_string(),
847839
},
848840
);
849841

0 commit comments

Comments
 (0)