diff --git a/Cargo.lock b/Cargo.lock index 3d53cbbd0059b..2954ce852af6a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -412,7 +412,7 @@ dependencies = [ [[package]] name = "auto-hash-map" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "serde", ] @@ -772,6 +772,9 @@ name = "cc" version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +dependencies = [ + "jobserver", +] [[package]] name = "cesu8" @@ -2511,6 +2514,7 @@ dependencies = [ "num-rational", "num-traits", "png", + "webp", ] [[package]] @@ -2700,6 +2704,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +[[package]] +name = "jobserver" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +dependencies = [ + "libc", +] + [[package]] name = "jpeg-decoder" version = "0.3.0" @@ -2891,6 +2904,16 @@ dependencies = [ "libc", ] +[[package]] +name = "libwebp-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5df1e76f0acef0058aa2164ccf74e610e716e7f9eeb3ee2283de7d43659d823" +dependencies = [ + "cc", + "glob", +] + [[package]] name = "libz-sys" version = "1.1.8" @@ -3558,7 +3581,7 @@ dependencies = [ [[package]] name = "node-file-trace" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "serde", @@ -7218,7 +7241,7 @@ dependencies = [ [[package]] name = "turbo-tasks" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "auto-hash-map", @@ -7249,7 +7272,7 @@ dependencies = [ [[package]] name = "turbo-tasks-build" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "cargo-lock", @@ -7261,7 +7284,7 @@ dependencies = [ [[package]] name = "turbo-tasks-bytes" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "bytes", @@ -7276,7 +7299,7 @@ dependencies = [ [[package]] name = "turbo-tasks-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "dotenvs", @@ -7290,7 +7313,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fetch" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "indexmap", @@ -7307,7 +7330,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fs" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "auto-hash-map", @@ -7337,7 +7360,7 @@ dependencies = [ [[package]] name = "turbo-tasks-hash" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "base16", "hex", @@ -7349,7 +7372,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -7363,7 +7386,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros-shared" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "proc-macro2", "quote", @@ -7373,7 +7396,7 @@ dependencies = [ [[package]] name = "turbo-tasks-malloc" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "mimalloc", ] @@ -7381,7 +7404,7 @@ dependencies = [ [[package]] name = "turbo-tasks-memory" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "auto-hash-map", @@ -7404,7 +7427,7 @@ dependencies = [ [[package]] name = "turbo-tasks-testing" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "auto-hash-map", @@ -7417,7 +7440,7 @@ dependencies = [ [[package]] name = "turbopack" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "async-recursion", @@ -7447,7 +7470,7 @@ dependencies = [ [[package]] name = "turbopack-bench" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "chromiumoxide", @@ -7477,7 +7500,7 @@ dependencies = [ [[package]] name = "turbopack-binding" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "auto-hash-map", "mdxjs", @@ -7519,7 +7542,7 @@ dependencies = [ [[package]] name = "turbopack-build" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "indexmap", @@ -7539,7 +7562,7 @@ dependencies = [ [[package]] name = "turbopack-cli-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "clap 4.1.11", @@ -7563,7 +7586,7 @@ dependencies = [ [[package]] name = "turbopack-core" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "async-trait", @@ -7591,7 +7614,7 @@ dependencies = [ [[package]] name = "turbopack-create-test-app" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "clap 4.1.11", @@ -7604,7 +7627,7 @@ dependencies = [ [[package]] name = "turbopack-css" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "async-trait", @@ -7626,7 +7649,7 @@ dependencies = [ [[package]] name = "turbopack-dev" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "indexmap", @@ -7650,7 +7673,7 @@ dependencies = [ [[package]] name = "turbopack-dev-server" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "async-compression", @@ -7686,7 +7709,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "async-trait", @@ -7719,7 +7742,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-plugins" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "async-trait", @@ -7742,7 +7765,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-runtime" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "indoc", @@ -7759,7 +7782,7 @@ dependencies = [ [[package]] name = "turbopack-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "indexmap", @@ -7775,7 +7798,7 @@ dependencies = [ [[package]] name = "turbopack-image" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "base64 0.21.0", @@ -7795,7 +7818,7 @@ dependencies = [ [[package]] name = "turbopack-json" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "serde", @@ -7810,7 +7833,7 @@ dependencies = [ [[package]] name = "turbopack-mdx" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "mdxjs", @@ -7825,7 +7848,7 @@ dependencies = [ [[package]] name = "turbopack-node" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "async-stream", @@ -7860,7 +7883,7 @@ dependencies = [ [[package]] name = "turbopack-static" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "serde", @@ -7876,7 +7899,7 @@ dependencies = [ [[package]] name = "turbopack-swc-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "swc_core", "turbo-tasks", @@ -7887,7 +7910,7 @@ dependencies = [ [[package]] name = "turbopack-test-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230712.2#4a4e5113e94188a78873a33e66c1db84f4effc65" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-230713.2#4022f2b0e5bf6183b813f3ff32267d24f058cc82" dependencies = [ "anyhow", "once_cell", @@ -8714,6 +8737,15 @@ dependencies = [ "walkdir", ] +[[package]] +name = "webp" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cf4eb6b771babe49cf2499777779a2ba9ff9ed3e531040584605732fcfd2e35" +dependencies = [ + "libwebp-sys", +] + [[package]] name = "webpki" version = "0.22.0" diff --git a/Cargo.toml b/Cargo.toml index df5026c782d89..30e394749f8b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,11 +42,11 @@ swc_core = { version = "0.79.13" } testing = { version = "0.33.20" } # Turbo crates -turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230712.2" } +turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230713.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-230712.2" } +turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230713.2" } # [TODO]: need to refactor embed_directory! macro usage in next-core -turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230712.2" } +turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230713.2" } # General Deps diff --git a/packages/next-swc/crates/next-build/src/next_app/app_client_reference.rs b/packages/next-swc/crates/next-build/src/next_app/app_client_reference.rs index aca7bd2104b22..d57e11478330b 100644 --- a/packages/next-swc/crates/next-build/src/next_app/app_client_reference.rs +++ b/packages/next-swc/crates/next-build/src/next_app/app_client_reference.rs @@ -7,8 +7,8 @@ use turbo_tasks::TryJoinIterExt; use turbopack_binding::turbopack::{ build::BuildChunkingContextVc, core::{ - asset::{AssetVc, AssetsVc}, chunk::{ChunkableModule, ChunkingContext}, + output::{OutputAssetVc, OutputAssetsVc}, }, ecmascript::chunk::EcmascriptChunkingContextVc, }; @@ -22,7 +22,7 @@ pub async fn compute_app_client_references_chunks( app_client_reference_types: &HashSet, client_chunking_context: EcmascriptChunkingContextVc, ssr_chunking_context: BuildChunkingContextVc, - all_chunks: &mut Vec, + all_chunks: &mut Vec, ) -> Result> { let app_client_references_chunks: IndexMap<_, _> = app_client_reference_types .iter() @@ -50,7 +50,7 @@ pub async fn compute_app_client_references_chunks( .as_root_chunk(client_chunking_context.into()); ClientReferenceChunks { client_chunks: client_chunking_context.chunk_group(client_entry_chunk), - ssr_chunks: AssetsVc::empty(), + ssr_chunks: OutputAssetsVc::empty(), } } }, @@ -82,7 +82,7 @@ pub async fn compute_app_client_references_chunks( /// Contains the chunks corresponding to a client reference. pub struct ClientReferenceChunks { /// Chunks to be loaded on the client. - pub client_chunks: AssetsVc, + pub client_chunks: OutputAssetsVc, /// Chunks to be loaded on the server for SSR. - pub ssr_chunks: AssetsVc, + pub ssr_chunks: OutputAssetsVc, } diff --git a/packages/next-swc/crates/next-build/src/next_app/app_entries.rs b/packages/next-swc/crates/next-build/src/next_app/app_entries.rs index 7b0eda099dc19..27264f09411b5 100644 --- a/packages/next-swc/crates/next-build/src/next_app/app_entries.rs +++ b/packages/next-swc/crates/next-build/src/next_app/app_entries.rs @@ -29,13 +29,15 @@ use turbopack_binding::{ turbopack::{ build::BuildChunkingContextVc, core::{ - asset::{Asset, AssetVc, AssetsVc}, + asset::{Asset, AssetVc}, chunk::{ availability_info::AvailabilityInfo, ChunkingContext, EvaluatableAssetsVc, ModuleId as TurbopackModuleId, }, compile_time_info::CompileTimeInfoVc, file_source::FileSourceVc, + output::{OutputAssetVc, OutputAssetsVc}, + raw_output::RawOutputVc, virtual_source::VirtualSourceVc, }, ecmascript::{ @@ -285,7 +287,7 @@ pub async fn compute_app_entries_chunks( app_build_manifest: &mut AppBuildManifest, build_manifest: &mut BuildManifest, app_paths_manifest: &mut AppPathsManifest, - all_chunks: &mut Vec, + all_chunks: &mut Vec, ) -> Result<()> { let node_root_ref = node_root.await?; @@ -519,7 +521,7 @@ pub async fn compute_app_entries_chunks( }) .into(), ); - all_chunks.push(client_reference_manifest_source.into()); + all_chunks.push(RawOutputVc::new(client_reference_manifest_source.into()).into()); } Ok(()) @@ -553,9 +555,9 @@ pub async fn get_app_shared_client_chunk( pub async fn get_app_client_shared_chunks( app_client_runtime_entries: EvaluatableAssetsVc, client_chunking_context: EcmascriptChunkingContextVc, -) -> Result { +) -> Result { if app_client_runtime_entries.await?.is_empty() { - return Ok(AssetsVc::empty()); + return Ok(OutputAssetsVc::empty()); } let app_client_shared_chunk = diff --git a/packages/next-swc/crates/next-build/src/next_build.rs b/packages/next-swc/crates/next-build/src/next_build.rs index 61f7fd3e0007e..8d7a0e207b081 100644 --- a/packages/next-swc/crates/next-build/src/next_build.rs +++ b/packages/next-swc/crates/next-build/src/next_build.rs @@ -35,6 +35,7 @@ use turbopack_binding::{ chunk::ChunkingContext, environment::ServerAddrVc, issue::{IssueReporter, IssueReporterVc, IssueSeverity, IssueVc}, + output::{OutputAssetVc, OutputAssetsVc}, reference::AssetReference, virtual_fs::VirtualFileSystemVc, }, @@ -501,12 +502,12 @@ async fn handle_issues + CollectiblesSource + Copy>( /// Emits all assets transitively reachable from the given chunks, that are /// inside the node root or the client root. async fn emit_all_assets( - chunks: Vec, + chunks: Vec, node_root: &FileSystemPath, client_relative_path: FileSystemPathVc, client_output_path: FileSystemPathVc, ) -> Result { - let all_assets = all_assets_from_entries(AssetsVc::cell(chunks)).await?; + let all_assets = all_assets_from_entries(OutputAssetsVc::cell(chunks)).await?; Ok(CompletionsVc::all( all_assets .iter() @@ -547,11 +548,14 @@ fn emit_rebase(asset: AssetVc, from: FileSystemPathVc, to: FileSystemPathVc) -> /// Walks the asset graph from multiple assets and collect all referenced /// assets. #[turbo_tasks::function] -async fn all_assets_from_entries(entries: AssetsVc) -> Result { +async fn all_assets_from_entries(entries: OutputAssetsVc) -> Result { Ok(AssetsVc::cell( AdjacencyMap::new() .skip_duplicates() - .visit(entries.await?.iter().copied(), get_referenced_assets) + .visit( + entries.await?.iter().copied().map(Into::into), + get_referenced_assets, + ) .await .completed()? .into_inner() diff --git a/packages/next-swc/crates/next-build/src/next_pages/page_entries.rs b/packages/next-swc/crates/next-build/src/next_pages/page_entries.rs index 2b81cf8541f61..2772f5846cdd7 100644 --- a/packages/next-swc/crates/next-build/src/next_pages/page_entries.rs +++ b/packages/next-swc/crates/next-build/src/next_pages/page_entries.rs @@ -27,11 +27,12 @@ use turbopack_binding::{ turbopack::{ build::BuildChunkingContextVc, core::{ - asset::{Asset, AssetVc}, + asset::Asset, chunk::{ChunkableModule, ChunkingContext, EvaluatableAssetsVc}, compile_time_info::CompileTimeInfoVc, context::{AssetContext, AssetContextVc}, file_source::FileSourceVc, + output::OutputAssetVc, reference_type::{EntryReferenceSubType, ReferenceType}, source::SourceVc, }, @@ -349,7 +350,7 @@ pub async fn compute_page_entries_chunks( client_relative_path: &FileSystemPath, pages_manifest: &mut PagesManifest, build_manifest: &mut BuildManifest, - all_chunks: &mut Vec, + all_chunks: &mut Vec, ) -> Result<()> { for page_entry in page_entries.entries.iter() { let page_entry = page_entry.await?; diff --git a/packages/next-swc/crates/next-core/js/package.json b/packages/next-swc/crates/next-core/js/package.json index 0a2491db04379..040040403533b 100644 --- a/packages/next-swc/crates/next-core/js/package.json +++ b/packages/next-swc/crates/next-core/js/package.json @@ -10,8 +10,8 @@ "check": "tsc --noEmit" }, "dependencies": { - "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230712.2", - "@vercel/turbopack-node": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230712.2", + "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230713.2", + "@vercel/turbopack-node": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230713.2", "anser": "^2.1.1", "css.escape": "^1.5.1", "next": "*", diff --git a/packages/next-swc/crates/next-core/src/next_client_chunks/with_chunks.rs b/packages/next-swc/crates/next-core/src/next_client_chunks/with_chunks.rs index 8455313381c6a..7325f3629d2c3 100644 --- a/packages/next-swc/crates/next-core/src/next_client_chunks/with_chunks.rs +++ b/packages/next-swc/crates/next-core/src/next_client_chunks/with_chunks.rs @@ -9,7 +9,7 @@ use turbopack_binding::{ }, turbopack::{ core::{ - asset::{Asset, AssetContentVc, AssetVc, AssetsVc}, + asset::{Asset, AssetContentVc, AssetVc}, chunk::{ availability_info::AvailabilityInfo, ChunkDataVc, ChunkGroupReferenceVc, ChunkItem, ChunkItemVc, ChunkVc, ChunkableModule, ChunkableModuleVc, ChunkingContext, @@ -17,6 +17,7 @@ use turbopack_binding::{ }, ident::AssetIdentVc, module::{Module, ModuleVc}, + output::OutputAssetsVc, reference::AssetReferencesVc, }, ecmascript::{ @@ -68,7 +69,7 @@ impl WithChunksAssetVc { } #[turbo_tasks::function] - async fn chunks(self) -> Result { + async fn chunks(self) -> Result { let this = self.await?; Ok(this.chunking_context.chunk_group(self.entry_chunk())) } diff --git a/packages/next-swc/crates/next-core/src/next_client_component/with_client_chunks.rs b/packages/next-swc/crates/next-core/src/next_client_component/with_client_chunks.rs index 4ad161b043c7f..b96247a89347e 100644 --- a/packages/next-swc/crates/next-core/src/next_client_component/with_client_chunks.rs +++ b/packages/next-swc/crates/next-core/src/next_client_component/with_client_chunks.rs @@ -5,7 +5,7 @@ use turbopack_binding::{ turbo::tasks_fs::FileSystemPathVc, turbopack::{ core::{ - asset::{Asset, AssetContentVc, AssetVc, AssetsVc}, + asset::{Asset, AssetContentVc, AssetVc}, chunk::{ availability_info::AvailabilityInfo, ChunkDataVc, ChunkItem, ChunkItemVc, ChunkVc, ChunkableModule, ChunkableModuleReference, ChunkableModuleReferenceVc, @@ -14,6 +14,7 @@ use turbopack_binding::{ }, ident::AssetIdentVc, module::{Module, ModuleVc}, + output::OutputAssetsVc, proxied_asset::ProxiedAssetVc, reference::{ AssetReference, AssetReferenceVc, AssetReferencesVc, SingleAssetReferenceVc, @@ -122,7 +123,7 @@ struct WithClientChunksChunkItem { #[turbo_tasks::value_impl] impl WithClientChunksChunkItemVc { #[turbo_tasks::function] - async fn chunks(self) -> Result { + async fn chunks(self) -> Result { let this = self.await?; let inner = this.inner.await?; Ok(this @@ -131,25 +132,26 @@ impl WithClientChunksChunkItemVc { } #[turbo_tasks::function] - async fn client_chunks(self) -> Result { + async fn client_chunks(self) -> Result { let this = self.await?; let inner = this.inner.await?; let chunks = self.chunks(); let output_root = this.context.output_root().await?; let mut client_chunks = Vec::new(); - for chunk in &*chunks.await? { + for &chunk in &*chunks.await? { let extension = chunk.ident().path().extension().await?; // Only expose CSS chunks as client chunks. if &*extension == "css" { if let Some(path) = output_root.get_path_to(&*chunk.ident().path().await?) { - client_chunks - .push(ProxiedAssetVc::new(*chunk, inner.server_root.join(path)).into()); + client_chunks.push( + ProxiedAssetVc::new(chunk.into(), inner.server_root.join(path)).into(), + ); } } } - Ok(AssetsVc::cell(client_chunks)) + Ok(OutputAssetsVc::cell(client_chunks)) } #[turbo_tasks::function] @@ -227,7 +229,7 @@ impl ChunkItem for WithClientChunksChunkItem { let client_chunks = client_chunks.await?; let client_chunk = StringVc::cell("client chunk".to_string()); for &chunk in client_chunks.iter() { - references.push(SingleAssetReferenceVc::new(chunk, client_chunk).into()); + references.push(SingleAssetReferenceVc::new(chunk.into(), client_chunk).into()); } for chunk_data in &*self_vc.chunks_data().await? { references.extend(chunk_data.references().await?.iter().copied()); diff --git a/packages/next-swc/crates/next-core/src/next_dynamic/dynamic_module.rs b/packages/next-swc/crates/next-core/src/next_dynamic/dynamic_module.rs index 9c5963a8965ea..cd16eeda2cecb 100644 --- a/packages/next-swc/crates/next-core/src/next_dynamic/dynamic_module.rs +++ b/packages/next-swc/crates/next-core/src/next_dynamic/dynamic_module.rs @@ -1,10 +1,11 @@ use anyhow::{bail, Result}; use turbo_tasks::primitives::StringVc; use turbopack_binding::turbopack::core::{ - asset::{Asset, AssetContentVc, AssetVc, AssetsVc}, + asset::{Asset, AssetContentVc, AssetVc}, chunk::{ChunkableModule, ChunkableModuleVc, ChunkingContext, ChunkingContextVc}, ident::AssetIdentVc, module::{Module, ModuleVc}, + output::OutputAssetsVc, reference::AssetReferencesVc, }; @@ -31,7 +32,7 @@ impl NextDynamicEntryModuleVc { pub async fn client_chunks( self, client_chunking_context: ChunkingContextVc, - ) -> Result { + ) -> Result { let this = self.await?; let Some(client_entry_module) = diff --git a/packages/next-swc/crates/next-core/src/page_loader.rs b/packages/next-swc/crates/next-core/src/page_loader.rs index daa039404dbf5..e967dfa57d17e 100644 --- a/packages/next-swc/crates/next-core/src/page_loader.rs +++ b/packages/next-swc/crates/next-core/src/page_loader.rs @@ -7,7 +7,7 @@ use turbopack_binding::{ turbo::tasks_fs::{rope::RopeBuilder, File, FileContent, FileSystemPathVc}, turbopack::{ core::{ - asset::{Asset, AssetContentVc, AssetVc, AssetsVc}, + asset::{Asset, AssetContentVc, AssetVc}, chunk::{ ChunkDataVc, ChunkableModule, ChunkingContext, ChunkingContextVc, ChunksDataVc, EvaluatableAssetVc, EvaluatableAssetsVc, @@ -15,6 +15,7 @@ use turbopack_binding::{ context::{AssetContext, AssetContextVc}, ident::AssetIdentVc, module::ModuleVc, + output::OutputAssetsVc, reference::{AssetReferencesVc, SingleAssetReferenceVc}, reference_type::{EntryReferenceSubType, InnerAssetsVc, ReferenceType}, source::SourceVc, @@ -95,7 +96,7 @@ pub async fn create_page_loader_entry_module( #[turbo_tasks::value_impl] impl PageLoaderAssetVc { #[turbo_tasks::function] - async fn get_page_chunks(self) -> Result { + async fn get_page_chunks(self) -> Result { let this = &*self.await?; let page_loader_entry_asset = @@ -161,10 +162,13 @@ impl Asset for PageLoaderAsset { let chunks = self_vc.get_page_chunks().await?; let mut references = Vec::with_capacity(chunks.len()); - for chunk in chunks.iter() { + for &chunk in chunks.iter() { references.push( - SingleAssetReferenceVc::new(*chunk, page_loader_chunk_reference_description()) - .into(), + SingleAssetReferenceVc::new( + chunk.into(), + page_loader_chunk_reference_description(), + ) + .into(), ); } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a41ed08b08a6d..f972cca90e668 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -992,8 +992,8 @@ importers: '@types/react': 18.2.7 '@types/react-dom': 18.2.4 '@vercel/ncc': ^0.36.0 - '@vercel/turbopack-ecmascript-runtime': https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230712.2 - '@vercel/turbopack-node': https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230712.2 + '@vercel/turbopack-ecmascript-runtime': https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230713.2 + '@vercel/turbopack-node': https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230713.2 anser: ^2.1.1 css.escape: ^1.5.1 find-up: ^6.3.0 @@ -1005,8 +1005,8 @@ importers: stacktrace-parser: ^0.1.10 strip-ansi: ^7.0.1 dependencies: - '@vercel/turbopack-ecmascript-runtime': '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230712.2_react-refresh@0.12.0' - '@vercel/turbopack-node': '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230712.2' + '@vercel/turbopack-ecmascript-runtime': '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230713.2_react-refresh@0.12.0' + '@vercel/turbopack-node': '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230713.2' anser: 2.1.1 css.escape: 1.5.1 next: link:../../../../next @@ -6136,7 +6136,7 @@ packages: dependencies: '@mdx-js/mdx': 2.2.1 source-map: 0.7.3 - webpack: 5.86.0 + webpack: 5.86.0_@swc+core@1.3.55 transitivePeerDependencies: - supports-color @@ -6810,7 +6810,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true /@swc/core-darwin-x64/1.3.55: @@ -6819,7 +6818,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true /@swc/core-linux-arm-gnueabihf/1.3.55: @@ -6828,7 +6826,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-arm64-gnu/1.3.55: @@ -6837,7 +6834,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-arm64-musl/1.3.55: @@ -6846,7 +6842,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-x64-gnu/1.3.55: @@ -6855,7 +6850,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-x64-musl/1.3.55: @@ -6864,7 +6858,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-win32-arm64-msvc/1.3.55: @@ -6873,7 +6866,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true /@swc/core-win32-ia32-msvc/1.3.55: @@ -6882,7 +6874,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: true optional: true /@swc/core-win32-x64-msvc/1.3.55: @@ -6891,7 +6882,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /@swc/core/1.3.55_@swc+helpers@0.5.1: @@ -6916,7 +6906,6 @@ packages: '@swc/core-win32-arm64-msvc': 1.3.55 '@swc/core-win32-ia32-msvc': 1.3.55 '@swc/core-win32-x64-msvc': 1.3.55 - dev: true /@swc/helpers/0.4.14: resolution: {integrity: sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==} @@ -23749,7 +23738,6 @@ packages: serialize-javascript: 6.0.1 terser: 5.17.7 webpack: 5.86.0_@swc+core@1.3.55 - dev: true /terser/5.10.0: resolution: {integrity: sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==} @@ -25102,7 +25090,6 @@ packages: - '@swc/core' - esbuild - uglify-js - dev: true /websocket-driver/0.7.3: resolution: {integrity: sha512-bpxWlvbbB459Mlipc5GBzzZwhoZgGEZLuqPaR0INBGnPAY1vdBX6hPnoFXiw+3yWxDuHyQjO2oXTMyS8A5haFg==} @@ -25511,9 +25498,9 @@ packages: /zwitch/2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} - '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230712.2_react-refresh@0.12.0': - resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230712.2} - id: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230712.2' + '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230713.2_react-refresh@0.12.0': + resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230713.2} + id: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-230713.2' name: '@vercel/turbopack-ecmascript-runtime' version: 0.0.0 dependencies: @@ -25524,8 +25511,8 @@ packages: - webpack dev: false - '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230712.2': - resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230712.2} + '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230713.2': + resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-node/js?turbopack-230713.2} name: '@vercel/turbopack-node' version: 0.0.0 dependencies: