Skip to content

Commit

Permalink
Chunking Refactoring followup fixes (#56789)
Browse files Browse the repository at this point in the history
### What?

fix some minor bugs
Make the page-loader reuse the client chunks

Closes WEB-1777
  • Loading branch information
sokra committed Oct 13, 2023
1 parent 04bad16 commit a40a350
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 131 deletions.
66 changes: 33 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-231013.2" }
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-231013.2" }
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-231013.2" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231013.3" }

# General Deps

Expand Down
4 changes: 1 addition & 3 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
12 changes: 2 additions & 10 deletions packages/next-swc/crates/next-core/src/next_import_map.rs
Expand Up @@ -737,14 +737,6 @@ async fn insert_next_server_special_aliases(
},
),
);
import_map.insert_exact_alias(
"server-only",
request_to_import_mapping(app_dir, "next/dist/compiled/server-only"),
);
import_map.insert_exact_alias(
"client-only",
request_to_import_mapping(app_dir, "next/dist/compiled/client-only"),
);
import_map.insert_exact_alias(
"react",
request_to_import_mapping(
Expand Down Expand Up @@ -841,9 +833,9 @@ async fn insert_next_server_special_aliases(
project_path,
indexmap! {
"server-only" => "next/dist/compiled/server-only/empty".to_string(),
"client-only" => "next/dist/compiled/client-only/error".to_string(),
"client-only" => "next/dist/compiled/client-only/index".to_string(),
"next/dist/compiled/server-only" => "next/dist/compiled/server-only/empty".to_string(),
"next/dist/compiled/client-only" => "next/dist/compiled/client-only/error".to_string(),
"next/dist/compiled/client-only" => "next/dist/compiled/client-only/index".to_string(),
},
);

Expand Down

0 comments on commit a40a350

Please sign in to comment.