Skip to content

Commit

Permalink
allow to pass available chunk items when creating a chunk group (#60554)
Browse files Browse the repository at this point in the history
### What?

api changes for vercel/turborepo#6988

### Turbopack Changes

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




Closes PACK-2231
  • Loading branch information
sokra authored Jan 17, 2024
1 parent 056b675 commit 4597ff3
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 87 deletions.
69 changes: 35 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 @@ -37,11 +37,11 @@ swc_core = { version = "0.87.16", features = [
testing = { version = "0.35.14" }

# 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..
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
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

Expand Down
14 changes: 10 additions & 4 deletions packages/next-swc/crates/next-api/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ use turbopack_binding::{
tasks_fs::{rope::RopeBuilder, File, FileContent, FileSystemPath},
},
turbopack::{
build::EntryChunkGroupResult,
core::{
asset::{Asset, AssetContent},
chunk::{availability_info::AvailabilityInfo, ChunkingContext, EvaluatableAssets},
chunk::{availability_info::AvailabilityInfo, ChunkingContextExt, EvaluatableAssets},
file_source::FileSource,
module::Module,
output::{OutputAsset, OutputAssets},
Expand Down Expand Up @@ -844,9 +845,10 @@ impl AppEndpoint {
server_assets.push(manifest);
evaluatable_assets.push(loader);

let files = chunking_context.evaluated_chunk_group(
let files = chunking_context.evaluated_chunk_group_assets(
app_entry.rsc_entry.ident(),
Vc::cell(evaluatable_assets.clone()),
Value::new(AvailabilityInfo::Root),
);
let files_value = files.await?;

Expand Down Expand Up @@ -976,7 +978,9 @@ impl AppEndpoint {
server_assets.push(manifest);
evaluatable_assets.push(loader);

let rsc_chunk = this
let EntryChunkGroupResult {
asset: rsc_chunk, ..
} = *this
.app_project
.project()
.server_chunking_context()
Expand All @@ -987,7 +991,9 @@ impl AppEndpoint {
)),
app_entry.rsc_entry,
Vc::cell(evaluatable_assets),
);
Value::new(AvailabilityInfo::Root),
)
.await?;
server_assets.push(rsc_chunk);

let app_paths_manifest_output = create_app_paths_manifest(
Expand Down
Loading

0 comments on commit 4597ff3

Please sign in to comment.