allow to pass available chunk items when creating a chunk group (#60554)

### What?

api changes for https://github.com/vercel/turbo/pull/6988

### Turbopack Changes

* https://github.com/vercel/turbo/pull/6886 <!-- Tobias Koppers -
improve nesting of tracing for invalidations -->
* https://github.com/vercel/turbo/pull/6866 <!-- Tobias Koppers - trace
memory allocations and show in tracing -->
* https://github.com/vercel/turbo/pull/6988 <!-- Tobias Koppers - allow
to pass available chunk items when creating a chunk group -->
* https://github.com/vercel/turbo/pull/7013 <!-- Leah - fix: make CSS
reloading work on firefox -->
* https://github.com/vercel/turbo/pull/7004 <!-- Tobias Koppers -
improve error message when no config is exported from postcss.config.js
-->




Closes PACK-2231
This commit is contained in:
Tobias Koppers 2024-01-17 08:58:02 +01:00 committed by GitHub
parent 056b675bd9
commit 4597ff35da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 119 additions and 87 deletions

69
Cargo.lock generated
View file

@ -321,7 +321,7 @@ dependencies = [
[[package]] [[package]]
name = "auto-hash-map" name = "auto-hash-map"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"serde", "serde",
"smallvec", "smallvec",
@ -3497,7 +3497,7 @@ dependencies = [
[[package]] [[package]]
name = "node-file-trace" name = "node-file-trace"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"serde", "serde",
@ -7537,7 +7537,7 @@ dependencies = [
[[package]] [[package]]
name = "turbo-tasks" name = "turbo-tasks"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -7569,7 +7569,7 @@ dependencies = [
[[package]] [[package]]
name = "turbo-tasks-build" name = "turbo-tasks-build"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"cargo-lock", "cargo-lock",
@ -7581,7 +7581,7 @@ dependencies = [
[[package]] [[package]]
name = "turbo-tasks-bytes" name = "turbo-tasks-bytes"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -7596,7 +7596,7 @@ dependencies = [
[[package]] [[package]]
name = "turbo-tasks-env" name = "turbo-tasks-env"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"dotenvs", "dotenvs",
@ -7610,7 +7610,7 @@ dependencies = [
[[package]] [[package]]
name = "turbo-tasks-fetch" name = "turbo-tasks-fetch"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"indexmap 1.9.3", "indexmap 1.9.3",
@ -7627,7 +7627,7 @@ dependencies = [
[[package]] [[package]]
name = "turbo-tasks-fs" name = "turbo-tasks-fs"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"auto-hash-map", "auto-hash-map",
@ -7658,7 +7658,7 @@ dependencies = [
[[package]] [[package]]
name = "turbo-tasks-hash" name = "turbo-tasks-hash"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"base16", "base16",
"hex", "hex",
@ -7670,7 +7670,7 @@ dependencies = [
[[package]] [[package]]
name = "turbo-tasks-macros" name = "turbo-tasks-macros"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"convert_case 0.6.0", "convert_case 0.6.0",
@ -7684,7 +7684,7 @@ dependencies = [
[[package]] [[package]]
name = "turbo-tasks-macros-shared" name = "turbo-tasks-macros-shared"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -7694,7 +7694,7 @@ dependencies = [
[[package]] [[package]]
name = "turbo-tasks-malloc" name = "turbo-tasks-malloc"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"mimalloc", "mimalloc",
] ]
@ -7702,7 +7702,7 @@ dependencies = [
[[package]] [[package]]
name = "turbo-tasks-memory" name = "turbo-tasks-memory"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"auto-hash-map", "auto-hash-map",
@ -7727,7 +7727,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack" name = "turbopack"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-recursion", "async-recursion",
@ -7759,7 +7759,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-binding" name = "turbopack-binding"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"auto-hash-map", "auto-hash-map",
"mdxjs", "mdxjs",
@ -7800,7 +7800,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-build" name = "turbopack-build"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"indexmap 1.9.3", "indexmap 1.9.3",
@ -7824,7 +7824,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-cli-utils" name = "turbopack-cli-utils"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap 4.4.2", "clap 4.4.2",
@ -7842,7 +7842,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-core" name = "turbopack-core"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-recursion", "async-recursion",
@ -7872,7 +7872,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-css" name = "turbopack-css"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -7899,7 +7899,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-dev" name = "turbopack-dev"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"indexmap 1.9.3", "indexmap 1.9.3",
@ -7923,7 +7923,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-dev-server" name = "turbopack-dev-server"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-compression", "async-compression",
@ -7960,7 +7960,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-ecmascript" name = "turbopack-ecmascript"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -7995,7 +7995,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-ecmascript-hmr-protocol" name = "turbopack-ecmascript-hmr-protocol"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
@ -8006,7 +8006,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-ecmascript-plugins" name = "turbopack-ecmascript-plugins"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -8029,7 +8029,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-ecmascript-runtime" name = "turbopack-ecmascript-runtime"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"indoc", "indoc",
@ -8046,7 +8046,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-env" name = "turbopack-env"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"indexmap 1.9.3", "indexmap 1.9.3",
@ -8062,7 +8062,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-image" name = "turbopack-image"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"base64 0.21.4", "base64 0.21.4",
@ -8082,7 +8082,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-json" name = "turbopack-json"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"serde", "serde",
@ -8097,7 +8097,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-mdx" name = "turbopack-mdx"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"mdxjs", "mdxjs",
@ -8112,7 +8112,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-node" name = "turbopack-node"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-stream", "async-stream",
@ -8147,7 +8147,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-static" name = "turbopack-static"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"serde", "serde",
@ -8163,7 +8163,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-swc-utils" name = "turbopack-swc-utils"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"swc_core", "swc_core",
"turbo-tasks", "turbo-tasks",
@ -8174,7 +8174,7 @@ dependencies = [
[[package]] [[package]]
name = "turbopack-trace-utils" name = "turbopack-trace-utils"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"crossbeam-channel", "crossbeam-channel",
@ -8184,12 +8184,13 @@ dependencies = [
"tokio", "tokio",
"tracing", "tracing",
"tracing-subscriber", "tracing-subscriber",
"turbo-tasks-malloc",
] ]
[[package]] [[package]]
name = "turbopack-wasm" name = "turbopack-wasm"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240110.4#35ade4e85b17a076fb4e6287e519c26b087d0bef" source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240117.1#145d71b0a0e4ddaffda006a07eccc55e33aad75e"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"indexmap 1.9.3", "indexmap 1.9.3",

View file

@ -37,11 +37,11 @@ swc_core = { version = "0.87.16", features = [
testing = { version = "0.35.14" } testing = { version = "0.35.14" }
# Turbo crates # Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240110.4" } turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240117.1" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros.. # [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-240110.4" } turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240117.1" }
# [TODO]: need to refactor embed_directory! macro usage in next-core # [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240110.4" } turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240117.1" }
# General Deps # General Deps

View file

@ -44,9 +44,10 @@ use turbopack_binding::{
tasks_fs::{rope::RopeBuilder, File, FileContent, FileSystemPath}, tasks_fs::{rope::RopeBuilder, File, FileContent, FileSystemPath},
}, },
turbopack::{ turbopack::{
build::EntryChunkGroupResult,
core::{ core::{
asset::{Asset, AssetContent}, asset::{Asset, AssetContent},
chunk::{availability_info::AvailabilityInfo, ChunkingContext, EvaluatableAssets}, chunk::{availability_info::AvailabilityInfo, ChunkingContextExt, EvaluatableAssets},
file_source::FileSource, file_source::FileSource,
module::Module, module::Module,
output::{OutputAsset, OutputAssets}, output::{OutputAsset, OutputAssets},
@ -844,9 +845,10 @@ impl AppEndpoint {
server_assets.push(manifest); server_assets.push(manifest);
evaluatable_assets.push(loader); evaluatable_assets.push(loader);
let files = chunking_context.evaluated_chunk_group( let files = chunking_context.evaluated_chunk_group_assets(
app_entry.rsc_entry.ident(), app_entry.rsc_entry.ident(),
Vc::cell(evaluatable_assets.clone()), Vc::cell(evaluatable_assets.clone()),
Value::new(AvailabilityInfo::Root),
); );
let files_value = files.await?; let files_value = files.await?;
@ -976,7 +978,9 @@ impl AppEndpoint {
server_assets.push(manifest); server_assets.push(manifest);
evaluatable_assets.push(loader); evaluatable_assets.push(loader);
let rsc_chunk = this let EntryChunkGroupResult {
asset: rsc_chunk, ..
} = *this
.app_project .app_project
.project() .project()
.server_chunking_context() .server_chunking_context()
@ -987,7 +991,9 @@ impl AppEndpoint {
)), )),
app_entry.rsc_entry, app_entry.rsc_entry,
Vc::cell(evaluatable_assets), Vc::cell(evaluatable_assets),
); Value::new(AvailabilityInfo::Root),
)
.await?;
server_assets.push(rsc_chunk); server_assets.push(rsc_chunk);
let app_paths_manifest_output = create_app_paths_manifest( let app_paths_manifest_output = create_app_paths_manifest(

View file

@ -15,7 +15,7 @@ use turbopack_binding::{
build::BuildChunkingContext, build::BuildChunkingContext,
core::{ core::{
chunk::{ chunk::{
availability_info::AvailabilityInfo, ChunkableModule, ChunkingContext, availability_info::AvailabilityInfo, ChunkableModule, ChunkingContextExt,
EvaluatableAssets, EvaluatableAssets,
}, },
issue::IssueSeverity, issue::IssueSeverity,
@ -84,7 +84,7 @@ pub(crate) async fn collect_chunk_group(
availability_info: Value<AvailabilityInfo>, availability_info: Value<AvailabilityInfo>,
) -> Result<Vc<DynamicImportedChunks>> { ) -> Result<Vc<DynamicImportedChunks>> {
collect_chunk_group_inner(dynamic_import_entries, |chunk_item| { collect_chunk_group_inner(dynamic_import_entries, |chunk_item| {
chunking_context.chunk_group(chunk_item, availability_info) chunking_context.chunk_group_assets(chunk_item, availability_info)
}) })
.await .await
} }
@ -95,7 +95,11 @@ pub(crate) async fn collect_evaluated_chunk_group(
evaluatable_assets: Vc<EvaluatableAssets>, evaluatable_assets: Vc<EvaluatableAssets>,
) -> Result<Vc<DynamicImportedChunks>> { ) -> Result<Vc<DynamicImportedChunks>> {
collect_chunk_group_inner(dynamic_import_entries, |chunk_item| { collect_chunk_group_inner(dynamic_import_entries, |chunk_item| {
chunking_context.evaluated_chunk_group(chunk_item.ident(), evaluatable_assets) chunking_context.evaluated_chunk_group_assets(
chunk_item.ident(),
evaluatable_assets,
Value::new(AvailabilityInfo::Root),
)
}) })
.await .await
} }

View file

@ -11,9 +11,10 @@ use turbo_tasks::{Completion, Value, Vc};
use turbopack_binding::{ use turbopack_binding::{
turbo::tasks_fs::{File, FileContent}, turbo::tasks_fs::{File, FileContent},
turbopack::{ turbopack::{
build::EntryChunkGroupResult,
core::{ core::{
asset::AssetContent, asset::AssetContent,
chunk::ChunkingContext, chunk::{availability_info::AvailabilityInfo, ChunkingContextExt},
context::AssetContext, context::AssetContext,
module::Module, module::Module,
output::{OutputAsset, OutputAssets}, output::{OutputAsset, OutputAssets},
@ -96,8 +97,11 @@ impl InstrumentationEndpoint {
let edge_chunking_context = self.project.edge_chunking_context(); let edge_chunking_context = self.project.edge_chunking_context();
let edge_files = edge_chunking_context let edge_files = edge_chunking_context.evaluated_chunk_group_assets(
.evaluated_chunk_group(module.ident(), Vc::cell(evaluatable_assets)); module.ident(),
Vc::cell(evaluatable_assets),
Value::new(AvailabilityInfo::Root),
);
Ok(edge_files) Ok(edge_files)
} }
@ -124,17 +128,20 @@ impl InstrumentationEndpoint {
bail!("Entry module must be evaluatable"); bail!("Entry module must be evaluatable");
}; };
let chunk = chunking_context.entry_chunk_group( let EntryChunkGroupResult { asset: chunk, .. } = *chunking_context
self.project .entry_chunk_group(
.node_root() self.project
.join("server/instrumentation.js".to_string()), .node_root()
module, .join("server/instrumentation.js".to_string()),
get_server_runtime_entries( module,
Value::new(ServerContextType::Instrumentation), get_server_runtime_entries(
NextMode::Development, Value::new(ServerContextType::Instrumentation),
NextMode::Development,
)
.resolve_entries(self.context),
Value::new(AvailabilityInfo::Root),
) )
.resolve_entries(self.context), .await?;
);
Ok(chunk) Ok(chunk)
} }

View file

@ -17,7 +17,7 @@ use turbopack_binding::{
turbopack::{ turbopack::{
core::{ core::{
asset::AssetContent, asset::AssetContent,
chunk::ChunkingContext, chunk::{availability_info::AvailabilityInfo, ChunkingContextExt},
context::AssetContext, context::AssetContext,
module::Module, module::Module,
output::{OutputAsset, OutputAssets}, output::{OutputAsset, OutputAssets},
@ -99,8 +99,11 @@ impl MiddlewareEndpoint {
let edge_chunking_context = self.project.edge_chunking_context(); let edge_chunking_context = self.project.edge_chunking_context();
let edge_files = edge_chunking_context let edge_files = edge_chunking_context.evaluated_chunk_group_assets(
.evaluated_chunk_group(module.ident(), Vc::cell(evaluatable_assets)); module.ident(),
Vc::cell(evaluatable_assets),
Value::new(AvailabilityInfo::Root),
);
Ok(edge_files) Ok(edge_files)
} }

View file

@ -37,10 +37,10 @@ use turbopack_binding::{
File, FileContent, FileSystem, FileSystemPath, FileSystemPathOption, VirtualFileSystem, File, FileContent, FileSystem, FileSystemPath, FileSystemPathOption, VirtualFileSystem,
}, },
turbopack::{ turbopack::{
build::BuildChunkingContext, build::{BuildChunkingContext, EntryChunkGroupResult},
core::{ core::{
asset::AssetContent, asset::AssetContent,
chunk::{availability_info::AvailabilityInfo, ChunkingContext, EvaluatableAssets}, chunk::{availability_info::AvailabilityInfo, ChunkingContextExt, EvaluatableAssets},
context::AssetContext, context::AssetContext,
file_source::FileSource, file_source::FileSource,
issue::IssueSeverity, issue::IssueSeverity,
@ -606,12 +606,13 @@ impl PageEndpoint {
let client_chunking_context = this.pages_project.project().client_chunking_context(); let client_chunking_context = this.pages_project.project().client_chunking_context();
let mut client_chunks = client_chunking_context let mut client_chunks = client_chunking_context
.evaluated_chunk_group( .evaluated_chunk_group_assets(
client_module.ident(), client_module.ident(),
this.pages_project this.pages_project
.client_runtime_entries() .client_runtime_entries()
.with_entry(Vc::upcast(client_main_module)) .with_entry(Vc::upcast(client_main_module))
.with_entry(Vc::upcast(client_module)), .with_entry(Vc::upcast(client_module)),
Value::new(AvailabilityInfo::Root),
) )
.await? .await?
.clone_value(); .clone_value();
@ -670,9 +671,10 @@ impl PageEndpoint {
.context("could not process page loader entry module")?; .context("could not process page loader entry module")?;
evaluatable_assets.push(evaluatable); evaluatable_assets.push(evaluatable);
let edge_files = edge_chunking_context.evaluated_chunk_group( let edge_files = edge_chunking_context.evaluated_chunk_group_assets(
ssr_module.ident(), ssr_module.ident(),
Vc::cell(evaluatable_assets.clone()), Vc::cell(evaluatable_assets.clone()),
Value::new(AvailabilityInfo::Root),
); );
let dynamic_import_modules = collect_next_dynamic_imports(ssr_module).await?; let dynamic_import_modules = collect_next_dynamic_imports(ssr_module).await?;
@ -704,11 +706,17 @@ impl PageEndpoint {
let ssr_entry_chunk_path_string = format!("pages{asset_path}"); 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_path = node_path.join(ssr_entry_chunk_path_string);
let ssr_entry_chunk = chunking_context.entry_chunk_group( let EntryChunkGroupResult {
ssr_entry_chunk_path, asset: ssr_entry_chunk,
ssr_module, ..
runtime_entries, } = *chunking_context
); .entry_chunk_group(
ssr_entry_chunk_path,
ssr_module,
runtime_entries,
Value::new(AvailabilityInfo::Root),
)
.await?;
let availability_info = Value::new(AvailabilityInfo::Root); let availability_info = Value::new(AvailabilityInfo::Root);
let dynamic_import_modules = collect_next_dynamic_imports(ssr_module).await?; let dynamic_import_modules = collect_next_dynamic_imports(ssr_module).await?;

View file

@ -55,18 +55,18 @@ pub async fn get_app_client_references_chunks(
let ecmascript_client_reference_ref = let ecmascript_client_reference_ref =
ecmascript_client_reference.await?; ecmascript_client_reference.await?;
ClientReferenceChunks { ClientReferenceChunks {
client_chunks: client_chunking_context.root_chunk_group( client_chunks: client_chunking_context.root_chunk_group_assets(
Vc::upcast(ecmascript_client_reference_ref.client_module), Vc::upcast(ecmascript_client_reference_ref.client_module),
), ),
ssr_chunks: ssr_chunking_context.root_chunk_group(Vc::upcast( ssr_chunks: ssr_chunking_context.root_chunk_group_assets(
ecmascript_client_reference_ref.ssr_module, Vc::upcast(ecmascript_client_reference_ref.ssr_module),
)), ),
} }
} }
ClientReferenceType::CssClientReference(css_client_reference) => { ClientReferenceType::CssClientReference(css_client_reference) => {
let css_client_reference_ref = css_client_reference.await?; let css_client_reference_ref = css_client_reference.await?;
ClientReferenceChunks { ClientReferenceChunks {
client_chunks: client_chunking_context.root_chunk_group( client_chunks: client_chunking_context.root_chunk_group_assets(
Vc::upcast(css_client_reference_ref.client_module), Vc::upcast(css_client_reference_ref.client_module),
), ),
ssr_chunks: OutputAssets::empty(), ssr_chunks: OutputAssets::empty(),
@ -128,11 +128,11 @@ pub async fn get_app_client_references_chunks(
let global_entry_module = ClientReferenceChunks { let global_entry_module = ClientReferenceChunks {
client_chunks: { client_chunks: {
let _span = tracing::info_span!("client side rendering").entered(); let _span = tracing::info_span!("client side rendering").entered();
client_chunking_context.root_chunk_group(Vc::upcast(client_entry_module)) client_chunking_context.root_chunk_group_assets(Vc::upcast(client_entry_module))
}, },
ssr_chunks: { ssr_chunks: {
let _span = tracing::info_span!("server side rendering").entered(); let _span = tracing::info_span!("server side rendering").entered();
ssr_chunking_context.root_chunk_group(Vc::upcast(ssr_entry_module)) ssr_chunking_context.root_chunk_group_assets(Vc::upcast(ssr_entry_module))
}, },
}; };

View file

@ -1,8 +1,8 @@
use anyhow::Result; use anyhow::Result;
use turbo_tasks::Vc; use turbo_tasks::{Value, Vc};
use turbopack_binding::turbopack::{ use turbopack_binding::turbopack::{
core::{ core::{
chunk::{ChunkingContext, EvaluatableAssets}, chunk::{availability_info::AvailabilityInfo, ChunkingContextExt, EvaluatableAssets},
ident::AssetIdent, ident::AssetIdent,
output::OutputAssets, output::OutputAssets,
}, },
@ -19,8 +19,11 @@ pub async fn get_app_client_shared_chunks(
return Ok(OutputAssets::empty()); return Ok(OutputAssets::empty());
} }
let app_client_shared_chunks = let app_client_shared_chunks = client_chunking_context.evaluated_chunk_group_assets(
client_chunking_context.evaluated_chunk_group(ident, app_client_runtime_entries); ident,
app_client_runtime_entries,
Value::new(AvailabilityInfo::Root),
);
Ok(app_client_shared_chunks) Ok(app_client_shared_chunks)
} }

View file

@ -41,7 +41,7 @@ impl NextDynamicEntryModule {
bail!("dynamic client asset must be chunkable"); bail!("dynamic client asset must be chunkable");
}; };
Ok(client_chunking_context.root_chunk_group(client_entry_module)) Ok(client_chunking_context.root_chunk_group_assets(client_entry_module))
} }
} }

View file

@ -194,7 +194,7 @@
"@types/ws": "8.2.0", "@types/ws": "8.2.0",
"@vercel/ncc": "0.34.0", "@vercel/ncc": "0.34.0",
"@vercel/nft": "0.26.2", "@vercel/nft": "0.26.2",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240110.4", "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240117.1",
"acorn": "8.5.0", "acorn": "8.5.0",
"amphtml-validator": "1.0.35", "amphtml-validator": "1.0.35",
"anser": "1.4.9", "anser": "1.4.9",

View file

@ -1077,8 +1077,8 @@ importers:
specifier: 0.26.2 specifier: 0.26.2
version: 0.26.2 version: 0.26.2
'@vercel/turbopack-ecmascript-runtime': '@vercel/turbopack-ecmascript-runtime':
specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240110.4 specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240117.1
version: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240110.4(react-refresh@0.12.0)(webpack@5.86.0)' version: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240117.1(react-refresh@0.12.0)(webpack@5.86.0)'
acorn: acorn:
specifier: 8.5.0 specifier: 8.5.0
version: 8.5.0 version: 8.5.0
@ -25649,9 +25649,9 @@ packages:
/zwitch@2.0.4: /zwitch@2.0.4:
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
'@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240110.4(react-refresh@0.12.0)(webpack@5.86.0)': '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240117.1(react-refresh@0.12.0)(webpack@5.86.0)':
resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240110.4} resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240117.1}
id: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240110.4' id: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240117.1'
name: '@vercel/turbopack-ecmascript-runtime' name: '@vercel/turbopack-ecmascript-runtime'
version: 0.0.0 version: 0.0.0
dependencies: dependencies: