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
d21aef63
Commit
d21aef63
authored
Feb 23, 2026
by
Matt Mastracci
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Macro-tize ChunkableModule
parent
0d49dd88
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
110 additions
and
315 deletions
+110
-315
hmr_entry.rs
crates/next-core/src/hmr_entry.rs
+4
-14
dynamic_module.rs
crates/next-core/src/next_dynamic/dynamic_module.rs
+4
-17
server_component_module.rs
...core/src/next_server_component/server_component_module.rs
+4
-17
server_utility_module.rs
...ext-core/src/next_server_utility/server_utility_module.rs
+4
-17
raw_ecmascript_module.rs
crates/next-core/src/raw_ecmascript_module.rs
+3
-13
ident.rs
turbopack/crates/turbo-tasks-macros/src/ident.rs
+1
-0
mod.rs
turbopack/crates/turbopack-core/src/chunk/mod.rs
+36
-0
module_asset.rs
turbopack/crates/turbopack-css/src/module_asset.rs
+3
-16
module.rs
...ack/crates/turbopack-ecmascript/src/async_chunk/module.rs
+2
-12
lib.rs
turbopack/crates/turbopack-ecmascript/src/lib.rs
+4
-15
chunk_asset.rs
...k/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs
+2
-12
loader_module.rs
...crates/turbopack-ecmascript/src/manifest/loader_module.rs
+2
-12
merged_module.rs
turbopack/crates/turbopack-ecmascript/src/merged_module.rs
+4
-17
external_module.rs
...es/turbopack-ecmascript/src/references/external_module.rs
+3
-16
require_context.rs
...es/turbopack-ecmascript/src/references/require_context.rs
+4
-14
module.rs
...-ecmascript/src/side_effect_optimization/facade/module.rs
+5
-15
module.rs
...-ecmascript/src/side_effect_optimization/locals/module.rs
+5
-15
asset.rs
...opack/crates/turbopack-ecmascript/src/tree_shake/asset.rs
+6
-16
side_effect_module.rs
...turbopack-ecmascript/src/tree_shake/side_effect_module.rs
+3
-15
module.rs
...ck/crates/turbopack-ecmascript/src/worker_chunk/module.rs
+2
-12
ecma.rs
turbopack/crates/turbopack-static/src/ecma.rs
+3
-16
module_asset.rs
turbopack/crates/turbopack-wasm/src/module_asset.rs
+3
-18
raw.rs
turbopack/crates/turbopack-wasm/src/raw.rs
+3
-16
No files found.
crates/next-core/src/hmr_entry.rs
View file @
d21aef63
...
@@ -7,8 +7,8 @@ use turbo_tasks_fs::{FileSystem, VirtualFileSystem, rope::RopeBuilder};
...
@@ -7,8 +7,8 @@ use turbo_tasks_fs::{FileSystem, VirtualFileSystem, rope::RopeBuilder};
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
asset
::{
Asset
,
AssetContent
},
chunk
::{
chunk
::{
AsyncModuleInfo
,
Chunk
Item
,
ChunkableModule
,
ChunkingContext
,
ChunkingType
,
AsyncModuleInfo
,
Chunk
ableModule
,
ChunkingContext
,
ChunkingType
,
ChunkingTypeOption
,
ChunkingTypeOption
,
EvaluatableAsset
,
EvaluatableAsset
,
},
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::{
Module
,
ModuleSideEffects
},
module
::{
Module
,
ModuleSideEffects
},
...
@@ -20,7 +20,7 @@ use turbopack_core::{
...
@@ -20,7 +20,7 @@ use turbopack_core::{
use
turbopack_ecmascript
::{
use
turbopack_ecmascript
::{
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkItemOptions
,
EcmascriptChunkPlaceable
,
EcmascriptChunkItemContent
,
EcmascriptChunkItemOptions
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
ecmascript_chunk_item
,
EcmascriptExports
,
},
},
runtime_functions
::
TURBOPACK_REQUIRE
,
runtime_functions
::
TURBOPACK_REQUIRE
,
utils
::
StringifyJs
,
utils
::
StringifyJs
,
...
@@ -81,17 +81,7 @@ impl Module for HmrEntryModule {
...
@@ -81,17 +81,7 @@ impl Module for HmrEntryModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
HmrEntryModule
,
ecmascript
);
impl
ChunkableModule
for
HmrEntryModule
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
Asset
for
HmrEntryModule
{
impl
Asset
for
HmrEntryModule
{
...
...
crates/next-core/src/next_dynamic/dynamic_module.rs
View file @
d21aef63
...
@@ -3,7 +3,7 @@ use indoc::formatdoc;
...
@@ -3,7 +3,7 @@ use indoc::formatdoc;
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
AsyncModuleInfo
,
Chunk
ableModule
,
Chunk
ingContext
,
ModuleChunkItemIdExt
},
chunk
::{
AsyncModuleInfo
,
ChunkingContext
,
ModuleChunkItemIdExt
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::{
Module
,
ModuleSideEffects
},
module
::{
Module
,
ModuleSideEffects
},
module_graph
::
ModuleGraph
,
module_graph
::
ModuleGraph
,
...
@@ -12,11 +12,8 @@ use turbopack_core::{
...
@@ -12,11 +12,8 @@ use turbopack_core::{
source
::
OptionSource
,
source
::
OptionSource
,
};
};
use
turbopack_ecmascript
::{
use
turbopack_ecmascript
::{
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
},
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
references
::
esm
::{
EsmExport
,
EsmExports
},
ecmascript_chunk_item
,
},
references
::
esm
::
EsmExports
,
runtime_functions
::{
TURBOPACK_EXPORT_NAMESPACE
,
TURBOPACK_IMPORT
},
runtime_functions
::{
TURBOPACK_EXPORT_NAMESPACE
,
TURBOPACK_IMPORT
},
utils
::
StringifyJs
,
utils
::
StringifyJs
,
};
};
...
@@ -73,17 +70,7 @@ impl Module for NextDynamicEntryModule {
...
@@ -73,17 +70,7 @@ impl Module for NextDynamicEntryModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
NextDynamicEntryModule
,
ecmascript
);
impl
ChunkableModule
for
NextDynamicEntryModule
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
NextDynamicEntryModule
{
impl
EcmascriptChunkPlaceable
for
NextDynamicEntryModule
{
...
...
crates/next-core/src/next_server_component/server_component_module.rs
View file @
d21aef63
...
@@ -4,7 +4,7 @@ use turbo_rcstr::rcstr;
...
@@ -4,7 +4,7 @@ use turbo_rcstr::rcstr;
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks_fs
::
FileSystemPath
;
use
turbo_tasks_fs
::
FileSystemPath
;
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
AsyncModuleInfo
,
Chunk
ableModule
,
Chunk
ingContext
,
ModuleChunkItemIdExt
},
chunk
::{
AsyncModuleInfo
,
ChunkingContext
,
ModuleChunkItemIdExt
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::{
Module
,
ModuleSideEffects
},
module
::{
Module
,
ModuleSideEffects
},
module_graph
::
ModuleGraph
,
module_graph
::
ModuleGraph
,
...
@@ -12,11 +12,8 @@ use turbopack_core::{
...
@@ -12,11 +12,8 @@ use turbopack_core::{
source
::
OptionSource
,
source
::
OptionSource
,
};
};
use
turbopack_ecmascript
::{
use
turbopack_ecmascript
::{
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
},
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
references
::
esm
::{
EsmExport
,
EsmExports
},
ecmascript_chunk_item
,
},
references
::
esm
::
EsmExports
,
runtime_functions
::{
TURBOPACK_EXPORT_NAMESPACE
,
TURBOPACK_IMPORT
},
runtime_functions
::{
TURBOPACK_EXPORT_NAMESPACE
,
TURBOPACK_IMPORT
},
utils
::
StringifyJs
,
utils
::
StringifyJs
,
};
};
...
@@ -90,17 +87,7 @@ impl Module for NextServerComponentModule {
...
@@ -90,17 +87,7 @@ impl Module for NextServerComponentModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
NextServerComponentModule
,
ecmascript
);
impl
ChunkableModule
for
NextServerComponentModule
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
NextServerComponentModule
{
impl
EcmascriptChunkPlaceable
for
NextServerComponentModule
{
...
...
crates/next-core/src/next_server_utility/server_utility_module.rs
View file @
d21aef63
...
@@ -4,7 +4,7 @@ use turbo_rcstr::rcstr;
...
@@ -4,7 +4,7 @@ use turbo_rcstr::rcstr;
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks_fs
::
FileSystemPath
;
use
turbo_tasks_fs
::
FileSystemPath
;
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
AsyncModuleInfo
,
Chunk
ableModule
,
Chunk
ingContext
,
ModuleChunkItemIdExt
},
chunk
::{
AsyncModuleInfo
,
ChunkingContext
,
ModuleChunkItemIdExt
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::{
Module
,
ModuleSideEffects
},
module
::{
Module
,
ModuleSideEffects
},
module_graph
::
ModuleGraph
,
module_graph
::
ModuleGraph
,
...
@@ -12,11 +12,8 @@ use turbopack_core::{
...
@@ -12,11 +12,8 @@ use turbopack_core::{
source
::
OptionSource
,
source
::
OptionSource
,
};
};
use
turbopack_ecmascript
::{
use
turbopack_ecmascript
::{
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
},
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
references
::
esm
::{
EsmExport
,
EsmExports
},
ecmascript_chunk_item
,
},
references
::
esm
::
EsmExports
,
runtime_functions
::{
TURBOPACK_EXPORT_NAMESPACE
,
TURBOPACK_IMPORT
},
runtime_functions
::{
TURBOPACK_EXPORT_NAMESPACE
,
TURBOPACK_IMPORT
},
utils
::
StringifyJs
,
utils
::
StringifyJs
,
};
};
...
@@ -71,17 +68,7 @@ impl Module for NextServerUtilityModule {
...
@@ -71,17 +68,7 @@ impl Module for NextServerUtilityModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
NextServerUtilityModule
,
ecmascript
);
impl
ChunkableModule
for
NextServerUtilityModule
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
NextServerUtilityModule
{
impl
EcmascriptChunkPlaceable
for
NextServerUtilityModule
{
...
...
crates/next-core/src/raw_ecmascript_module.rs
View file @
d21aef63
...
@@ -11,7 +11,7 @@ use turbo_tasks_fs::{FileContent, rope::Rope};
...
@@ -11,7 +11,7 @@ use turbo_tasks_fs::{FileContent, rope::Rope};
use
turbopack
::{
ModuleAssetContext
,
module_options
::
CustomModuleType
};
use
turbopack
::{
ModuleAssetContext
,
module_options
::
CustomModuleType
};
use
turbopack_core
::{
use
turbopack_core
::{
asset
::
Asset
,
asset
::
Asset
,
chunk
::{
AsyncModuleInfo
,
Chunk
ableModule
,
Chunk
ingContext
},
chunk
::{
AsyncModuleInfo
,
ChunkingContext
},
code_builder
::
CodeBuilder
,
code_builder
::
CodeBuilder
,
compile_time_info
::{
compile_time_info
::{
CompileTimeDefineValue
,
CompileTimeInfo
,
DefinableNameSegmentRef
,
DefinableNameSegmentRefs
,
CompileTimeDefineValue
,
CompileTimeInfo
,
DefinableNameSegmentRef
,
DefinableNameSegmentRefs
,
...
@@ -29,7 +29,7 @@ use turbopack_ecmascript::{
...
@@ -29,7 +29,7 @@ use turbopack_ecmascript::{
EcmascriptInputTransforms
,
EcmascriptInputTransforms
,
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkItemOptions
,
EcmascriptChunkPlaceable
,
EcmascriptChunkItemContent
,
EcmascriptChunkItemOptions
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
ecmascript_chunk_item
,
EcmascriptExports
,
},
},
source_map
::{
extract_source_mapping_url_from_content
,
parse_source_map_comment
},
source_map
::{
extract_source_mapping_url_from_content
,
parse_source_map_comment
},
utils
::
StringifyJs
,
utils
::
StringifyJs
,
...
@@ -104,17 +104,7 @@ impl Module for RawEcmascriptModule {
...
@@ -104,17 +104,7 @@ impl Module for RawEcmascriptModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
RawEcmascriptModule
,
ecmascript
);
impl
ChunkableModule
for
RawEcmascriptModule
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
RawEcmascriptModule
{
impl
EcmascriptChunkPlaceable
for
RawEcmascriptModule
{
...
...
turbopack/crates/turbo-tasks-macros/src/ident.rs
View file @
d21aef63
...
@@ -114,6 +114,7 @@ pub fn get_type_ident(ty: &Type) -> Option<Ident> {
...
@@ -114,6 +114,7 @@ pub fn get_type_ident(ty: &Type) -> Option<Ident> {
match
ty
{
match
ty
{
Type
::
Path
(
path
)
=>
Some
(
get_path_ident
(
&
path
.path
)),
Type
::
Path
(
path
)
=>
Some
(
get_path_ident
(
&
path
.path
)),
Type
::
Tuple
(
tuple
)
=>
Some
(
Ident
::
new
(
"unit"
,
tuple
.span
())),
Type
::
Tuple
(
tuple
)
=>
Some
(
Ident
::
new
(
"unit"
,
tuple
.span
())),
Type
::
Group
(
group
)
=>
get_type_ident
(
&
group
.elem
),
_
=>
{
_
=>
{
ty
.span
()
ty
.span
()
.unwrap
()
.unwrap
()
...
...
turbopack/crates/turbopack-core/src/chunk/mod.rs
View file @
d21aef63
...
@@ -88,6 +88,42 @@ pub trait ChunkableModule: Module {
...
@@ -88,6 +88,42 @@ pub trait ChunkableModule: Module {
)
->
Vc
<
Box
<
dyn
ChunkItem
>>
;
)
->
Vc
<
Box
<
dyn
ChunkItem
>>
;
}
}
/// Implements `ChunkableModule` for a type that implements `EcmascriptChunkPlaceable`.
///
/// Usage:
/// turbopack_core::chunk_item!(MyModule, ecmascript);
///
/// When called from within `turbopack-ecmascript` itself, use the explicit path form:
/// turbopack_core::chunk_item!(MyModule, crate::chunk::item::ecmascript_chunk_item);
///
/// This generates the standard `impl ChunkableModule` that delegates to
/// `ecmascript_chunk_item()`.
#[macro_export]
macro_rules!
chunk_item
{
(
$ty:ty
,
ecmascript
)
=>
{
turbopack_core
::
chunk_item!
(
$ty
,
turbopack_ecmascript
::
chunk
::
ecmascript_chunk_item
);
};
(
$ty:ty
,
$chunk_item_fn:path
)
=>
{
#[turbo_tasks
::
value_impl]
impl
turbopack_core
::
chunk
::
ChunkableModule
for
$ty
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
turbo_tasks
::
ResolvedVc
<
Self
>
,
module_graph
:
turbo_tasks
::
ResolvedVc
<
turbopack_core
::
module_graph
::
ModuleGraph
>
,
chunking_context
:
turbo_tasks
::
ResolvedVc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkingContext
>
,
>
,
)
->
turbo_tasks
::
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
$chunk_item_fn
(
turbo_tasks
::
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
,
)
}
}
};
}
#[turbo_tasks
::
value(transparent)]
#[turbo_tasks
::
value(transparent)]
pub
struct
ChunkableModules
(
Vec
<
ResolvedVc
<
Box
<
dyn
ChunkableModule
>>>
);
pub
struct
ChunkableModules
(
Vec
<
ResolvedVc
<
Box
<
dyn
ChunkableModule
>>>
);
...
...
turbopack/crates/turbopack-css/src/module_asset.rs
View file @
d21aef63
...
@@ -8,7 +8,7 @@ use turbo_rcstr::{RcStr, rcstr};
...
@@ -8,7 +8,7 @@ use turbo_rcstr::{RcStr, rcstr};
use
turbo_tasks
::{
FxIndexMap
,
IntoTraitRef
,
ResolvedVc
,
ValueToString
,
Vc
};
use
turbo_tasks
::{
FxIndexMap
,
IntoTraitRef
,
ResolvedVc
,
ValueToString
,
Vc
};
use
turbo_tasks_fs
::{
FileSystemPath
,
rope
::
Rope
};
use
turbo_tasks_fs
::{
FileSystemPath
,
rope
::
Rope
};
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
AsyncModuleInfo
,
Chunk
ableModule
,
Chunk
ingContext
,
ModuleChunkItemIdExt
},
chunk
::{
AsyncModuleInfo
,
ChunkingContext
,
ModuleChunkItemIdExt
},
context
::{
AssetContext
,
ProcessResult
},
context
::{
AssetContext
,
ProcessResult
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
issue
::{
issue
::{
...
@@ -23,10 +23,7 @@ use turbopack_core::{
...
@@ -23,10 +23,7 @@ use turbopack_core::{
source
::{
OptionSource
,
Source
},
source
::{
OptionSource
,
Source
},
};
};
use
turbopack_ecmascript
::{
use
turbopack_ecmascript
::{
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
},
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
ecmascript_chunk_item
,
},
parse
::
generate_js_source_map
,
parse
::
generate_js_source_map
,
runtime_functions
::{
TURBOPACK_EXPORT_VALUE
,
TURBOPACK_IMPORT
},
runtime_functions
::{
TURBOPACK_EXPORT_VALUE
,
TURBOPACK_IMPORT
},
utils
::
StringifyJs
,
utils
::
StringifyJs
,
...
@@ -244,17 +241,7 @@ impl ModuleCssAsset {
...
@@ -244,17 +241,7 @@ impl ModuleCssAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
ModuleCssAsset
,
ecmascript
);
impl
ChunkableModule
for
ModuleCssAsset
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
ModuleCssAsset
{
impl
EcmascriptChunkPlaceable
for
ModuleCssAsset
{
...
...
turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs
View file @
d21aef63
...
@@ -20,7 +20,7 @@ use turbopack_core::{
...
@@ -20,7 +20,7 @@ use turbopack_core::{
use
crate
::{
use
crate
::{
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
data
::
EcmascriptChunkData
,
ecmascript_chunk_item
,
data
::
EcmascriptChunkData
,
},
},
runtime_functions
::{
TURBOPACK_EXPORT_VALUE
,
TURBOPACK_LOAD
},
runtime_functions
::{
TURBOPACK_EXPORT_VALUE
,
TURBOPACK_LOAD
},
utils
::{
StringifyJs
,
StringifyModuleId
},
utils
::{
StringifyJs
,
StringifyModuleId
},
...
@@ -134,17 +134,7 @@ impl Module for AsyncLoaderModule {
...
@@ -134,17 +134,7 @@ impl Module for AsyncLoaderModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
AsyncLoaderModule
,
crate
::
chunk
::
ecmascript_chunk_item
);
impl
ChunkableModule
for
AsyncLoaderModule
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
AsyncLoaderModule
{
impl
EcmascriptChunkPlaceable
for
AsyncLoaderModule
{
...
...
turbopack/crates/turbopack-ecmascript/src/lib.rs
View file @
d21aef63
...
@@ -83,9 +83,9 @@ use turbo_tasks::{
...
@@ -83,9 +83,9 @@ use turbo_tasks::{
use
turbo_tasks_fs
::{
FileJsonContent
,
FileSystemPath
,
glob
::
Glob
,
rope
::
Rope
};
use
turbo_tasks_fs
::{
FileJsonContent
,
FileSystemPath
,
glob
::
Glob
,
rope
::
Rope
};
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
chunk
::{
AsyncModuleInfo
,
Chunk
Item
,
ChunkableModule
,
ChunkingContext
,
EvaluatableAsset
,
AsyncModuleInfo
,
Chunk
ableModule
,
ChunkingContext
,
EvaluatableAsset
,
MergeableModule
,
MergeableModule
,
MergeableModuleExposure
,
MergeableModules
,
MergeableModulesExposed
,
MergeableModule
Exposure
,
MergeableModules
,
MergeableModulesExposed
,
MinifyType
,
M
inifyType
,
M
oduleChunkItemIdExt
,
ModuleId
,
ModuleChunkItemIdExt
,
ModuleId
,
},
},
compile_time_info
::
CompileTimeInfo
,
compile_time_info
::
CompileTimeInfo
,
context
::
AssetContext
,
context
::
AssetContext
,
...
@@ -106,7 +106,6 @@ use crate::{
...
@@ -106,7 +106,6 @@ use crate::{
analyzer
::
graph
::
EvalContext
,
analyzer
::
graph
::
EvalContext
,
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
ecmascript_chunk_item
,
placeable
::{
SideEffectsDeclaration
,
get_side_effect_free_declaration
},
placeable
::{
SideEffectsDeclaration
,
get_side_effect_free_declaration
},
},
},
code_gen
::{
CodeGeneration
,
CodeGenerationHoistedStmt
,
CodeGens
,
ModifiableAst
},
code_gen
::{
CodeGeneration
,
CodeGenerationHoistedStmt
,
CodeGens
,
ModifiableAst
},
...
@@ -784,17 +783,7 @@ impl Module for EcmascriptModuleAsset {
...
@@ -784,17 +783,7 @@ impl Module for EcmascriptModuleAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
EcmascriptModuleAsset
,
crate
::
chunk
::
ecmascript_chunk_item
);
impl
ChunkableModule
for
EcmascriptModuleAsset
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
EcmascriptModuleAsset
{
impl
EcmascriptChunkPlaceable
for
EcmascriptModuleAsset
{
...
...
turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs
View file @
d21aef63
...
@@ -19,7 +19,7 @@ use turbopack_core::{
...
@@ -19,7 +19,7 @@ use turbopack_core::{
use
crate
::{
use
crate
::{
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
data
::
EcmascriptChunkData
,
ecmascript_chunk_item
,
data
::
EcmascriptChunkData
,
},
},
runtime_functions
::
TURBOPACK_EXPORT_VALUE
,
runtime_functions
::
TURBOPACK_EXPORT_VALUE
,
utils
::
StringifyJs
,
utils
::
StringifyJs
,
...
@@ -174,17 +174,7 @@ impl Module for ManifestAsyncModule {
...
@@ -174,17 +174,7 @@ impl Module for ManifestAsyncModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
ManifestAsyncModule
,
crate
::
chunk
::
ecmascript_chunk_item
);
impl
ChunkableModule
for
ManifestAsyncModule
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
ManifestAsyncModule
{
impl
EcmascriptChunkPlaceable
for
ManifestAsyncModule
{
...
...
turbopack/crates/turbopack-ecmascript/src/manifest/loader_module.rs
View file @
d21aef63
...
@@ -20,7 +20,7 @@ use super::chunk_asset::ManifestAsyncModule;
...
@@ -20,7 +20,7 @@ use super::chunk_asset::ManifestAsyncModule;
use
crate
::{
use
crate
::{
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
data
::
EcmascriptChunkData
,
ecmascript_chunk_item
,
data
::
EcmascriptChunkData
,
},
},
runtime_functions
::{
TURBOPACK_EXPORT_VALUE
,
TURBOPACK_LOAD
,
TURBOPACK_REQUIRE
},
runtime_functions
::{
TURBOPACK_EXPORT_VALUE
,
TURBOPACK_LOAD
,
TURBOPACK_REQUIRE
},
utils
::{
StringifyJs
,
StringifyModuleId
},
utils
::{
StringifyJs
,
StringifyModuleId
},
...
@@ -96,17 +96,7 @@ impl Module for ManifestLoaderModule {
...
@@ -96,17 +96,7 @@ impl Module for ManifestLoaderModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
ManifestLoaderModule
,
crate
::
chunk
::
ecmascript_chunk_item
);
impl
ChunkableModule
for
ManifestLoaderModule
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
ManifestLoaderModule
{
impl
EcmascriptChunkPlaceable
for
ManifestLoaderModule
{
...
...
turbopack/crates/turbopack-ecmascript/src/merged_module.rs
View file @
d21aef63
...
@@ -2,8 +2,8 @@ use anyhow::{Context, Result};
...
@@ -2,8 +2,8 @@ use anyhow::{Context, Result};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
chunk
::{
AsyncModuleInfo
,
Chunk
ableModule
,
ChunkingContext
,
MergeableModuleExposure
,
AsyncModuleInfo
,
Chunk
ingContext
,
MergeableModuleExposure
,
MergeableModules
,
MergeableModules
,
MergeableModules
Exposed
,
MergeableModulesExposed
,
},
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::{
Module
,
ModuleSideEffects
},
module
::{
Module
,
ModuleSideEffects
},
...
@@ -13,10 +13,7 @@ use turbopack_core::{
...
@@ -13,10 +13,7 @@ use turbopack_core::{
use
crate
::{
use
crate
::{
EcmascriptAnalyzable
,
EcmascriptModuleContent
,
EcmascriptOptions
,
EcmascriptAnalyzable
,
EcmascriptModuleContent
,
EcmascriptOptions
,
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
},
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
ecmascript_chunk_item
,
},
};
};
#[turbo_tasks
::
value(shared)]
#[turbo_tasks
::
value(shared)]
...
@@ -91,17 +88,7 @@ impl Module for MergedEcmascriptModule {
...
@@ -91,17 +88,7 @@ impl Module for MergedEcmascriptModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
MergedEcmascriptModule
,
crate
::
chunk
::
ecmascript_chunk_item
);
impl
ChunkableModule
for
MergedEcmascriptModule
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
MergedEcmascriptModule
{
impl
EcmascriptChunkPlaceable
for
MergedEcmascriptModule
{
...
...
turbopack/crates/turbopack-ecmascript/src/references/external_module.rs
View file @
d21aef63
...
@@ -8,7 +8,7 @@ use turbo_tasks_fs::{FileSystem, FileSystemPath, LinkType, VirtualFileSystem, ro
...
@@ -8,7 +8,7 @@ use turbo_tasks_fs::{FileSystem, FileSystemPath, LinkType, VirtualFileSystem, ro
use
turbo_tasks_hash
::{
encode_hex
,
hash_xxh3_hash64
};
use
turbo_tasks_hash
::{
encode_hex
,
hash_xxh3_hash64
};
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
asset
::{
Asset
,
AssetContent
},
chunk
::{
AsyncModuleInfo
,
Chunk
ableModule
,
Chunk
ingContext
},
chunk
::{
AsyncModuleInfo
,
ChunkingContext
},
ident
::{
AssetIdent
,
Layer
},
ident
::{
AssetIdent
,
Layer
},
module
::{
Module
,
ModuleSideEffects
},
module
::{
Module
,
ModuleSideEffects
},
module_graph
::
ModuleGraph
,
module_graph
::
ModuleGraph
,
...
@@ -29,10 +29,7 @@ use turbopack_resolve::ecmascript::{cjs_resolve, esm_resolve};
...
@@ -29,10 +29,7 @@ use turbopack_resolve::ecmascript::{cjs_resolve, esm_resolve};
use
crate
::{
use
crate
::{
EcmascriptModuleContent
,
EcmascriptModuleContent
,
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
},
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
ecmascript_chunk_item
,
},
references
::
async_module
::{
AsyncModule
,
OptionAsyncModule
},
references
::
async_module
::{
AsyncModule
,
OptionAsyncModule
},
runtime_functions
::{
runtime_functions
::{
TURBOPACK_EXPORT_NAMESPACE
,
TURBOPACK_EXPORT_VALUE
,
TURBOPACK_EXTERNAL_IMPORT
,
TURBOPACK_EXPORT_NAMESPACE
,
TURBOPACK_EXPORT_VALUE
,
TURBOPACK_EXTERNAL_IMPORT
,
...
@@ -370,17 +367,7 @@ impl Module for CachedExternalModule {
...
@@ -370,17 +367,7 @@ impl Module for CachedExternalModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
CachedExternalModule
,
crate
::
chunk
::
ecmascript_chunk_item
);
impl
ChunkableModule
for
CachedExternalModule
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
CachedExternalModule
{
impl
EcmascriptChunkPlaceable
for
CachedExternalModule
{
...
...
turbopack/crates/turbopack-ecmascript/src/references/require_context.rs
View file @
d21aef63
...
@@ -22,8 +22,8 @@ use turbo_tasks::{
...
@@ -22,8 +22,8 @@ use turbo_tasks::{
use
turbo_tasks_fs
::{
DirectoryContent
,
DirectoryEntry
,
FileSystemPath
};
use
turbo_tasks_fs
::{
DirectoryContent
,
DirectoryEntry
,
FileSystemPath
};
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
chunk
::{
AsyncModuleInfo
,
Chunk
ableModule
,
ChunkingContext
,
ChunkingType
,
ChunkingTypeOption
,
AsyncModuleInfo
,
Chunk
ingContext
,
ChunkingType
,
ChunkingTypeOption
,
MinifyType
,
M
inifyType
,
M
oduleChunkItemIdExt
,
ModuleChunkItemIdExt
,
},
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
issue
::
IssueSource
,
issue
::
IssueSource
,
...
@@ -38,7 +38,7 @@ use turbopack_resolve::ecmascript::cjs_resolve;
...
@@ -38,7 +38,7 @@ use turbopack_resolve::ecmascript::cjs_resolve;
use
crate
::{
use
crate
::{
EcmascriptChunkPlaceable
,
EcmascriptChunkPlaceable
,
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptExports
,
ecmascript_chunk_item
},
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptExports
},
code_gen
::{
CodeGen
,
CodeGeneration
,
IntoCodeGenReference
},
code_gen
::{
CodeGen
,
CodeGeneration
,
IntoCodeGenReference
},
create_visitor
,
create_visitor
,
references
::{
references
::{
...
@@ -435,17 +435,7 @@ impl Module for RequireContextAsset {
...
@@ -435,17 +435,7 @@ impl Module for RequireContextAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
RequireContextAsset
,
crate
::
chunk
::
ecmascript_chunk_item
);
impl
ChunkableModule
for
RequireContextAsset
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
RequireContextAsset
{
impl
EcmascriptChunkPlaceable
for
RequireContextAsset
{
...
...
turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/module.rs
View file @
d21aef63
...
@@ -18,10 +18,7 @@ use crate::{
...
@@ -18,10 +18,7 @@ use crate::{
AnalyzeEcmascriptModuleResult
,
EcmascriptAnalyzable
,
EcmascriptAnalyzableExt
,
AnalyzeEcmascriptModuleResult
,
EcmascriptAnalyzable
,
EcmascriptAnalyzableExt
,
EcmascriptModuleContent
,
EcmascriptModuleContentOptions
,
EcmascriptOptions
,
EcmascriptModuleContent
,
EcmascriptModuleContentOptions
,
EcmascriptOptions
,
MergedEcmascriptModule
,
SpecifiedModuleType
,
MergedEcmascriptModule
,
SpecifiedModuleType
,
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
},
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
ecmascript_chunk_item
,
},
code_gen
::
CodeGens
,
code_gen
::
CodeGens
,
export
::
Liveness
,
export
::
Liveness
,
references
::{
references
::{
...
@@ -367,17 +364,10 @@ impl EcmascriptChunkPlaceable for EcmascriptModuleFacadeModule {
...
@@ -367,17 +364,10 @@ impl EcmascriptChunkPlaceable for EcmascriptModuleFacadeModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
impl
ChunkableModule
for
EcmascriptModuleFacadeModule
{
EcmascriptModuleFacadeModule
,
#[turbo_tasks
::
function]
crate
::
chunk
::
ecmascript_chunk_item
fn
as_chunk_item
(
);
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EvaluatableAsset
for
EcmascriptModuleFacadeModule
{}
impl
EvaluatableAsset
for
EcmascriptModuleFacadeModule
{}
...
...
turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/module.rs
View file @
d21aef63
...
@@ -18,10 +18,7 @@ use crate::{
...
@@ -18,10 +18,7 @@ use crate::{
AnalyzeEcmascriptModuleResult
,
EcmascriptAnalyzable
,
EcmascriptAnalyzableExt
,
AnalyzeEcmascriptModuleResult
,
EcmascriptAnalyzable
,
EcmascriptAnalyzableExt
,
EcmascriptModuleAsset
,
EcmascriptModuleContent
,
EcmascriptModuleContentOptions
,
EcmascriptModuleAsset
,
EcmascriptModuleContent
,
EcmascriptModuleContentOptions
,
MergedEcmascriptModule
,
MergedEcmascriptModule
,
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
},
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
ecmascript_chunk_item
,
},
references
::{
references
::{
async_module
::
OptionAsyncModule
,
async_module
::
OptionAsyncModule
,
esm
::{
EsmExport
,
EsmExports
},
esm
::{
EsmExport
,
EsmExports
},
...
@@ -193,17 +190,10 @@ impl EcmascriptChunkPlaceable for EcmascriptModuleLocalsModule {
...
@@ -193,17 +190,10 @@ impl EcmascriptChunkPlaceable for EcmascriptModuleLocalsModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
impl
ChunkableModule
for
EcmascriptModuleLocalsModule
{
EcmascriptModuleLocalsModule
,
#[turbo_tasks
::
function]
crate
::
chunk
::
ecmascript_chunk_item
fn
as_chunk_item
(
);
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
MergeableModule
for
EcmascriptModuleLocalsModule
{
impl
MergeableModule
for
EcmascriptModuleLocalsModule
{
...
...
turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs
View file @
d21aef63
...
@@ -2,7 +2,7 @@ use anyhow::Result;
...
@@ -2,7 +2,7 @@ use anyhow::Result;
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
AsyncModuleInfo
,
Chunk
ableModule
,
Chunk
ingContext
,
EvaluatableAsset
},
chunk
::{
AsyncModuleInfo
,
ChunkingContext
,
EvaluatableAsset
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::{
Module
,
ModuleSideEffects
},
module
::{
Module
,
ModuleSideEffects
},
module_graph
::
ModuleGraph
,
module_graph
::
ModuleGraph
,
...
@@ -15,10 +15,7 @@ use crate::{
...
@@ -15,10 +15,7 @@ use crate::{
AnalyzeEcmascriptModuleResult
,
EcmascriptAnalyzable
,
EcmascriptAnalyzableExt
,
AnalyzeEcmascriptModuleResult
,
EcmascriptAnalyzable
,
EcmascriptAnalyzableExt
,
EcmascriptModuleAsset
,
EcmascriptModuleAssetType
,
EcmascriptModuleContent
,
EcmascriptModuleAsset
,
EcmascriptModuleAssetType
,
EcmascriptModuleContent
,
EcmascriptModuleContentOptions
,
EcmascriptParsable
,
EcmascriptModuleContentOptions
,
EcmascriptParsable
,
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
},
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
ecmascript_chunk_item
,
},
parse
::
ParseResult
,
parse
::
ParseResult
,
references
::{
references
::{
FollowExportsResult
,
analyze_ecmascript_module
,
esm
::
FoundExportType
,
follow_reexports
,
FollowExportsResult
,
analyze_ecmascript_module
,
esm
::
FoundExportType
,
follow_reexports
,
...
@@ -372,17 +369,10 @@ impl EcmascriptChunkPlaceable for EcmascriptModulePartAsset {
...
@@ -372,17 +369,10 @@ impl EcmascriptChunkPlaceable for EcmascriptModulePartAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
impl
ChunkableModule
for
EcmascriptModulePartAsset
{
EcmascriptModulePartAsset
,
#[turbo_tasks
::
function]
crate
::
chunk
::
ecmascript_chunk_item
fn
as_chunk_item
(
);
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptModulePartAsset
{
impl
EcmascriptModulePartAsset
{
...
...
turbopack/crates/turbopack-ecmascript/src/tree_shake/side_effect_module.rs
View file @
d21aef63
...
@@ -3,9 +3,7 @@ use turbo_rcstr::{RcStr, rcstr};
...
@@ -3,9 +3,7 @@ use turbo_rcstr::{RcStr, rcstr};
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
Vc
};
use
turbo_tasks_fs
::
rope
::
RopeBuilder
;
use
turbo_tasks_fs
::
rope
::
RopeBuilder
;
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
chunk
::{
AsyncModuleInfo
,
ChunkingContext
,
EvaluatableAsset
,
ModuleChunkItemIdExt
},
AsyncModuleInfo
,
ChunkableModule
,
ChunkingContext
,
EvaluatableAsset
,
ModuleChunkItemIdExt
,
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::{
Module
,
ModuleSideEffects
},
module
::{
Module
,
ModuleSideEffects
},
module_graph
::
ModuleGraph
,
module_graph
::
ModuleGraph
,
...
@@ -17,7 +15,7 @@ use crate::{
...
@@ -17,7 +15,7 @@ use crate::{
EcmascriptModuleAsset
,
EcmascriptModuleAsset
,
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkItemOptions
,
EcmascriptChunkPlaceable
,
EcmascriptChunkItemContent
,
EcmascriptChunkItemOptions
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
ecmascript_chunk_item
,
item
::
RewriteSourcePath
,
EcmascriptExports
,
item
::
RewriteSourcePath
,
},
},
references
::
async_module
::
AsyncModuleOptions
,
references
::
async_module
::
AsyncModuleOptions
,
runtime_functions
::{
TURBOPACK_EXPORT_NAMESPACE
,
TURBOPACK_IMPORT
},
runtime_functions
::{
TURBOPACK_EXPORT_NAMESPACE
,
TURBOPACK_IMPORT
},
...
@@ -204,17 +202,7 @@ impl EcmascriptChunkPlaceable for SideEffectsModule {
...
@@ -204,17 +202,7 @@ impl EcmascriptChunkPlaceable for SideEffectsModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
SideEffectsModule
,
crate
::
chunk
::
ecmascript_chunk_item
);
impl
ChunkableModule
for
SideEffectsModule
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EvaluatableAsset
for
SideEffectsModule
{}
impl
EvaluatableAsset
for
SideEffectsModule
{}
turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs
View file @
d21aef63
...
@@ -21,7 +21,7 @@ use super::worker_type::WorkerType;
...
@@ -21,7 +21,7 @@ use super::worker_type::WorkerType;
use
crate
::{
use
crate
::{
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
data
::
EcmascriptChunkData
,
ecmascript_chunk_item
,
data
::
EcmascriptChunkData
,
},
},
runtime_functions
::{
TURBOPACK_CREATE_WORKER
,
TURBOPACK_EXPORT_VALUE
},
runtime_functions
::{
TURBOPACK_CREATE_WORKER
,
TURBOPACK_EXPORT_VALUE
},
utils
::
StringifyJs
,
utils
::
StringifyJs
,
...
@@ -173,17 +173,7 @@ impl Module for WorkerLoaderModule {
...
@@ -173,17 +173,7 @@ impl Module for WorkerLoaderModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
WorkerLoaderModule
,
crate
::
chunk
::
ecmascript_chunk_item
);
impl
ChunkableModule
for
WorkerLoaderModule
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
WorkerLoaderModule
{
impl
EcmascriptChunkPlaceable
for
WorkerLoaderModule
{
...
...
turbopack/crates/turbopack-static/src/ecma.rs
View file @
d21aef63
...
@@ -2,7 +2,7 @@ use anyhow::Result;
...
@@ -2,7 +2,7 @@ use anyhow::Result;
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
AssetSuffix
,
AsyncModuleInfo
,
Chunk
ableModule
,
Chunk
ingContext
},
chunk
::{
AssetSuffix
,
AsyncModuleInfo
,
ChunkingContext
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::{
Module
,
ModuleSideEffects
},
module
::{
Module
,
ModuleSideEffects
},
module_graph
::
ModuleGraph
,
module_graph
::
ModuleGraph
,
...
@@ -10,10 +10,7 @@ use turbopack_core::{
...
@@ -10,10 +10,7 @@ use turbopack_core::{
source
::
Source
,
source
::
Source
,
};
};
use
turbopack_ecmascript
::{
use
turbopack_ecmascript
::{
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
},
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
ecmascript_chunk_item
,
},
runtime_functions
::{
TURBOPACK_EXPORT_URL
,
TURBOPACK_EXPORT_VALUE
},
runtime_functions
::{
TURBOPACK_EXPORT_URL
,
TURBOPACK_EXPORT_VALUE
},
utils
::
StringifyJs
,
utils
::
StringifyJs
,
};
};
...
@@ -68,17 +65,7 @@ impl Module for StaticUrlJsModule {
...
@@ -68,17 +65,7 @@ impl Module for StaticUrlJsModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
StaticUrlJsModule
,
ecmascript
);
impl
ChunkableModule
for
StaticUrlJsModule
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
StaticUrlJsModule
{
impl
EcmascriptChunkPlaceable
for
StaticUrlJsModule
{
...
...
turbopack/crates/turbopack-wasm/src/module_asset.rs
View file @
d21aef63
...
@@ -3,9 +3,7 @@ use turbo_rcstr::rcstr;
...
@@ -3,9 +3,7 @@ use turbo_rcstr::rcstr;
use
turbo_tasks
::{
IntoTraitRef
,
ResolvedVc
,
Vc
,
fxindexmap
};
use
turbo_tasks
::{
IntoTraitRef
,
ResolvedVc
,
Vc
,
fxindexmap
};
use
turbo_tasks_fs
::
FileSystemPath
;
use
turbo_tasks_fs
::
FileSystemPath
;
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
chunk
::{
AsyncModuleInfo
,
ChunkingContext
,
chunk_group
::
references_to_output_assets
},
AsyncModuleInfo
,
ChunkableModule
,
ChunkingContext
,
chunk_group
::
references_to_output_assets
,
},
context
::
AssetContext
,
context
::
AssetContext
,
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::{
Module
,
ModuleSideEffects
,
OptionModule
},
module
::{
Module
,
ModuleSideEffects
,
OptionModule
},
...
@@ -17,10 +15,7 @@ use turbopack_core::{
...
@@ -17,10 +15,7 @@ use turbopack_core::{
source
::{
OptionSource
,
Source
},
source
::{
OptionSource
,
Source
},
};
};
use
turbopack_ecmascript
::{
use
turbopack_ecmascript
::{
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
},
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
ecmascript_chunk_item
,
},
references
::
async_module
::
OptionAsyncModule
,
references
::
async_module
::
OptionAsyncModule
,
};
};
...
@@ -152,17 +147,7 @@ impl Module for WebAssemblyModuleAsset {
...
@@ -152,17 +147,7 @@ impl Module for WebAssemblyModuleAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
WebAssemblyModuleAsset
,
ecmascript
);
impl
ChunkableModule
for
WebAssemblyModuleAsset
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
WebAssemblyModuleAsset
{
impl
EcmascriptChunkPlaceable
for
WebAssemblyModuleAsset
{
...
...
turbopack/crates/turbopack-wasm/src/raw.rs
View file @
d21aef63
...
@@ -2,7 +2,7 @@ use anyhow::{Result, bail};
...
@@ -2,7 +2,7 @@ use anyhow::{Result, bail};
use
turbo_rcstr
::
rcstr
;
use
turbo_rcstr
::
rcstr
;
use
turbo_tasks
::{
IntoTraitRef
,
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
IntoTraitRef
,
ResolvedVc
,
Vc
};
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::{
AsyncModuleInfo
,
Chunk
ableModule
,
Chunk
ingContext
},
chunk
::{
AsyncModuleInfo
,
ChunkingContext
},
context
::
AssetContext
,
context
::
AssetContext
,
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::{
Module
,
ModuleSideEffects
},
module
::{
Module
,
ModuleSideEffects
},
...
@@ -11,10 +11,7 @@ use turbopack_core::{
...
@@ -11,10 +11,7 @@ use turbopack_core::{
source
::{
OptionSource
,
Source
},
source
::{
OptionSource
,
Source
},
};
};
use
turbopack_ecmascript
::{
use
turbopack_ecmascript
::{
chunk
::{
chunk
::{
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
},
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptExports
,
ecmascript_chunk_item
,
},
runtime_functions
::
TURBOPACK_EXPORT_URL
,
runtime_functions
::
TURBOPACK_EXPORT_URL
,
utils
::
StringifyJs
,
utils
::
StringifyJs
,
};
};
...
@@ -71,17 +68,7 @@ impl Module for RawWebAssemblyModuleAsset {
...
@@ -71,17 +68,7 @@ impl Module for RawWebAssemblyModuleAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
turbopack_core
::
chunk_item!
(
RawWebAssemblyModuleAsset
,
ecmascript
);
impl
ChunkableModule
for
RawWebAssemblyModuleAsset
{
#[turbo_tasks
::
function]
fn
as_chunk_item
(
self
:
ResolvedVc
<
Self
>
,
module_graph
:
ResolvedVc
<
ModuleGraph
>
,
chunking_context
:
ResolvedVc
<
Box
<
dyn
ChunkingContext
>>
,
)
->
Vc
<
Box
<
dyn
turbopack_core
::
chunk
::
ChunkItem
>>
{
ecmascript_chunk_item
(
ResolvedVc
::
upcast
(
self
),
module_graph
,
chunking_context
)
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
RawWebAssemblyModuleAsset
{
impl
EcmascriptChunkPlaceable
for
RawWebAssemblyModuleAsset
{
...
...
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