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: switch to a single client components entrypoint #59352

Merged
merged 6 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 34 additions & 34 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 @@ -43,11 +43,11 @@ swc_core = { version = "0.86.81", features = [
testing = { version = "0.35.11" }

# Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231206.4" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231207.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-231206.4" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231207.2" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231206.4" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231207.2" }

# General Deps

Expand Down
15 changes: 8 additions & 7 deletions packages/next-swc/crates/next-api/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ impl AppEndpoint {
};

let client_references_chunks = get_app_client_references_chunks(
app_entry.rsc_entry.ident(),
client_reference_types,
this.app_project.project().client_chunking_context(),
ssr_chunking_context,
Expand All @@ -637,7 +638,7 @@ impl AppEndpoint {
for client_reference in app_entry_client_references.iter() {
let client_reference_chunks = client_references_chunks_ref
.get(client_reference.ty())
.expect("client reference should have corresponding chunks");
.context("client reference should have corresponding chunks")?;
entry_client_chunks
.extend(client_reference_chunks.client_chunks.await?.iter().copied());
entry_ssr_chunks.extend(client_reference_chunks.ssr_chunks.await?.iter().copied());
Expand All @@ -651,15 +652,15 @@ impl AppEndpoint {
.map(|chunk| chunk.ident().path())
.try_join()
.await?;
let mut entry_client_chunks_paths: Vec<_> = entry_client_chunks_paths
let mut entry_client_chunks_paths = entry_client_chunks_paths
.iter()
.map(|path| {
client_relative_path_ref
Ok(client_relative_path_ref
.get_path_to(path)
.expect("asset path should be inside client root")
.to_string()
.context("asset path should be inside client root")?
.to_string())
})
.collect();
.collect::<anyhow::Result<Vec<_>>>()?;
entry_client_chunks_paths.extend(client_shared_chunks_paths.iter().cloned());

let app_build_manifest = AppBuildManifest {
Expand Down Expand Up @@ -997,7 +998,7 @@ impl AppEndpoint {
server_path
.await?
.get_path_to(&*rsc_chunk.ident().path().await?)
.expect("RSC chunk path should be within app paths manifest directory")
.context("RSC chunk path should be within app paths manifest directory")?
.to_string(),
)?;
server_assets.push(app_paths_manifest_output);
Expand Down
2 changes: 2 additions & 0 deletions packages/next-swc/crates/next-build/src/next_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use turbopack_binding::{
core::{
asset::Asset,
environment::ServerAddr,
ident::AssetIdent,
issue::{handle_issues, IssueReporter, IssueSeverity},
output::{OutputAsset, OutputAssets},
virtual_fs::VirtualFileSystem,
Expand Down Expand Up @@ -309,6 +310,7 @@ pub(crate) async fn next_build(options: TransientInstance<BuildOptions>) -> Resu
// APP CLIENT REFERENCES CHUNKING

let app_client_references_chunks = get_app_client_references_chunks(
AssetIdent::from_path(project_root.join("next-client-components.js".to_string())),
app_client_reference_tys,
client_chunking_context,
// TODO(WEB-1824): add edge support
Expand Down
Loading