Unverified Commit 51fc5f67 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

[Turbopack] make `make_chunks` a non-turbo-tasks-function (#76042)

### What?

This function is only called chunk_group and cells a big list of chunk items
parent 46526f3b
...@@ -229,11 +229,10 @@ pub async fn make_chunk_group( ...@@ -229,11 +229,10 @@ pub async fn make_chunk_group(
let chunks = make_chunks( let chunks = make_chunks(
module_graph, module_graph,
*chunking_context, *chunking_context,
Vc::cell(chunk_items), chunk_items,
"".into(), "".into(),
Vc::cell(referenced_output_assets), Vc::cell(referenced_output_assets),
) )
.owned()
.await?; .await?;
Ok(MakeChunkGroupResult { Ok(MakeChunkGroupResult {
......
...@@ -9,8 +9,8 @@ use turbo_rcstr::RcStr; ...@@ -9,8 +9,8 @@ use turbo_rcstr::RcStr;
use turbo_tasks::{FxIndexMap, ReadRef, ResolvedVc, TryJoinIterExt, ValueToString, Vc}; use turbo_tasks::{FxIndexMap, ReadRef, ResolvedVc, TryJoinIterExt, ValueToString, Vc};
use super::{ use super::{
AsyncModuleInfo, Chunk, ChunkItem, ChunkItemTy, ChunkItemWithAsyncModuleInfo, AsyncModuleInfo, Chunk, ChunkItem, ChunkItemTy, ChunkItemWithAsyncModuleInfo, ChunkType,
ChunkItemsWithAsyncModuleInfo, ChunkType, ChunkingContext, Chunks, ChunkingContext,
}; };
use crate::{ use crate::{
chunk::{ chunk::{
...@@ -47,17 +47,15 @@ async fn chunk_item_info( ...@@ -47,17 +47,15 @@ async fn chunk_item_info(
/// Creates chunks based on heuristics for the passed `chunk_items`. Also /// Creates chunks based on heuristics for the passed `chunk_items`. Also
/// attaches `referenced_output_assets` to the first chunk. /// attaches `referenced_output_assets` to the first chunk.
#[turbo_tasks::function]
pub async fn make_chunks( pub async fn make_chunks(
module_graph: Vc<ModuleGraph>, module_graph: Vc<ModuleGraph>,
chunking_context: Vc<Box<dyn ChunkingContext>>, chunking_context: Vc<Box<dyn ChunkingContext>>,
chunk_items: Vc<ChunkItemsWithAsyncModuleInfo>, chunk_items: Vec<ChunkItemWithAsyncModuleInfo>,
key_prefix: RcStr, key_prefix: RcStr,
mut referenced_output_assets: Vc<OutputAssets>, mut referenced_output_assets: Vc<OutputAssets>,
) -> Result<Vc<Chunks>> { ) -> Result<Vec<ResolvedVc<Box<dyn Chunk>>>> {
let chunking_configs = &*chunking_context.chunking_configs().await?; let chunking_configs = &*chunking_context.chunking_configs().await?;
let chunk_items = chunk_items.await?;
let chunk_items = chunk_items let chunk_items = chunk_items
.iter() .iter()
.map(|c| async move { .map(|c| async move {
...@@ -154,7 +152,7 @@ pub async fn make_chunks( ...@@ -154,7 +152,7 @@ pub async fn make_chunks(
.try_join() .try_join()
.await?; .await?;
Ok(Vc::cell(resolved_chunks)) Ok(resolved_chunks)
} }
struct ChunkItemWithInfo { struct ChunkItemWithInfo {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment