Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
3e95502a
Commit
3e95502a
authored
Feb 24, 2026
by
Matt Mastracci
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ChunkItem -> ChunkedItem
parent
40ac0bbd
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
69 additions
and
61 deletions
+69
-61
server_actions.rs
crates/next-api/src/server_actions.rs
+2
-2
webpack_stats.rs
crates/next-api/src/webpack_stats.rs
+2
-2
ecmascript_client_reference_module.rs
...pt_client_reference/ecmascript_client_reference_module.rs
+3
-3
chunking_context.rs
turbopack/crates/turbopack-browser/src/chunking_context.rs
+2
-2
chunk_id_strategy.rs
...pack/crates/turbopack-core/src/chunk/chunk_id_strategy.rs
+2
-2
chunk_item_batch.rs
...opack/crates/turbopack-core/src/chunk/chunk_item_batch.rs
+1
-1
dev.rs
turbopack/crates/turbopack-core/src/chunk/chunking/dev.rs
+1
-1
mod.rs
turbopack/crates/turbopack-core/src/chunk/chunking/mod.rs
+13
-13
production.rs
...ck/crates/turbopack-core/src/chunk/chunking/production.rs
+3
-3
chunking_context.rs
...opack/crates/turbopack-core/src/chunk/chunking_context.rs
+5
-5
mod.rs
turbopack/crates/turbopack-core/src/chunk/mod.rs
+16
-8
style_groups.rs
...ck/crates/turbopack-core/src/module_graph/style_groups.rs
+1
-1
asset.rs
turbopack/crates/turbopack-css/src/asset.rs
+3
-3
mod.rs
turbopack/crates/turbopack-css/src/chunk/mod.rs
+3
-3
chunk.rs
...crates/turbopack-css/src/chunk/single_item_chunk/chunk.rs
+1
-1
chunk_type.rs
...opack/crates/turbopack-ecmascript/src/chunk/chunk_type.rs
+2
-2
content.rs
turbopack/crates/turbopack-ecmascript/src/chunk/content.rs
+2
-2
item.rs
turbopack/crates/turbopack-ecmascript/src/chunk/item.rs
+4
-4
mod.rs
turbopack/crates/turbopack-ecmascript/src/chunk/mod.rs
+1
-1
chunking_context.rs
turbopack/crates/turbopack-nodejs/src/chunking_context.rs
+2
-2
No files found.
crates/next-api/src/server_actions.rs
View file @
3e95502a
...
@@ -27,7 +27,7 @@ use turbo_tasks_fs::{self, File, FileContent, FileSystemPath, rope::RopeBuilder}
...
@@ -27,7 +27,7 @@ use turbo_tasks_fs::{self, File, FileContent, FileSystemPath, rope::RopeBuilder}
use
turbopack_core
::{
use
turbopack_core
::{
asset
::
AssetContent
,
asset
::
AssetContent
,
chunk
::{
chunk
::{
ChunkItem
,
ChunkItemExt
,
ChunkingContext
,
ChunkingContextExt
,
EvaluatableAsset
,
ModuleId
,
Chunk
ed
Item
,
ChunkItemExt
,
ChunkingContext
,
ChunkingContextExt
,
EvaluatableAsset
,
ModuleId
,
},
},
context
::
AssetContext
,
context
::
AssetContext
,
file_source
::
FileSource
,
file_source
::
FileSource
,
...
@@ -158,7 +158,7 @@ async fn build_manifest(
...
@@ -158,7 +158,7 @@ async fn build_manifest(
page_name
:
RcStr
,
page_name
:
RcStr
,
runtime
:
NextRuntime
,
runtime
:
NextRuntime
,
actions
:
Vc
<
AllActions
>
,
actions
:
Vc
<
AllActions
>
,
chunk_item
:
Vc
<
Box
<
dyn
ChunkItem
>>
,
chunk_item
:
Vc
<
Box
<
dyn
Chunk
ed
Item
>>
,
async_module_info
:
Vc
<
AsyncModulesInfo
>
,
async_module_info
:
Vc
<
AsyncModulesInfo
>
,
)
->
Result
<
ResolvedVc
<
Box
<
dyn
OutputAsset
>>>
{
)
->
Result
<
ResolvedVc
<
Box
<
dyn
OutputAsset
>>>
{
let
manifest_path_prefix
=
&
page_name
;
let
manifest_path_prefix
=
&
page_name
;
...
...
crates/next-api/src/webpack_stats.rs
View file @
3e95502a
...
@@ -8,7 +8,7 @@ use turbo_tasks::{
...
@@ -8,7 +8,7 @@ use turbo_tasks::{
};
};
use
turbopack_browser
::
ecmascript
::
EcmascriptBrowserChunk
;
use
turbopack_browser
::
ecmascript
::
EcmascriptBrowserChunk
;
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
Chunk
,
ChunkItem
,
ChunkItemExt
,
ModuleId
},
chunk
::{
Chunk
,
Chunk
ed
Item
,
ChunkItemExt
,
ModuleId
},
module
::
Module
,
module
::
Module
,
module_graph
::
ModuleGraph
,
module_graph
::
ModuleGraph
,
output
::{
OutputAsset
,
OutputAssetsReference
},
output
::{
OutputAsset
,
OutputAssetsReference
},
...
@@ -25,7 +25,7 @@ where
...
@@ -25,7 +25,7 @@ where
{
{
let
mut
assets
=
vec!
[];
let
mut
assets
=
vec!
[];
let
mut
chunks
=
vec!
[];
let
mut
chunks
=
vec!
[];
let
mut
chunk_items
:
FxIndexMap
<
Vc
<
Box
<
dyn
ChunkItem
>>
,
FxIndexSet
<
RcStr
>>
=
let
mut
chunk_items
:
FxIndexMap
<
Vc
<
Box
<
dyn
Chunk
ed
Item
>>
,
FxIndexSet
<
RcStr
>>
=
FxIndexMap
::
default
();
FxIndexMap
::
default
();
let
entry_assets
=
entry_assets
.into_iter
()
.collect
::
<
Vec
<
_
>>
();
let
entry_assets
=
entry_assets
.into_iter
()
.collect
::
<
Vec
<
_
>>
();
...
...
crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs
View file @
3e95502a
...
@@ -8,7 +8,7 @@ use turbo_tasks_fs::{File, FileContent};
...
@@ -8,7 +8,7 @@ use turbo_tasks_fs::{File, FileContent};
use
turbopack_core
::{
use
turbopack_core
::{
asset
::
AssetContent
,
asset
::
AssetContent
,
chunk
::{
chunk
::{
AsyncModuleInfo
,
ChunkGroupType
,
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
AsyncModuleInfo
,
ChunkGroupType
,
Chunk
ed
Item
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
ChunkingContextExt
,
ChunkingType
,
ChunkingTypeOption
,
ChunkingContextExt
,
ChunkingType
,
ChunkingTypeOption
,
},
},
code_builder
::
CodeBuilder
,
code_builder
::
CodeBuilder
,
...
@@ -256,7 +256,7 @@ impl ChunkableModule for EcmascriptClientReferenceModule {
...
@@ -256,7 +256,7 @@ impl ChunkableModule for EcmascriptClientReferenceModule {
self
:
ResolvedVc
<
Self
>
,
self
:
ResolvedVc
<
Self
>
,
module_graph
:
Vc
<
ModuleGraph
>
,
module_graph
:
Vc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Result
<
Vc
<
Box
<
dyn
ChunkItem
>>>
{
)
->
Result
<
Vc
<
Box
<
dyn
Chunk
ed
Item
>>>
{
let
item
=
chunking_context
.chunk_item
(
let
item
=
chunking_context
.chunk_item
(
Vc
::
upcast
(
self
.proxy_module
()),
Vc
::
upcast
(
self
.proxy_module
()),
module_graph
,
module_graph
,
...
@@ -310,7 +310,7 @@ struct EcmascriptClientReferenceProxyChunkItem {
...
@@ -310,7 +310,7 @@ struct EcmascriptClientReferenceProxyChunkItem {
impl
OutputAssetsReference
for
EcmascriptClientReferenceProxyChunkItem
{}
impl
OutputAssetsReference
for
EcmascriptClientReferenceProxyChunkItem
{}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkItem
for
EcmascriptClientReferenceProxyChunkItem
{
impl
Chunk
ed
Item
for
EcmascriptClientReferenceProxyChunkItem
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
fn
asset_ident
(
&
self
)
->
Vc
<
AssetIdent
>
{
fn
asset_ident
(
&
self
)
->
Vc
<
AssetIdent
>
{
self
.inner_module
.ident
()
self
.inner_module
.ident
()
...
...
turbopack/crates/turbopack-browser/src/chunking_context.rs
View file @
3e95502a
...
@@ -11,7 +11,7 @@ use turbo_tasks_hash::{DeterministicHash, HashAlgorithm};
...
@@ -11,7 +11,7 @@ use turbo_tasks_hash::{DeterministicHash, HashAlgorithm};
use
turbopack_core
::{
use
turbopack_core
::{
asset
::
Asset
,
asset
::
Asset
,
chunk
::{
chunk
::{
AssetSuffix
,
Chunk
,
ChunkGroupResult
,
ChunkItem
,
ChunkType
,
ChunkableModule
,
AssetSuffix
,
Chunk
,
ChunkGroupResult
,
Chunk
ed
Item
,
ChunkType
,
ChunkableModule
,
ChunkingConfig
,
ChunkingConfigs
,
ChunkingContext
,
ChunkingContextExt
,
ChunkingConfig
,
ChunkingConfigs
,
ChunkingContext
,
ChunkingContextExt
,
EntryChunkGroupResult
,
EvaluatableAsset
,
EvaluatableAssets
,
MinifyType
,
EntryChunkGroupResult
,
EvaluatableAsset
,
EvaluatableAssets
,
MinifyType
,
SourceMapSourceType
,
SourceMapsType
,
UnusedReferences
,
UrlBehavior
,
SourceMapSourceType
,
SourceMapsType
,
UnusedReferences
,
UrlBehavior
,
...
@@ -907,7 +907,7 @@ impl ChunkingContext for BrowserChunkingContext {
...
@@ -907,7 +907,7 @@ impl ChunkingContext for BrowserChunkingContext {
module
:
Vc
<
Box
<
dyn
ChunkableModule
>>
,
module
:
Vc
<
Box
<
dyn
ChunkableModule
>>
,
module_graph
:
Vc
<
ModuleGraph
>
,
module_graph
:
Vc
<
ModuleGraph
>
,
availability_info
:
AvailabilityInfo
,
availability_info
:
AvailabilityInfo
,
)
->
Result
<
Vc
<
Box
<
dyn
ChunkItem
>>>
{
)
->
Result
<
Vc
<
Box
<
dyn
Chunk
ed
Item
>>>
{
let
chunking_context
=
ResolvedVc
::
upcast
::
<
Box
<
dyn
ChunkingContext
>>
(
self
);
let
chunking_context
=
ResolvedVc
::
upcast
::
<
Box
<
dyn
ChunkingContext
>>
(
self
);
Ok
(
if
self
.await
?
.manifest_chunks
{
Ok
(
if
self
.await
?
.manifest_chunks
{
let
manifest_asset
=
ManifestAsyncModule
::
new
(
let
manifest_asset
=
ManifestAsyncModule
::
new
(
...
...
turbopack/crates/turbopack-core/src/chunk/chunk_id_strategy.rs
View file @
3e95502a
...
@@ -7,7 +7,7 @@ use turbo_tasks::{
...
@@ -7,7 +7,7 @@ use turbo_tasks::{
use
turbo_tasks_hash
::
hash_xxh3_hash64
;
use
turbo_tasks_hash
::
hash_xxh3_hash64
;
use
super
::
ModuleId
;
use
super
::
ModuleId
;
use
crate
::{
chunk
::
ChunkItem
,
ident
::
AssetIdent
,
module
::
Module
};
use
crate
::{
chunk
::
Chunk
ed
Item
,
ident
::
AssetIdent
,
module
::
Module
};
#[turbo_tasks
::
value(transparent,
cell
=
"keyed"
)]
#[turbo_tasks
::
value(transparent,
cell
=
"keyed"
)]
pub
struct
ModuleIds
(
FxHashMap
<
ResolvedVc
<
AssetIdent
>
,
ModuleId
>
);
pub
struct
ModuleIds
(
FxHashMap
<
ResolvedVc
<
AssetIdent
>
,
ModuleId
>
);
...
@@ -29,7 +29,7 @@ pub struct ModuleIdStrategy {
...
@@ -29,7 +29,7 @@ pub struct ModuleIdStrategy {
}
}
impl
ModuleIdStrategy
{
impl
ModuleIdStrategy
{
pub
async
fn
get_id
(
&
self
,
chunk_item
:
Vc
<
Box
<
dyn
ChunkItem
>>
)
->
Result
<
ModuleId
>
{
pub
async
fn
get_id
(
&
self
,
chunk_item
:
Vc
<
Box
<
dyn
Chunk
ed
Item
>>
)
->
Result
<
ModuleId
>
{
let
ident
=
chunk_item
.asset_ident
();
let
ident
=
chunk_item
.asset_ident
();
self
.get_id_from_ident
(
ident
)
.await
self
.get_id_from_ident
(
ident
)
.await
}
}
...
...
turbopack/crates/turbopack-core/src/chunk/chunk_item_batch.rs
View file @
3e95502a
...
@@ -12,7 +12,7 @@ use turbo_tasks::{
...
@@ -12,7 +12,7 @@ use turbo_tasks::{
use
crate
::{
use
crate
::{
chunk
::{
chunk
::{
ChunkItem
,
ChunkItemWithAsyncModuleInfo
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
Chunk
ed
Item
,
ChunkItemWithAsyncModuleInfo
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
chunking_context
::
ChunkingContextExt
,
chunking_context
::
ChunkingContextExt
,
},
},
module_graph
::{
module_graph
::{
...
...
turbopack/crates/turbopack-core/src/chunk/chunking/dev.rs
View file @
3e95502a
...
@@ -8,7 +8,7 @@ use tracing::Level;
...
@@ -8,7 +8,7 @@ use tracing::Level;
use
turbo_tasks
::{
FxIndexMap
,
ResolvedVc
,
TryJoinIterExt
,
ValueToString
};
use
turbo_tasks
::{
FxIndexMap
,
ResolvedVc
,
TryJoinIterExt
,
ValueToString
};
use
crate
::
chunk
::{
use
crate
::
chunk
::{
ChunkItem
,
ChunkItemWithAsyncModuleInfo
,
ChunkType
,
ChunkingContext
,
Chunk
ed
Item
,
ChunkItemWithAsyncModuleInfo
,
ChunkType
,
ChunkingContext
,
chunking
::{
ChunkItemOrBatchWithInfo
,
SplitContext
,
make_chunk
},
chunking
::{
ChunkItemOrBatchWithInfo
,
SplitContext
,
make_chunk
},
};
};
...
...
turbopack/crates/turbopack-core/src/chunk/chunking/mod.rs
View file @
3e95502a
...
@@ -13,7 +13,7 @@ use turbo_tasks::{
...
@@ -13,7 +13,7 @@ use turbo_tasks::{
use
crate
::{
use
crate
::{
chunk
::{
chunk
::{
Chunk
,
ChunkItem
,
ChunkItemWithAsyncModuleInfo
,
ChunkType
,
ChunkingContext
,
Chunks
,
Chunk
,
Chunk
ed
Item
,
ChunkItemWithAsyncModuleInfo
,
ChunkType
,
ChunkingContext
,
Chunks
,
batch_info
,
batch_info
,
chunk_item_batch
::{
chunk_item_batch
::{
ChunkItemBatchGroup
,
ChunkItemBatchGroups
,
ChunkItemBatchWithAsyncModuleInfo
,
ChunkItemBatchGroup
,
ChunkItemBatchGroups
,
ChunkItemBatchWithAsyncModuleInfo
,
...
@@ -33,7 +33,7 @@ mod production;
...
@@ -33,7 +33,7 @@ mod production;
mod
style_production
;
mod
style_production
;
#[turbo_tasks
::
value]
#[turbo_tasks
::
value]
struct
ChunkItemsWithInfo
{
struct
Chunk
ed
ItemsWithInfo
{
#[allow(clippy
::
type_complexity)]
#[allow(clippy
::
type_complexity)]
by_type
:
SmallVec
<
by_type
:
SmallVec
<
[(
[(
...
@@ -45,8 +45,8 @@ struct ChunkItemsWithInfo {
...
@@ -45,8 +45,8 @@ struct ChunkItemsWithInfo {
}
}
#[turbo_tasks
::
value(transparent)]
#[turbo_tasks
::
value(transparent)]
struct
BatchChunkItemsWithInfo
(
struct
BatchChunk
ed
ItemsWithInfo
(
FxHashMap
<
ChunkItemOrBatchWithAsyncModuleInfo
,
ResolvedVc
<
ChunkItemsWithInfo
>>
,
FxHashMap
<
ChunkItemOrBatchWithAsyncModuleInfo
,
ResolvedVc
<
Chunk
ed
ItemsWithInfo
>>
,
);
);
#[derive(Clone,
PartialEq,
Eq,
TraceRawVcs,
NonLocalValue,
ValueDebugFormat,
Encode,
Decode)]
#[derive(Clone,
PartialEq,
Eq,
TraceRawVcs,
NonLocalValue,
ValueDebugFormat,
Encode,
Decode)]
...
@@ -101,7 +101,7 @@ async fn batch_size(
...
@@ -101,7 +101,7 @@ async fn batch_size(
async
fn
plain_chunk_items_with_info
(
async
fn
plain_chunk_items_with_info
(
chunk_item_or_batch
:
ChunkItemOrBatchWithAsyncModuleInfo
,
chunk_item_or_batch
:
ChunkItemOrBatchWithAsyncModuleInfo
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Result
<
ChunkItemsWithInfo
>
{
)
->
Result
<
Chunk
ed
ItemsWithInfo
>
{
Ok
(
match
chunk_item_or_batch
{
Ok
(
match
chunk_item_or_batch
{
ChunkItemOrBatchWithAsyncModuleInfo
::
ChunkItem
(
chunk_item_with_info
)
=>
{
ChunkItemOrBatchWithAsyncModuleInfo
::
ChunkItem
(
chunk_item_with_info
)
=>
{
let
ChunkItemWithAsyncModuleInfo
{
let
ChunkItemWithAsyncModuleInfo
{
...
@@ -115,7 +115,7 @@ async fn plain_chunk_items_with_info(
...
@@ -115,7 +115,7 @@ async fn plain_chunk_items_with_info(
let
chunk_item_size
=
let
chunk_item_size
=
ty
.chunk_item_size
(
chunking_context
,
*
chunk_item
,
async_info
.map
(|
info
|
*
info
));
ty
.chunk_item_size
(
chunking_context
,
*
chunk_item
,
async_info
.map
(|
info
|
*
info
));
ChunkItemsWithInfo
{
Chunk
ed
ItemsWithInfo
{
by_type
:
smallvec!
[(
by_type
:
smallvec!
[(
ty
.to_resolved
()
.await
?
,
ty
.to_resolved
()
.await
?
,
smallvec!
[
ChunkItemOrBatchWithInfo
::
ChunkItem
{
smallvec!
[
ChunkItemOrBatchWithInfo
::
ChunkItem
{
...
@@ -141,7 +141,7 @@ async fn plain_chunk_items_with_info(
...
@@ -141,7 +141,7 @@ async fn plain_chunk_items_with_info(
})
})
.try_join
()
.try_join
()
.await
?
;
.await
?
;
ChunkItemsWithInfo
{
Chunk
ed
ItemsWithInfo
{
by_type
:
by_type
.into_iter
()
.collect
(),
by_type
:
by_type
.into_iter
()
.collect
(),
}
}
}
}
...
@@ -194,7 +194,7 @@ async fn plain_chunk_items_with_info_with_type(
...
@@ -194,7 +194,7 @@ async fn plain_chunk_items_with_info_with_type(
async
fn
chunk_items_with_info
(
async
fn
chunk_items_with_info
(
chunk_item_or_batch
:
ChunkItemOrBatchWithAsyncModuleInfo
,
chunk_item_or_batch
:
ChunkItemOrBatchWithAsyncModuleInfo
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Result
<
Vc
<
ChunkItemsWithInfo
>>
{
)
->
Result
<
Vc
<
Chunk
ed
ItemsWithInfo
>>
{
let
chunk_items_with_info
=
let
chunk_items_with_info
=
plain_chunk_items_with_info
(
chunk_item_or_batch
,
chunking_context
)
.await
?
;
plain_chunk_items_with_info
(
chunk_item_or_batch
,
chunking_context
)
.await
?
;
Ok
(
chunk_items_with_info
.cell
())
Ok
(
chunk_items_with_info
.cell
())
...
@@ -206,7 +206,7 @@ async fn chunk_items_with_info_with_type(
...
@@ -206,7 +206,7 @@ async fn chunk_items_with_info_with_type(
ty
:
ResolvedVc
<
Box
<
dyn
ChunkType
>>
,
ty
:
ResolvedVc
<
Box
<
dyn
ChunkType
>>
,
batch_group
:
Option
<
ResolvedVc
<
ChunkItemBatchGroup
>>
,
batch_group
:
Option
<
ResolvedVc
<
ChunkItemBatchGroup
>>
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Result
<
Vc
<
ChunkItemsWithInfo
>>
{
)
->
Result
<
Vc
<
Chunk
ed
ItemsWithInfo
>>
{
let
result
=
plain_chunk_items_with_info_with_type
(
let
result
=
plain_chunk_items_with_info_with_type
(
&
chunk_item_or_batch
,
&
chunk_item_or_batch
,
ty
,
ty
,
...
@@ -214,7 +214,7 @@ async fn chunk_items_with_info_with_type(
...
@@ -214,7 +214,7 @@ async fn chunk_items_with_info_with_type(
chunking_context
,
chunking_context
,
)
)
.await
?
;
.await
?
;
Ok
(
ChunkItemsWithInfo
{
Ok
(
Chunk
ed
ItemsWithInfo
{
by_type
:
smallvec!
[
result
],
by_type
:
smallvec!
[
result
],
}
}
.cell
())
.cell
())
...
@@ -224,7 +224,7 @@ async fn chunk_items_with_info_with_type(
...
@@ -224,7 +224,7 @@ async fn chunk_items_with_info_with_type(
async
fn
batch_chunk_items_with_info
(
async
fn
batch_chunk_items_with_info
(
batch_group
:
Vc
<
ChunkItemBatchGroup
>
,
batch_group
:
Vc
<
ChunkItemBatchGroup
>
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Result
<
Vc
<
BatchChunkItemsWithInfo
>>
{
)
->
Result
<
Vc
<
BatchChunk
ed
ItemsWithInfo
>>
{
let
split_batch_group
=
batch_group
.split_by_chunk_type
()
.await
?
;
let
split_batch_group
=
batch_group
.split_by_chunk_type
()
.await
?
;
if
split_batch_group
.len
()
==
1
{
if
split_batch_group
.len
()
==
1
{
let
&
(
ty
,
batch
)
=
split_batch_group
.into_iter
()
.next
()
.unwrap
();
let
&
(
ty
,
batch
)
=
split_batch_group
.into_iter
()
.next
()
.unwrap
();
...
@@ -255,7 +255,7 @@ async fn batch_chunk_items_with_info_with_type(
...
@@ -255,7 +255,7 @@ async fn batch_chunk_items_with_info_with_type(
batch_group
:
Vc
<
ChunkItemBatchGroup
>
,
batch_group
:
Vc
<
ChunkItemBatchGroup
>
,
ty
:
Vc
<
Box
<
dyn
ChunkType
>>
,
ty
:
Vc
<
Box
<
dyn
ChunkType
>>
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Result
<
Vc
<
BatchChunkItemsWithInfo
>>
{
)
->
Result
<
Vc
<
BatchChunk
ed
ItemsWithInfo
>>
{
let
map
=
batch_group
let
map
=
batch_group
.await
?
.await
?
.items
.items
...
@@ -298,7 +298,7 @@ pub async fn make_chunks(
...
@@ -298,7 +298,7 @@ pub async fn make_chunks(
chunk_items_or_batches
=
chunk_items_or_batches
.len
(),
chunk_items_or_batches
=
chunk_items_or_batches
.len
(),
batch_groups
=
batch_groups
.len
()
batch_groups
=
batch_groups
.len
()
);
);
let
chunk_items
:
Vec
<
ReadRef
<
ChunkItemsWithInfo
>>
=
batch_info
(
let
chunk_items
:
Vec
<
ReadRef
<
Chunk
ed
ItemsWithInfo
>>
=
batch_info
(
&
batch_groups
,
&
batch_groups
,
&
chunk_items_or_batches
,
&
chunk_items_or_batches
,
|
batch_group
|
batch_chunk_items_with_info
(
batch_group
,
*
chunking_context
)
.into_future
(),
|
batch_group
|
batch_chunk_items_with_info
(
batch_group
,
*
chunking_context
)
.into_future
(),
...
...
turbopack/crates/turbopack-core/src/chunk/chunking/production.rs
View file @
3e95502a
...
@@ -40,12 +40,12 @@ pub async fn make_production_chunks(
...
@@ -40,12 +40,12 @@ pub async fn make_production_chunks(
let
merged_modules
=
module_graph
.merged_modules
()
.await
?
;
let
merged_modules
=
module_graph
.merged_modules
()
.await
?
;
#[derive(Default)]
#[derive(Default)]
struct
GroupedChunkItems
<
'l
>
{
struct
GroupedChunk
ed
Items
<
'l
>
{
chunk_items
:
Vec
<&
'l
ChunkItemOrBatchWithInfo
>
,
chunk_items
:
Vec
<&
'l
ChunkItemOrBatchWithInfo
>
,
batch_group
:
Option
<
ResolvedVc
<
ChunkItemBatchGroup
>>
,
batch_group
:
Option
<
ResolvedVc
<
ChunkItemBatchGroup
>>
,
}
}
let
mut
grouped_chunk_items
=
FxIndexMap
::
<
_
,
GroupedChunkItems
<
'_
>>
::
default
();
let
mut
grouped_chunk_items
=
FxIndexMap
::
<
_
,
GroupedChunk
ed
Items
<
'_
>>
::
default
();
enum
Prepared
{
enum
Prepared
{
ChunkItem
(
MappedReadRef
<
ModuleToChunkGroups
,
RoaringBitmapWrapper
>
),
ChunkItem
(
MappedReadRef
<
ModuleToChunkGroups
,
RoaringBitmapWrapper
>
),
...
@@ -143,7 +143,7 @@ pub async fn make_production_chunks(
...
@@ -143,7 +143,7 @@ pub async fn make_production_chunks(
.map
(
.map
(
|(
|(
key
,
key
,
GroupedChunkItems
{
GroupedChunk
ed
Items
{
chunk_items
,
chunk_items
,
batch_group
,
batch_group
,
},
},
...
...
turbopack/crates/turbopack-core/src/chunk/chunking_context.rs
View file @
3e95502a
...
@@ -12,7 +12,7 @@ use turbo_tasks_hash::DeterministicHash;
...
@@ -12,7 +12,7 @@ use turbo_tasks_hash::DeterministicHash;
use
crate
::{
use
crate
::{
asset
::
Asset
,
asset
::
Asset
,
chunk
::{
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
EvaluatableAssets
,
Chunk
ed
Item
,
ChunkType
,
ChunkableModule
,
EvaluatableAssets
,
availability_info
::
AvailabilityInfo
,
chunk_id_strategy
::
ModuleIdStrategy
,
availability_info
::
AvailabilityInfo
,
chunk_id_strategy
::
ModuleIdStrategy
,
},
},
environment
::
Environment
,
environment
::
Environment
,
...
@@ -430,7 +430,7 @@ pub trait ChunkingContext {
...
@@ -430,7 +430,7 @@ pub trait ChunkingContext {
module
:
Vc
<
Box
<
dyn
ChunkableModule
>>
,
module
:
Vc
<
Box
<
dyn
ChunkableModule
>>
,
module_graph
:
Vc
<
ModuleGraph
>
,
module_graph
:
Vc
<
ModuleGraph
>
,
availability_info
:
AvailabilityInfo
,
availability_info
:
AvailabilityInfo
,
)
->
Vc
<
Box
<
dyn
ChunkItem
>>
;
)
->
Vc
<
Box
<
dyn
Chunk
ed
Item
>>
;
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
fn
async_loader_chunk_item_ident
(
&
self
,
module
:
Vc
<
Box
<
dyn
ChunkableModule
>>
)
fn
async_loader_chunk_item_ident
(
&
self
,
module
:
Vc
<
Box
<
dyn
ChunkableModule
>>
)
->
Vc
<
AssetIdent
>
;
->
Vc
<
AssetIdent
>
;
...
@@ -586,7 +586,7 @@ pub trait ChunkingContextExt {
...
@@ -586,7 +586,7 @@ pub trait ChunkingContextExt {
self
:
Vc
<
Self
>
,
self
:
Vc
<
Self
>
,
module
:
Vc
<
Box
<
dyn
Module
>>
,
module
:
Vc
<
Box
<
dyn
Module
>>
,
module_graph
:
Vc
<
ModuleGraph
>
,
module_graph
:
Vc
<
ModuleGraph
>
,
)
->
Vc
<
Box
<
dyn
ChunkItem
>>
)
->
Vc
<
Box
<
dyn
Chunk
ed
Item
>>
where
where
Self
:
Send
;
Self
:
Send
;
}
}
...
@@ -712,7 +712,7 @@ impl<T: ChunkingContext + Send + Upcast<Box<dyn ChunkingContext>>> ChunkingConte
...
@@ -712,7 +712,7 @@ impl<T: ChunkingContext + Send + Upcast<Box<dyn ChunkingContext>>> ChunkingConte
self
:
Vc
<
Self
>
,
self
:
Vc
<
Self
>
,
module
:
Vc
<
Box
<
dyn
Module
>>
,
module
:
Vc
<
Box
<
dyn
Module
>>
,
module_graph
:
Vc
<
ModuleGraph
>
,
module_graph
:
Vc
<
ModuleGraph
>
,
)
->
Vc
<
Box
<
dyn
ChunkItem
>>
{
)
->
Vc
<
Box
<
dyn
Chunk
ed
Item
>>
{
chunk_item
(
Vc
::
upcast_non_strict
(
self
),
module
,
module_graph
)
chunk_item
(
Vc
::
upcast_non_strict
(
self
),
module
,
module_graph
)
}
}
}
}
...
@@ -722,7 +722,7 @@ async fn chunk_item(
...
@@ -722,7 +722,7 @@ async fn chunk_item(
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
module
:
Vc
<
Box
<
dyn
Module
>>
,
module
:
Vc
<
Box
<
dyn
Module
>>
,
module_graph
:
Vc
<
ModuleGraph
>
,
module_graph
:
Vc
<
ModuleGraph
>
,
)
->
Result
<
Vc
<
Box
<
dyn
ChunkItem
>>>
{
)
->
Result
<
Vc
<
Box
<
dyn
Chunk
ed
Item
>>>
{
let
module
=
module
.to_resolved
()
.await
?
;
let
module
=
module
.to_resolved
()
.await
?
;
let
Some
(
chunkable
)
=
ResolvedVc
::
try_sidecast
::
<
Box
<
dyn
ChunkableModule
>>
(
module
)
else
{
let
Some
(
chunkable
)
=
ResolvedVc
::
try_sidecast
::
<
Box
<
dyn
ChunkableModule
>>
(
module
)
else
{
bail!
(
bail!
(
...
...
turbopack/crates/turbopack-core/src/chunk/mod.rs
View file @
3e95502a
...
@@ -85,7 +85,7 @@ pub trait ChunkableModule: Module {
...
@@ -85,7 +85,7 @@ pub trait ChunkableModule: Module {
self
:
Vc
<
Self
>
,
self
:
Vc
<
Self
>
,
module_graph
:
Vc
<
ModuleGraph
>
,
module_graph
:
Vc
<
ModuleGraph
>
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
ChunkItem
>>
;
)
->
Vc
<
Box
<
dyn
Chunk
ed
Item
>>
;
}
}
/// Implements `ChunkableModule` for a type that implements `EcmascriptChunkPlaceable`.
/// Implements `ChunkableModule` for a type that implements `EcmascriptChunkPlaceable`.
...
@@ -113,7 +113,7 @@ macro_rules! chunk_item {
...
@@ -113,7 +113,7 @@ macro_rules! chunk_item {
chunking_context
:
turbo_tasks
::
ResolvedVc
<
chunking_context
:
turbo_tasks
::
ResolvedVc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkingContext
>
,
Box
<
dyn
turbopack_core
::
chunk
::
ChunkingContext
>
,
>
,
>
,
)
->
turbo_tasks
::
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
Chunk
Item
>>
{
)
->
turbo_tasks
::
Vc
<
Box
<
dyn
Chunked
Item
>>
{
$chunk_item_fn
(
$chunk_item_fn
(
turbo_tasks
::
ResolvedVc
::
upcast
(
self
),
turbo_tasks
::
ResolvedVc
::
upcast
(
self
),
module_graph
,
module_graph
,
...
@@ -425,7 +425,7 @@ pub struct ChunkGroupContent {
...
@@ -425,7 +425,7 @@ pub struct ChunkGroupContent {
}
}
#[turbo_tasks
::
value_trait]
#[turbo_tasks
::
value_trait]
pub
trait
ChunkItem
:
OutputAssetsReference
{
pub
trait
Chunk
ed
Item
:
OutputAssetsReference
{
/// The [AssetIdent] of the [Module] that this [ChunkItem] was created from.
/// The [AssetIdent] of the [Module] that this [ChunkItem] was created from.
/// For most chunk types this must uniquely identify the chunk item at
/// For most chunk types this must uniquely identify the chunk item at
/// runtime as it's the source of the module id used at runtime.
/// runtime as it's the source of the module id used at runtime.
...
@@ -473,7 +473,7 @@ pub trait ChunkType: ValueToString {
...
@@ -473,7 +473,7 @@ pub trait ChunkType: ValueToString {
fn
chunk_item_size
(
fn
chunk_item_size
(
&
self
,
&
self
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
chunk_item
:
Vc
<
Box
<
dyn
ChunkItem
>>
,
chunk_item
:
Vc
<
Box
<
dyn
Chunk
ed
Item
>>
,
async_module_info
:
Option
<
Vc
<
AsyncModuleInfo
>>
,
async_module_info
:
Option
<
Vc
<
AsyncModuleInfo
>>
,
)
->
Vc
<
usize
>
;
)
->
Vc
<
usize
>
;
}
}
...
@@ -484,7 +484,15 @@ pub fn round_chunk_item_size(size: usize) -> usize {
...
@@ -484,7 +484,15 @@ pub fn round_chunk_item_size(size: usize) -> usize {
}
}
#[turbo_tasks
::
value(transparent)]
#[turbo_tasks
::
value(transparent)]
pub
struct
ChunkItems
(
pub
Vec
<
ResolvedVc
<
Box
<
dyn
ChunkItem
>>>
);
pub
struct
ChunkItems
(
pub
Vec
<
ResolvedVc
<
Box
<
dyn
ChunkedItem
>>>
);
/// A wrapper around a `ResolvedVc<Box<dyn ChunkedItem>>` that provides direct method access
/// without needing the `ChunkedItem` trait in scope.
#[derive(
Debug,
Clone,
PartialEq,
Eq,
Hash,
TraceRawVcs,
NonLocalValue,
TaskInput,
Encode,
Decode,
)]
#[repr(transparent)]
pub
struct
ChunkItem
(
pub
ResolvedVc
<
Box
<
dyn
ChunkedItem
>>
);
#[turbo_tasks
::
value]
#[turbo_tasks
::
value]
pub
struct
AsyncModuleInfo
{
pub
struct
AsyncModuleInfo
{
...
@@ -506,13 +514,13 @@ impl AsyncModuleInfo {
...
@@ -506,13 +514,13 @@ impl AsyncModuleInfo {
Debug,
Clone,
PartialEq,
Eq,
Hash,
TraceRawVcs,
TaskInput,
NonLocalValue,
Encode,
Decode,
Debug,
Clone,
PartialEq,
Eq,
Hash,
TraceRawVcs,
TaskInput,
NonLocalValue,
Encode,
Decode,
)]
)]
pub
struct
ChunkItemWithAsyncModuleInfo
{
pub
struct
ChunkItemWithAsyncModuleInfo
{
pub
chunk_item
:
ResolvedVc
<
Box
<
dyn
ChunkItem
>>
,
pub
chunk_item
:
ResolvedVc
<
Box
<
dyn
Chunk
ed
Item
>>
,
pub
module
:
Option
<
ResolvedVc
<
Box
<
dyn
ChunkableModule
>>>
,
pub
module
:
Option
<
ResolvedVc
<
Box
<
dyn
ChunkableModule
>>>
,
pub
async_info
:
Option
<
ResolvedVc
<
AsyncModuleInfo
>>
,
pub
async_info
:
Option
<
ResolvedVc
<
AsyncModuleInfo
>>
,
}
}
#[turbo_tasks
::
value(transparent)]
#[turbo_tasks
::
value(transparent)]
pub
struct
ChunkItemsWithAsyncModuleInfo
(
Vec
<
ChunkItemWithAsyncModuleInfo
>
);
pub
struct
Chunk
ed
ItemsWithAsyncModuleInfo
(
Vec
<
ChunkItemWithAsyncModuleInfo
>
);
pub
trait
ChunkItemExt
{
pub
trait
ChunkItemExt
{
/// Returns the module id of this chunk item.
/// Returns the module id of this chunk item.
...
@@ -521,7 +529,7 @@ pub trait ChunkItemExt {
...
@@ -521,7 +529,7 @@ pub trait ChunkItemExt {
impl
<
T
>
ChunkItemExt
for
T
impl
<
T
>
ChunkItemExt
for
T
where
where
T
:
Upcast
<
Box
<
dyn
ChunkItem
>>
+
Send
,
T
:
Upcast
<
Box
<
dyn
Chunk
ed
Item
>>
+
Send
,
{
{
/// Returns the module id of this chunk item.
/// Returns the module id of this chunk item.
async
fn
id
(
self
:
Vc
<
Self
>
)
->
Result
<
ModuleId
>
{
async
fn
id
(
self
:
Vc
<
Self
>
)
->
Result
<
ModuleId
>
{
...
...
turbopack/crates/turbopack-core/src/module_graph/style_groups.rs
View file @
3e95502a
...
@@ -12,7 +12,7 @@ use turbo_tasks::{
...
@@ -12,7 +12,7 @@ use turbo_tasks::{
use
crate
::{
use
crate
::{
chunk
::{
chunk
::{
ChunkItem
,
ChunkItemBatchWithAsyncModuleInfo
,
ChunkItemWithAsyncModuleInfo
,
ChunkType
,
Chunk
ed
Item
,
ChunkItemBatchWithAsyncModuleInfo
,
ChunkItemWithAsyncModuleInfo
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
chunk_item_batch
::
attach_async_info_to_chunkable_module
,
ChunkableModule
,
ChunkingContext
,
chunk_item_batch
::
attach_async_info_to_chunkable_module
,
},
},
module
::{
Module
,
StyleModule
,
StyleType
},
module
::{
Module
,
StyleModule
,
StyleType
},
...
...
turbopack/crates/turbopack-css/src/asset.rs
View file @
3e95502a
...
@@ -3,7 +3,7 @@ use turbo_rcstr::rcstr;
...
@@ -3,7 +3,7 @@ use turbo_rcstr::rcstr;
use
turbo_tasks
::{
IntoTraitRef
,
ResolvedVc
,
TryJoinIterExt
,
ValueToString
,
Vc
};
use
turbo_tasks
::{
IntoTraitRef
,
ResolvedVc
,
TryJoinIterExt
,
ValueToString
,
Vc
};
use
turbo_tasks_fs
::{
FileContent
,
FileSystemPath
};
use
turbo_tasks_fs
::{
FileContent
,
FileSystemPath
};
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
ChunkingContextExt
,
MinifyType
},
chunk
::{
Chunk
ed
Item
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
ChunkingContextExt
,
MinifyType
},
context
::
AssetContext
,
context
::
AssetContext
,
environment
::
Environment
,
environment
::
Environment
,
ident
::
AssetIdent
,
ident
::
AssetIdent
,
...
@@ -177,7 +177,7 @@ impl ChunkableModule for CssModuleAsset {
...
@@ -177,7 +177,7 @@ impl ChunkableModule for CssModuleAsset {
self
:
ResolvedVc
<
Self
>
,
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
Chunk
Item
>>
{
)
->
Vc
<
Box
<
dyn
Chunked
Item
>>
{
Vc
::
upcast
(
CssModuleChunkItem
::
cell
(
CssModuleChunkItem
{
Vc
::
upcast
(
CssModuleChunkItem
::
cell
(
CssModuleChunkItem
{
module
:
self
,
module
:
self
,
module_graph
,
module_graph
,
...
@@ -231,7 +231,7 @@ impl OutputAssetsReference for CssModuleChunkItem {
...
@@ -231,7 +231,7 @@ impl OutputAssetsReference for CssModuleChunkItem {
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkItem
for
CssModuleChunkItem
{
impl
Chunk
ed
Item
for
CssModuleChunkItem
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
fn
asset_ident
(
&
self
)
->
Vc
<
AssetIdent
>
{
fn
asset_ident
(
&
self
)
->
Vc
<
AssetIdent
>
{
self
.module
.ident
()
self
.module
.ident
()
...
...
turbopack/crates/turbopack-css/src/chunk/mod.rs
View file @
3e95502a
...
@@ -13,7 +13,7 @@ use turbo_tasks_fs::{
...
@@ -13,7 +13,7 @@ use turbo_tasks_fs::{
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
asset
::{
Asset
,
AssetContent
},
chunk
::{
chunk
::{
AsyncModuleInfo
,
Chunk
,
ChunkItem
,
ChunkItemBatchGroup
,
ChunkItemExt
,
AsyncModuleInfo
,
Chunk
,
Chunk
ed
Item
,
ChunkItemBatchGroup
,
ChunkItemExt
,
ChunkItemOrBatchWithAsyncModuleInfo
,
ChunkItemWithAsyncModuleInfo
,
ChunkType
,
ChunkItemOrBatchWithAsyncModuleInfo
,
ChunkItemWithAsyncModuleInfo
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
ChunkingContextExt
,
MinifyType
,
OutputChunk
,
ChunkableModule
,
ChunkingContext
,
ChunkingContextExt
,
MinifyType
,
OutputChunk
,
OutputChunkRuntimeInfo
,
SourceMapSourceType
,
round_chunk_item_size
,
OutputChunkRuntimeInfo
,
SourceMapSourceType
,
round_chunk_item_size
,
...
@@ -464,7 +464,7 @@ pub struct CssChunkItemContent {
...
@@ -464,7 +464,7 @@ pub struct CssChunkItemContent {
}
}
#[turbo_tasks
::
value_trait]
#[turbo_tasks
::
value_trait]
pub
trait
CssChunkItem
:
ChunkItem
+
OutputAssetsReference
{
pub
trait
CssChunkItem
:
Chunk
ed
Item
+
OutputAssetsReference
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
fn
content
(
self
:
Vc
<
Self
>
)
->
Vc
<
CssChunkItemContent
>
;
fn
content
(
self
:
Vc
<
Self
>
)
->
Vc
<
CssChunkItemContent
>
;
}
}
...
@@ -577,7 +577,7 @@ impl ChunkType for CssChunkType {
...
@@ -577,7 +577,7 @@ impl ChunkType for CssChunkType {
async
fn
chunk_item_size
(
async
fn
chunk_item_size
(
&
self
,
&
self
,
_chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
_chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
chunk_item
:
ResolvedVc
<
Box
<
dyn
ChunkItem
>>
,
chunk_item
:
ResolvedVc
<
Box
<
dyn
Chunk
ed
Item
>>
,
_async_module_info
:
Option
<
Vc
<
AsyncModuleInfo
>>
,
_async_module_info
:
Option
<
Vc
<
AsyncModuleInfo
>>
,
)
->
Result
<
Vc
<
usize
>>
{
)
->
Result
<
Vc
<
usize
>>
{
let
Some
(
chunk_item
)
=
ResolvedVc
::
try_downcast
::
<
Box
<
dyn
CssChunkItem
>>
(
chunk_item
)
else
{
let
Some
(
chunk_item
)
=
ResolvedVc
::
try_downcast
::
<
Box
<
dyn
CssChunkItem
>>
(
chunk_item
)
else
{
...
...
turbopack/crates/turbopack-css/src/chunk/single_item_chunk/chunk.rs
View file @
3e95502a
...
@@ -6,7 +6,7 @@ use turbo_tasks::{ResolvedVc, ValueToString, Vc};
...
@@ -6,7 +6,7 @@ use turbo_tasks::{ResolvedVc, ValueToString, Vc};
use
turbo_tasks_fs
::{
File
,
FileContent
,
FileSystemPath
,
rope
::
RopeBuilder
};
use
turbo_tasks_fs
::{
File
,
FileContent
,
FileSystemPath
,
rope
::
RopeBuilder
};
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
asset
::{
Asset
,
AssetContent
},
chunk
::{
Chunk
,
ChunkItem
,
ChunkingContext
,
MinifyType
},
chunk
::{
Chunk
,
Chunk
ed
Item
,
ChunkingContext
,
MinifyType
},
code_builder
::{
Code
,
CodeBuilder
},
code_builder
::{
Code
,
CodeBuilder
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
introspect
::
Introspectable
,
introspect
::
Introspectable
,
...
...
turbopack/crates/turbopack-ecmascript/src/chunk/chunk_type.rs
View file @
3e95502a
use
anyhow
::{
Result
,
bail
};
use
anyhow
::{
Result
,
bail
};
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
ValueDefault
,
ValueToString
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
ValueDefault
,
ValueToString
,
Vc
};
use
turbopack_core
::
chunk
::{
use
turbopack_core
::
chunk
::{
AsyncModuleInfo
,
Chunk
,
ChunkItem
,
ChunkItemBatchGroup
,
ChunkItemOrBatchWithAsyncModuleInfo
,
AsyncModuleInfo
,
Chunk
,
Chunk
ed
Item
,
ChunkItemBatchGroup
,
ChunkItemOrBatchWithAsyncModuleInfo
,
ChunkType
,
ChunkingContext
,
round_chunk_item_size
,
ChunkType
,
ChunkingContext
,
round_chunk_item_size
,
};
};
...
@@ -50,7 +50,7 @@ impl ChunkType for EcmascriptChunkType {
...
@@ -50,7 +50,7 @@ impl ChunkType for EcmascriptChunkType {
async
fn
chunk_item_size
(
async
fn
chunk_item_size
(
&
self
,
&
self
,
_chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
_chunking_context
:
Vc
<
Box
<
dyn
ChunkingContext
>>
,
chunk_item
:
ResolvedVc
<
Box
<
dyn
ChunkItem
>>
,
chunk_item
:
ResolvedVc
<
Box
<
dyn
Chunk
ed
Item
>>
,
async_module_info
:
Option
<
Vc
<
AsyncModuleInfo
>>
,
async_module_info
:
Option
<
Vc
<
AsyncModuleInfo
>>
,
)
->
Result
<
Vc
<
usize
>>
{
)
->
Result
<
Vc
<
usize
>>
{
let
Some
(
chunk_item
)
=
ResolvedVc
::
try_downcast
::
<
Box
<
dyn
EcmascriptChunkItem
>>
(
chunk_item
)
let
Some
(
chunk_item
)
=
ResolvedVc
::
try_downcast
::
<
Box
<
dyn
EcmascriptChunkItem
>>
(
chunk_item
)
...
...
turbopack/crates/turbopack-ecmascript/src/chunk/content.rs
View file @
3e95502a
...
@@ -3,7 +3,7 @@ use std::future::IntoFuture;
...
@@ -3,7 +3,7 @@ use std::future::IntoFuture;
use
anyhow
::
Result
;
use
anyhow
::
Result
;
use
either
::
Either
;
use
either
::
Either
;
use
turbo_tasks
::{
ReadRef
,
ResolvedVc
,
TryJoinIterExt
,
Vc
};
use
turbo_tasks
::{
ReadRef
,
ResolvedVc
,
TryJoinIterExt
,
Vc
};
use
turbopack_core
::
chunk
::{
ChunkItem
,
ChunkItems
,
batch_info
};
use
turbopack_core
::
chunk
::{
Chunk
ed
Item
,
ChunkItems
,
batch_info
};
use
crate
::
chunk
::{
use
crate
::
chunk
::{
CodeAndIds
,
CodeAndIds
,
...
@@ -41,7 +41,7 @@ impl EcmascriptChunkContent {
...
@@ -41,7 +41,7 @@ impl EcmascriptChunkContent {
Either
::
Right
(
batch
.chunk_items
.iter
()
.map
(|
item
|
item
.chunk_item
))
Either
::
Right
(
batch
.chunk_items
.iter
()
.map
(|
item
|
item
.chunk_item
))
}
}
})
})
.map
(
ResolvedVc
::
upcast
::
<
Box
<
dyn
ChunkItem
>>
)
.map
(
ResolvedVc
::
upcast
::
<
Box
<
dyn
Chunk
ed
Item
>>
)
.collect
(),
.collect
(),
)
)
.cell
())
.cell
())
...
...
turbopack/crates/turbopack-ecmascript/src/chunk/item.rs
View file @
3e95502a
...
@@ -11,7 +11,7 @@ use turbo_tasks::{
...
@@ -11,7 +11,7 @@ use turbo_tasks::{
use
turbo_tasks_fs
::{
FileSystemPath
,
rope
::
Rope
};
use
turbo_tasks_fs
::{
FileSystemPath
,
rope
::
Rope
};
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
chunk
::{
AsyncModuleInfo
,
ChunkItem
,
ChunkItemWithAsyncModuleInfo
,
ChunkType
,
ChunkingContext
,
AsyncModuleInfo
,
Chunk
ed
Item
,
ChunkItemWithAsyncModuleInfo
,
ChunkType
,
ChunkingContext
,
ChunkingContextExt
,
ModuleId
,
SourceMapSourceType
,
ChunkingContextExt
,
ModuleId
,
SourceMapSourceType
,
},
},
code_builder
::{
Code
,
CodeBuilder
},
code_builder
::{
Code
,
CodeBuilder
},
...
@@ -227,7 +227,7 @@ impl EcmascriptChunkItemWithAsyncInfo {
...
@@ -227,7 +227,7 @@ impl EcmascriptChunkItemWithAsyncInfo {
}
}
#[turbo_tasks
::
value_trait]
#[turbo_tasks
::
value_trait]
pub
trait
EcmascriptChunkItem
:
ChunkItem
+
OutputAssetsReference
{
pub
trait
EcmascriptChunkItem
:
Chunk
ed
Item
+
OutputAssetsReference
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
fn
content
(
self
:
Vc
<
Self
>
)
->
Vc
<
EcmascriptChunkItemContent
>
;
fn
content
(
self
:
Vc
<
Self
>
)
->
Vc
<
EcmascriptChunkItemContent
>
;
...
@@ -316,7 +316,7 @@ pub fn ecmascript_chunk_item(
...
@@ -316,7 +316,7 @@ pub fn ecmascript_chunk_item(
module
:
ResolvedVc
<
Box
<
dyn
EcmascriptChunkPlaceable
>>
,
module
:
ResolvedVc
<
Box
<
dyn
EcmascriptChunkPlaceable
>>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
ChunkItem
>>
{
)
->
Vc
<
Box
<
dyn
Chunk
ed
Item
>>
{
Vc
::
upcast
(
Vc
::
upcast
(
EcmascriptModuleChunkItem
{
EcmascriptModuleChunkItem
{
module
,
module
,
...
@@ -328,7 +328,7 @@ pub fn ecmascript_chunk_item(
...
@@ -328,7 +328,7 @@ pub fn ecmascript_chunk_item(
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkItem
for
EcmascriptModuleChunkItem
{
impl
Chunk
ed
Item
for
EcmascriptModuleChunkItem
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
fn
asset_ident
(
&
self
)
->
Vc
<
AssetIdent
>
{
fn
asset_ident
(
&
self
)
->
Vc
<
AssetIdent
>
{
self
.module
.ident
()
self
.module
.ident
()
...
...
turbopack/crates/turbopack-ecmascript/src/chunk/mod.rs
View file @
3e95502a
...
@@ -13,7 +13,7 @@ use turbo_rcstr::{RcStr, rcstr};
...
@@ -13,7 +13,7 @@ use turbo_rcstr::{RcStr, rcstr};
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
ValueToString
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
ValueToString
,
Vc
};
use
turbo_tasks_fs
::
FileSystem
;
use
turbo_tasks_fs
::
FileSystem
;
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
Chunk
,
ChunkItem
,
ChunkItems
,
ChunkingContext
,
ModuleIds
},
chunk
::{
Chunk
,
Chunk
ed
Item
,
ChunkItems
,
ChunkingContext
,
ModuleIds
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
introspect
::{
introspect
::{
Introspectable
,
IntrospectableChildren
,
module
::
IntrospectableModule
,
Introspectable
,
IntrospectableChildren
,
module
::
IntrospectableModule
,
...
...
turbopack/crates/turbopack-nodejs/src/chunking_context.rs
View file @
3e95502a
...
@@ -6,7 +6,7 @@ use turbo_tasks_fs::FileSystemPath;
...
@@ -6,7 +6,7 @@ use turbo_tasks_fs::FileSystemPath;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::
Asset
,
asset
::
Asset
,
chunk
::{
chunk
::{
AssetSuffix
,
Chunk
,
ChunkGroupResult
,
ChunkItem
,
ChunkType
,
ChunkableModule
,
AssetSuffix
,
Chunk
,
ChunkGroupResult
,
Chunk
ed
Item
,
ChunkType
,
ChunkableModule
,
ChunkingConfig
,
ChunkingConfigs
,
ChunkingContext
,
ChunkingContextExt
,
ChunkingConfig
,
ChunkingConfigs
,
ChunkingContext
,
ChunkingContextExt
,
EntryChunkGroupResult
,
EvaluatableAssets
,
MinifyType
,
SourceMapSourceType
,
SourceMapsType
,
EntryChunkGroupResult
,
EvaluatableAssets
,
MinifyType
,
SourceMapSourceType
,
SourceMapsType
,
UnusedReferences
,
UrlBehavior
,
UnusedReferences
,
UrlBehavior
,
...
@@ -639,7 +639,7 @@ impl ChunkingContext for NodeJsChunkingContext {
...
@@ -639,7 +639,7 @@ impl ChunkingContext for NodeJsChunkingContext {
module
:
Vc
<
Box
<
dyn
ChunkableModule
>>
,
module
:
Vc
<
Box
<
dyn
ChunkableModule
>>
,
module_graph
:
Vc
<
ModuleGraph
>
,
module_graph
:
Vc
<
ModuleGraph
>
,
availability_info
:
AvailabilityInfo
,
availability_info
:
AvailabilityInfo
,
)
->
Result
<
Vc
<
Box
<
dyn
ChunkItem
>>>
{
)
->
Result
<
Vc
<
Box
<
dyn
Chunk
ed
Item
>>>
{
let
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
=
let
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
=
Vc
::
upcast
::
<
Box
<
dyn
ChunkingContext
>>
(
self
)
Vc
::
upcast
::
<
Box
<
dyn
ChunkingContext
>>
(
self
)
.to_resolved
()
.to_resolved
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment