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
a49cd429
Unverified
Commit
a49cd429
authored
Nov 22, 2025
by
Tobias Koppers
Committed by
GitHub
Nov 22, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Turbopack: remove Asset supertrait from Module trait. Modules don't have content" (#86415)
Reverts vercel/next.js#86339
parent
d89a7a07
Show whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
330 additions
and
82 deletions
+330
-82
ecmascript_client_reference_module.rs
...pt_client_reference/ecmascript_client_reference_module.rs
+14
-2
dynamic_module.rs
crates/next-core/src/next_dynamic/dynamic_module.rs
+14
-0
server_component_module.rs
...core/src/next_server_component/server_component_module.rs
+16
-1
server_utility_module.rs
...ext-core/src/next_server_utility/server_utility_module.rs
+14
-1
swc_ecma_transform_plugins.rs
.../src/next_shared/transforms/swc_ecma_transform_plugins.rs
+2
-12
raw_ecmascript_module.rs
crates/next-core/src/raw_ecmascript_module.rs
+9
-1
changed.rs
turbopack/crates/turbopack-core/src/changed.rs
+3
-16
evaluate.rs
turbopack/crates/turbopack-core/src/chunk/evaluate.rs
+2
-1
mod.rs
turbopack/crates/turbopack-core/src/chunk/mod.rs
+2
-2
module.rs
turbopack/crates/turbopack-core/src/introspect/module.rs
+2
-6
module.rs
turbopack/crates/turbopack-core/src/module.rs
+3
-3
node_addon_module.rs
turbopack/crates/turbopack-core/src/node_addon_module.rs
+9
-0
raw_module.rs
turbopack/crates/turbopack-core/src/raw_module.rs
+9
-0
rebase.rs
turbopack/crates/turbopack-core/src/rebase.rs
+4
-11
traced_asset.rs
turbopack/crates/turbopack-core/src/traced_asset.rs
+4
-11
asset.rs
turbopack/crates/turbopack-css/src/asset.rs
+9
-0
mod.rs
turbopack/crates/turbopack-css/src/chunk/mod.rs
+1
-1
embed.rs
turbopack/crates/turbopack-css/src/embed.rs
+2
-2
module_asset.rs
turbopack/crates/turbopack-css/src/module_asset.rs
+9
-0
module.rs
...ack/crates/turbopack-ecmascript/src/async_chunk/module.rs
+9
-0
placeable.rs
turbopack/crates/turbopack-ecmascript/src/chunk/placeable.rs
+1
-1
inlined_bytes_module.rs
...k/crates/turbopack-ecmascript/src/inlined_bytes_module.rs
+10
-2
lib.rs
turbopack/crates/turbopack-ecmascript/src/lib.rs
+10
-1
chunk_asset.rs
...k/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs
+9
-0
merged_module.rs
turbopack/crates/turbopack-ecmascript/src/merged_module.rs
+9
-0
external_module.rs
...es/turbopack-ecmascript/src/references/external_module.rs
+20
-2
require_context.rs
...es/turbopack-ecmascript/src/references/require_context.rs
+9
-0
module.rs
...-ecmascript/src/side_effect_optimization/facade/module.rs
+12
-1
module.rs
...-ecmascript/src/side_effect_optimization/locals/module.rs
+9
-0
asset.rs
...opack/crates/turbopack-ecmascript/src/tree_shake/asset.rs
+9
-0
side_effect_module.rs
...turbopack-ecmascript/src/tree_shake/side_effect_module.rs
+17
-1
mod.rs
turbopack/crates/turbopack-ecmascript/src/typescript/mod.rs
+9
-1
mod.rs
turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs
+9
-0
module.rs
...ck/crates/turbopack-ecmascript/src/worker_chunk/module.rs
+9
-0
lib.rs
turbopack/crates/turbopack-json/src/lib.rs
+10
-2
css.rs
turbopack/crates/turbopack-static/src/css.rs
+14
-1
ecma.rs
turbopack/crates/turbopack-static/src/ecma.rs
+9
-0
module_asset.rs
turbopack/crates/turbopack-wasm/src/module_asset.rs
+9
-0
raw.rs
turbopack/crates/turbopack-wasm/src/raw.rs
+9
-0
No files found.
crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs
View file @
a49cd429
...
@@ -4,9 +4,9 @@ use anyhow::{Context, Result, bail};
...
@@ -4,9 +4,9 @@ use anyhow::{Context, Result, bail};
use
indoc
::
writedoc
;
use
indoc
::
writedoc
;
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_tasks
::{
IntoTraitRef
,
ResolvedVc
,
ValueToString
,
Vc
};
use
turbo_tasks
::{
IntoTraitRef
,
ResolvedVc
,
ValueToString
,
Vc
};
use
turbo_tasks_fs
::
File
;
use
turbo_tasks_fs
::
{
File
,
FileContent
}
;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::
AssetContent
,
asset
::
{
Asset
,
AssetContent
}
,
chunk
::{
chunk
::{
AsyncModuleInfo
,
ChunkGroupType
,
ChunkItem
,
ChunkType
,
ChunkableModule
,
AsyncModuleInfo
,
ChunkGroupType
,
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkableModuleReference
,
ChunkingContext
,
ChunkingType
,
ChunkingTypeOption
,
ChunkableModuleReference
,
ChunkingContext
,
ChunkingType
,
ChunkingTypeOption
,
...
@@ -243,6 +243,18 @@ impl Module for EcmascriptClientReferenceModule {
...
@@ -243,6 +243,18 @@ impl Module for EcmascriptClientReferenceModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
EcmascriptClientReferenceModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
AssetContent
::
File
(
FileContent
::
Content
(
"// This is a proxy module for Next.js client references."
.into
())
.resolved_cell
(),
)
.cell
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
EcmascriptClientReferenceModule
{
impl
ChunkableModule
for
EcmascriptClientReferenceModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
crates/next-core/src/next_dynamic/dynamic_module.rs
View file @
a49cd429
...
@@ -4,7 +4,9 @@ use anyhow::Result;
...
@@ -4,7 +4,9 @@ use anyhow::Result;
use
indoc
::
formatdoc
;
use
indoc
::
formatdoc
;
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks_fs
::
FileContent
;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
ModuleChunkItemIdExt
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
ModuleChunkItemIdExt
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::
Module
,
module
::
Module
,
...
@@ -71,6 +73,18 @@ impl Module for NextDynamicEntryModule {
...
@@ -71,6 +73,18 @@ impl Module for NextDynamicEntryModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
NextDynamicEntryModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
AssetContent
::
File
(
FileContent
::
Content
(
"// This is a marker module for Next.js dynamic."
.into
())
.resolved_cell
(),
)
.cell
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
NextDynamicEntryModule
{
impl
ChunkableModule
for
NextDynamicEntryModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
crates/next-core/src/next_server_component/server_component_module.rs
View file @
a49cd429
...
@@ -4,8 +4,9 @@ use anyhow::Result;
...
@@ -4,8 +4,9 @@ use anyhow::Result;
use
indoc
::
formatdoc
;
use
indoc
::
formatdoc
;
use
turbo_rcstr
::
rcstr
;
use
turbo_rcstr
::
rcstr
;
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks_fs
::
FileSystemPath
;
use
turbo_tasks_fs
::
{
FileContent
,
FileSystemPath
}
;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
ModuleChunkItemIdExt
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
ModuleChunkItemIdExt
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::
Module
,
module
::
Module
,
...
@@ -68,6 +69,20 @@ impl Module for NextServerComponentModule {
...
@@ -68,6 +69,20 @@ impl Module for NextServerComponentModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
NextServerComponentModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
AssetContent
::
File
(
FileContent
::
Content
(
"// This is a marker module for Next.js server components."
.into
(),
)
.resolved_cell
(),
)
.cell
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
NextServerComponentModule
{
impl
ChunkableModule
for
NextServerComponentModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
crates/next-core/src/next_server_utility/server_utility_module.rs
View file @
a49cd429
...
@@ -4,8 +4,9 @@ use anyhow::Result;
...
@@ -4,8 +4,9 @@ use anyhow::Result;
use
indoc
::
formatdoc
;
use
indoc
::
formatdoc
;
use
turbo_rcstr
::
rcstr
;
use
turbo_rcstr
::
rcstr
;
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks_fs
::
FileSystemPath
;
use
turbo_tasks_fs
::
{
FileContent
,
FileSystemPath
}
;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
ModuleChunkItemIdExt
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
ModuleChunkItemIdExt
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::
Module
,
module
::
Module
,
...
@@ -68,6 +69,18 @@ impl Module for NextServerUtilityModule {
...
@@ -68,6 +69,18 @@ impl Module for NextServerUtilityModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
NextServerUtilityModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
AssetContent
::
File
(
FileContent
::
Content
(
"// This is a marker module for Next.js server utilities."
.into
())
.resolved_cell
(),
)
.cell
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
NextServerUtilityModule
{
impl
ChunkableModule
for
NextServerUtilityModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
crates/next-core/src/next_shared/transforms/swc_ecma_transform_plugins.rs
View file @
a49cd429
...
@@ -36,12 +36,11 @@ pub async fn get_swc_ecma_transform_rule_impl(
...
@@ -36,12 +36,11 @@ pub async fn get_swc_ecma_transform_rule_impl(
enable_mdx_rs
:
bool
,
enable_mdx_rs
:
bool
,
)
->
Result
<
Option
<
ModuleRule
>>
{
)
->
Result
<
Option
<
ModuleRule
>>
{
use
anyhow
::
bail
;
use
anyhow
::
bail
;
use
turbo_tasks
::
{
TryFlatJoinIterExt
,
ValueToString
}
;
use
turbo_tasks
::
TryFlatJoinIterExt
;
use
turbo_tasks_fs
::
FileContent
;
use
turbo_tasks_fs
::
FileContent
;
use
turbopack
::{
resolve_options
,
resolve_options_context
::
ResolveOptionsContext
};
use
turbopack
::{
resolve_options
,
resolve_options_context
::
ResolveOptionsContext
};
use
turbopack_core
::{
use
turbopack_core
::{
asset
::
Asset
,
asset
::
Asset
,
module
::
Module
,
reference_type
::{
CommonJsReferenceSubType
,
ReferenceType
},
reference_type
::{
CommonJsReferenceSubType
,
ReferenceType
},
resolve
::{
handle_resolve_error
,
parse
::
Request
,
resolve
},
resolve
::{
handle_resolve_error
,
parse
::
Request
,
resolve
},
};
};
...
@@ -100,16 +99,7 @@ pub async fn get_swc_ecma_transform_rule_impl(
...
@@ -100,16 +99,7 @@ pub async fn get_swc_ecma_transform_rule_impl(
return
Ok
(
None
);
return
Ok
(
None
);
};
};
let
Some
(
plugin_source
)
=
&*
plugin_module
.source
()
.await
?
else
{
let
content
=
&*
plugin_module
.content
()
.file_content
()
.await
?
;
use
anyhow
::
bail
;
bail!
(
"Expected source for plugin module: {}"
,
plugin_module
.ident
()
.to_string
()
.await
?
);
};
let
content
=
&*
plugin_source
.content
()
.file_content
()
.await
?
;
let
FileContent
::
Content
(
file
)
=
content
else
{
let
FileContent
::
Content
(
file
)
=
content
else
{
bail!
(
"Expected file content for plugin module"
);
bail!
(
"Expected file content for plugin module"
);
};
};
...
...
crates/next-core/src/raw_ecmascript_module.rs
View file @
a49cd429
...
@@ -10,7 +10,7 @@ use turbo_tasks::{FxIndexMap, FxIndexSet, ResolvedVc, TryJoinIterExt, ValueToStr
...
@@ -10,7 +10,7 @@ use turbo_tasks::{FxIndexMap, FxIndexSet, ResolvedVc, TryJoinIterExt, ValueToStr
use
turbo_tasks_fs
::{
FileContent
,
glob
::
Glob
,
rope
::
Rope
};
use
turbo_tasks_fs
::{
FileContent
,
glob
::
Glob
,
rope
::
Rope
};
use
turbopack
::{
ModuleAssetContext
,
module_options
::
CustomModuleType
};
use
turbopack
::{
ModuleAssetContext
,
module_options
::
CustomModuleType
};
use
turbopack_core
::{
use
turbopack_core
::{
asset
::
Asset
,
asset
::
{
Asset
,
AssetContent
}
,
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
},
code_builder
::
CodeBuilder
,
code_builder
::
CodeBuilder
,
compile_time_info
::{
compile_time_info
::{
...
@@ -107,6 +107,14 @@ impl Module for RawEcmascriptModule {
...
@@ -107,6 +107,14 @@ impl Module for RawEcmascriptModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
RawEcmascriptModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.source
.content
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
RawEcmascriptModule
{
impl
ChunkableModule
for
RawEcmascriptModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-core/src/changed.rs
View file @
a49cd429
use
anyhow
::
{
Result
,
bail
}
;
use
anyhow
::
Result
;
use
turbo_tasks
::{
use
turbo_tasks
::{
Completion
,
Completions
,
ResolvedVc
,
TryJoinIterExt
,
V
alueToString
,
V
c
,
Completion
,
Completions
,
ResolvedVc
,
TryJoinIterExt
,
Vc
,
graph
::{
AdjacencyMap
,
GraphTraversal
},
graph
::{
AdjacencyMap
,
GraphTraversal
},
};
};
...
@@ -33,7 +33,7 @@ pub async fn any_content_changed_of_module(
...
@@ -33,7 +33,7 @@ pub async fn any_content_changed_of_module(
.completed
()
?
.completed
()
?
.into_inner
()
.into_inner
()
.into_postorder_topological
()
.into_postorder_topological
()
.map
(|
m
|
source_changed
(
*
m
))
.map
(|
m
|
content_changed
(
*
ResolvedVc
::
upcast
(
m
)
))
.map
(|
v
|
v
.to_resolved
())
.map
(|
v
|
v
.to_resolved
())
.try_join
()
.try_join
()
.await
?
;
.await
?
;
...
@@ -85,16 +85,3 @@ pub async fn content_changed(asset: Vc<Box<dyn Asset>>) -> Result<Vc<Completion>
...
@@ -85,16 +85,3 @@ pub async fn content_changed(asset: Vc<Box<dyn Asset>>) -> Result<Vc<Completion>
asset
.content
()
.file_content
()
.await
?
;
asset
.content
()
.file_content
()
.await
?
;
Ok
(
Completion
::
new
())
Ok
(
Completion
::
new
())
}
}
/// Returns a completion that changes when the content of the given asset
/// changes.
#[turbo_tasks
::
function]
pub
async
fn
source_changed
(
asset
:
Vc
<
Box
<
dyn
Module
>>
)
->
Result
<
Vc
<
Completion
>>
{
if
let
Some
(
source
)
=
*
asset
.source
()
.await
?
{
// Reading the file content is enough to add as dependency
source
.content
()
.file_content
()
.await
?
;
}
else
{
bail!
(
"Module {} has no source"
,
asset
.ident
()
.to_string
()
.await
?
)
}
Ok
(
Completion
::
new
())
}
turbopack/crates/turbopack-core/src/chunk/evaluate.rs
View file @
a49cd429
...
@@ -3,6 +3,7 @@ use turbo_tasks::{ResolvedVc, Upcast, ValueToString, Vc};
...
@@ -3,6 +3,7 @@ use turbo_tasks::{ResolvedVc, Upcast, ValueToString, Vc};
use
super
::
ChunkableModule
;
use
super
::
ChunkableModule
;
use
crate
::{
use
crate
::{
asset
::
Asset
,
context
::
AssetContext
,
context
::
AssetContext
,
module
::
Module
,
module
::
Module
,
reference_type
::{
EntryReferenceSubType
,
ReferenceType
},
reference_type
::{
EntryReferenceSubType
,
ReferenceType
},
...
@@ -14,7 +15,7 @@ use crate::{
...
@@ -14,7 +15,7 @@ use crate::{
/// The chunking context implementation will resolve the dynamic entry to a
/// The chunking context implementation will resolve the dynamic entry to a
/// well-known value or trait object.
/// well-known value or trait object.
#[turbo_tasks
::
value_trait]
#[turbo_tasks
::
value_trait]
pub
trait
EvaluatableAsset
:
Module
+
ChunkableModule
{}
pub
trait
EvaluatableAsset
:
Asset
+
Module
+
ChunkableModule
{}
pub
trait
EvaluatableAssetExt
{
pub
trait
EvaluatableAssetExt
{
fn
to_evaluatable
(
fn
to_evaluatable
(
...
...
turbopack/crates/turbopack-core/src/chunk/mod.rs
View file @
a49cd429
...
@@ -90,7 +90,7 @@ pub struct ModuleIds(Vec<ResolvedVc<ModuleId>>);
...
@@ -90,7 +90,7 @@ pub struct ModuleIds(Vec<ResolvedVc<ModuleId>>);
/// A [Module] that can be converted into a [Chunk].
/// A [Module] that can be converted into a [Chunk].
#[turbo_tasks
::
value_trait]
#[turbo_tasks
::
value_trait]
pub
trait
ChunkableModule
:
Module
{
pub
trait
ChunkableModule
:
Module
+
Asset
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
fn
as_chunk_item
(
fn
as_chunk_item
(
self
:
Vc
<
Self
>
,
self
:
Vc
<
Self
>
,
...
@@ -115,7 +115,7 @@ impl ChunkableModules {
...
@@ -115,7 +115,7 @@ impl ChunkableModules {
// with other module types (as a MergeableModule cannot prevent itself from being merged with other
// with other module types (as a MergeableModule cannot prevent itself from being merged with other
// module types)
// module types)
#[turbo_tasks
::
value_trait]
#[turbo_tasks
::
value_trait]
pub
trait
MergeableModule
:
Module
{
pub
trait
MergeableModule
:
Module
+
Asset
{
/// Even though MergeableModule is implemented, this allows a dynamic condition to determine
/// Even though MergeableModule is implemented, this allows a dynamic condition to determine
/// mergeability
/// mergeability
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-core/src/introspect/module.rs
View file @
a49cd429
...
@@ -33,12 +33,8 @@ impl Introspectable for IntrospectableModule {
...
@@ -33,12 +33,8 @@ impl Introspectable for IntrospectableModule {
}
}
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
async
fn
details
(
&
self
)
->
Result
<
Vc
<
RcStr
>>
{
fn
details
(
&
self
)
->
Vc
<
RcStr
>
{
if
let
Some
(
source
)
=
*
self
.
0
.source
()
.await
?
{
content_to_details
(
self
.
0
.content
())
Ok
(
content_to_details
(
source
.content
()))
}
else
{
Ok
(
Vc
::
cell
(
"No source"
.into
()))
}
}
}
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-core/src/module.rs
View file @
a49cd429
...
@@ -2,7 +2,7 @@ use turbo_rcstr::RcStr;
...
@@ -2,7 +2,7 @@ use turbo_rcstr::RcStr;
use
turbo_tasks
::{
ResolvedVc
,
TaskInput
,
ValueToString
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
TaskInput
,
ValueToString
,
Vc
};
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbo_tasks_fs
::
glob
::
Glob
;
use
crate
::{
ident
::
AssetIdent
,
reference
::
ModuleReferences
,
source
::
OptionSource
};
use
crate
::{
asset
::
Asset
,
ident
::
AssetIdent
,
reference
::
ModuleReferences
,
source
::
OptionSource
};
#[derive(Clone,
Copy,
Debug,
TaskInput,
Hash)]
#[derive(Clone,
Copy,
Debug,
TaskInput,
Hash)]
#[turbo_tasks
::
value(shared)]
#[turbo_tasks
::
value(shared)]
...
@@ -14,7 +14,7 @@ pub enum StyleType {
...
@@ -14,7 +14,7 @@ pub enum StyleType {
/// A module. This usually represents parsed source code, which has references
/// A module. This usually represents parsed source code, which has references
/// to other modules.
/// to other modules.
#[turbo_tasks
::
value_trait]
#[turbo_tasks
::
value_trait]
pub
trait
Module
{
pub
trait
Module
:
Asset
{
/// The identifier of the [Module]. It's expected to be unique and capture
/// The identifier of the [Module]. It's expected to be unique and capture
/// all properties of the [Module].
/// all properties of the [Module].
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
@@ -55,7 +55,7 @@ pub trait Module {
...
@@ -55,7 +55,7 @@ pub trait Module {
}
}
#[turbo_tasks
::
value_trait]
#[turbo_tasks
::
value_trait]
pub
trait
StyleModule
:
Module
{
pub
trait
StyleModule
:
Module
+
Asset
{
/// The style type of the module.
/// The style type of the module.
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
fn
style_type
(
&
self
)
->
Vc
<
StyleType
>
;
fn
style_type
(
&
self
)
->
Vc
<
StyleType
>
;
...
...
turbopack/crates/turbopack-core/src/node_addon_module.rs
View file @
a49cd429
...
@@ -7,6 +7,7 @@ use turbo_tasks::{FxIndexSet, ResolvedVc, TryJoinIterExt, Vc};
...
@@ -7,6 +7,7 @@ use turbo_tasks::{FxIndexSet, ResolvedVc, TryJoinIterExt, Vc};
use
turbo_tasks_fs
::{
FileSystemEntryType
,
FileSystemPath
};
use
turbo_tasks_fs
::{
FileSystemEntryType
,
FileSystemPath
};
use
crate
::{
use
crate
::{
asset
::{
Asset
,
AssetContent
},
file_source
::
FileSource
,
file_source
::
FileSource
,
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::
Module
,
module
::
Module
,
...
@@ -101,6 +102,14 @@ impl Module for NodeAddonModule {
...
@@ -101,6 +102,14 @@ impl Module for NodeAddonModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
NodeAddonModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.source
.content
()
}
}
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
async
fn
dir_references
(
package_dir
:
FileSystemPath
)
->
Result
<
Vc
<
ModuleReferences
>>
{
async
fn
dir_references
(
package_dir
:
FileSystemPath
)
->
Result
<
Vc
<
ModuleReferences
>>
{
let
matches
=
read_matches
(
let
matches
=
read_matches
(
...
...
turbopack/crates/turbopack-core/src/raw_module.rs
View file @
a49cd429
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
crate
::{
use
crate
::{
asset
::{
Asset
,
AssetContent
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::
Module
,
module
::
Module
,
source
::{
OptionSource
,
Source
},
source
::{
OptionSource
,
Source
},
...
@@ -26,6 +27,14 @@ impl Module for RawModule {
...
@@ -26,6 +27,14 @@ impl Module for RawModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
RawModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.source
.content
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
RawModule
{
impl
RawModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-core/src/rebase.rs
View file @
a49cd429
use
std
::
hash
::
Hash
;
use
std
::
hash
::
Hash
;
use
anyhow
::
{
Result
,
bail
}
;
use
anyhow
::
Result
;
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
V
alueToString
,
V
c
};
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
Vc
};
use
turbo_tasks_fs
::
FileSystemPath
;
use
turbo_tasks_fs
::
FileSystemPath
;
use
crate
::{
use
crate
::{
...
@@ -74,14 +74,7 @@ impl OutputAsset for RebasedAsset {
...
@@ -74,14 +74,7 @@ impl OutputAsset for RebasedAsset {
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
Asset
for
RebasedAsset
{
impl
Asset
for
RebasedAsset
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
async
fn
content
(
&
self
)
->
Result
<
Vc
<
AssetContent
>>
{
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
if
let
Some
(
source
)
=
*
self
.module
.source
()
.await
?
{
self
.module
.content
()
Ok
(
source
.content
())
}
else
{
bail!
(
"Module {} has no source"
,
self
.module
.ident
()
.to_string
()
.await
?
)
}
}
}
}
}
turbopack/crates/turbopack-core/src/traced_asset.rs
View file @
a49cd429
use
anyhow
::
{
Result
,
bail
}
;
use
anyhow
::
Result
;
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
V
alueToString
,
V
c
};
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
Vc
};
use
turbo_tasks_fs
::
FileSystemPath
;
use
turbo_tasks_fs
::
FileSystemPath
;
use
crate
::{
use
crate
::{
...
@@ -54,14 +54,7 @@ impl OutputAsset for TracedAsset {
...
@@ -54,14 +54,7 @@ impl OutputAsset for TracedAsset {
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
Asset
for
TracedAsset
{
impl
Asset
for
TracedAsset
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
async
fn
content
(
&
self
)
->
Result
<
Vc
<
AssetContent
>>
{
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
if
let
Some
(
source
)
=
*
self
.module
.source
()
.await
?
{
self
.module
.content
()
Ok
(
source
.content
())
}
else
{
bail!
(
"Module {} has no source"
,
self
.module
.ident
()
.to_string
()
.await
?
,
)
}
}
}
}
}
turbopack/crates/turbopack-css/src/asset.rs
View file @
a49cd429
...
@@ -3,6 +3,7 @@ use turbo_rcstr::rcstr;
...
@@ -3,6 +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
::
FileSystemPath
;
use
turbo_tasks_fs
::
FileSystemPath
;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
MinifyType
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
MinifyType
},
context
::
AssetContext
,
context
::
AssetContext
,
environment
::
Environment
,
environment
::
Environment
,
...
@@ -165,6 +166,14 @@ impl StyleModule for CssModuleAsset {
...
@@ -165,6 +166,14 @@ impl StyleModule for CssModuleAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
CssModuleAsset
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.source
.content
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
CssModuleAsset
{
impl
ChunkableModule
for
CssModuleAsset
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-css/src/chunk/mod.rs
View file @
a49cd429
...
@@ -437,7 +437,7 @@ impl GenerateSourceMap for CssChunk {
...
@@ -437,7 +437,7 @@ impl GenerateSourceMap for CssChunk {
// TODO: remove
// TODO: remove
#[turbo_tasks
::
value_trait]
#[turbo_tasks
::
value_trait]
pub
trait
CssChunkPlaceable
:
ChunkableModule
+
Module
{}
pub
trait
CssChunkPlaceable
:
ChunkableModule
+
Module
+
Asset
{}
#[derive(Clone,
Debug)]
#[derive(Clone,
Debug)]
#[turbo_tasks
::
value(shared)]
#[turbo_tasks
::
value(shared)]
...
...
turbopack/crates/turbopack-css/src/embed.rs
View file @
a49cd429
use
turbo_tasks
::
Vc
;
use
turbo_tasks
::
Vc
;
use
turbopack_core
::{
chunk
::
ChunkingContext
,
module
::
Module
,
output
::
OutputAsset
};
use
turbopack_core
::{
asset
::
Asset
,
chunk
::
ChunkingContext
,
module
::
Module
,
output
::
OutputAsset
};
#[turbo_tasks
::
value_trait]
#[turbo_tasks
::
value_trait]
pub
trait
CssEmbed
:
Module
{
pub
trait
CssEmbed
:
Module
+
Asset
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
fn
embedded_asset
(
fn
embedded_asset
(
self
:
Vc
<
Self
>
,
self
:
Vc
<
Self
>
,
...
...
turbopack/crates/turbopack-css/src/module_asset.rs
View file @
a49cd429
...
@@ -8,6 +8,7 @@ use turbo_rcstr::{RcStr, rcstr};
...
@@ -8,6 +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
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
ModuleChunkItemIdExt
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
ModuleChunkItemIdExt
},
context
::{
AssetContext
,
ProcessResult
},
context
::{
AssetContext
,
ProcessResult
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
...
@@ -112,6 +113,14 @@ impl Module for ModuleCssAsset {
...
@@ -112,6 +113,14 @@ impl Module for ModuleCssAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
ModuleCssAsset
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.source
.content
()
}
}
/// A CSS class that is exported from a CSS module.
/// A CSS class that is exported from a CSS module.
///
///
/// See [`ModuleCssClasses`] for more information.
/// See [`ModuleCssClasses`] for more information.
...
...
turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs
View file @
a49cd429
...
@@ -3,6 +3,7 @@ use turbo_rcstr::rcstr;
...
@@ -3,6 +3,7 @@ use turbo_rcstr::rcstr;
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
ChunkableModule
,
ChunkingContext
,
availability_info
::
AvailabilityInfo
},
chunk
::{
ChunkableModule
,
ChunkingContext
,
availability_info
::
AvailabilityInfo
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::
Module
,
module
::
Module
,
...
@@ -75,6 +76,14 @@ impl Module for AsyncLoaderModule {
...
@@ -75,6 +76,14 @@ impl Module for AsyncLoaderModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
AsyncLoaderModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
panic!
(
"content() should not be called"
);
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
AsyncLoaderModule
{
impl
ChunkableModule
for
AsyncLoaderModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-ecmascript/src/chunk/placeable.rs
View file @
a49cd429
...
@@ -24,7 +24,7 @@ use crate::references::{
...
@@ -24,7 +24,7 @@ use crate::references::{
};
};
#[turbo_tasks
::
value_trait]
#[turbo_tasks
::
value_trait]
pub
trait
EcmascriptChunkPlaceable
:
ChunkableModule
+
Module
{
pub
trait
EcmascriptChunkPlaceable
:
ChunkableModule
+
Module
+
Asset
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
fn
get_exports
(
self
:
Vc
<
Self
>
)
->
Vc
<
EcmascriptExports
>
;
fn
get_exports
(
self
:
Vc
<
Self
>
)
->
Vc
<
EcmascriptExports
>
;
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-ecmascript/src/inlined_bytes_module.rs
View file @
a49cd429
...
@@ -5,7 +5,7 @@ use turbo_rcstr::rcstr;
...
@@ -5,7 +5,7 @@ use turbo_rcstr::rcstr;
use
turbo_tasks
::{
ResolvedVc
,
ValueToString
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
ValueToString
,
Vc
};
use
turbo_tasks_fs
::{
FileContent
,
glob
::
Glob
,
rope
::
RopeBuilder
};
use
turbo_tasks_fs
::{
FileContent
,
glob
::
Glob
,
rope
::
RopeBuilder
};
use
turbopack_core
::{
use
turbopack_core
::{
asset
::
Asset
,
asset
::
{
Asset
,
AssetContent
}
,
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::
Module
,
module
::
Module
,
...
@@ -59,6 +59,14 @@ impl Module for InlinedBytesJsModule {
...
@@ -59,6 +59,14 @@ impl Module for InlinedBytesJsModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
InlinedBytesJsModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.source
.content
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
InlinedBytesJsModule
{
impl
ChunkableModule
for
InlinedBytesJsModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
@@ -120,7 +128,7 @@ impl ChunkItem for InlinedBytesJsChunkItem {
...
@@ -120,7 +128,7 @@ impl ChunkItem for InlinedBytesJsChunkItem {
impl
EcmascriptChunkItem
for
InlinedBytesJsChunkItem
{
impl
EcmascriptChunkItem
for
InlinedBytesJsChunkItem
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
async
fn
content
(
&
self
)
->
Result
<
Vc
<
EcmascriptChunkItemContent
>>
{
async
fn
content
(
&
self
)
->
Result
<
Vc
<
EcmascriptChunkItemContent
>>
{
let
content
=
self
.module.
await
?
.source
.
content
()
.file_content
()
.await
?
;
let
content
=
self
.module
.content
()
.file_content
()
.await
?
;
match
&*
content
{
match
&*
content
{
FileContent
::
Content
(
data
)
=>
{
FileContent
::
Content
(
data
)
=>
{
let
mut
inner_code
=
RopeBuilder
::
default
();
let
mut
inner_code
=
RopeBuilder
::
default
();
...
...
turbopack/crates/turbopack-ecmascript/src/lib.rs
View file @
a49cd429
...
@@ -90,6 +90,7 @@ use turbo_tasks::{
...
@@ -90,6 +90,7 @@ 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
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
chunk
::{
AsyncModuleInfo
,
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
EvaluatableAsset
,
AsyncModuleInfo
,
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
EvaluatableAsset
,
MergeableModule
,
MergeableModuleExposure
,
MergeableModules
,
MergeableModulesExposed
,
MergeableModule
,
MergeableModuleExposure
,
MergeableModules
,
MergeableModulesExposed
,
...
@@ -402,7 +403,7 @@ pub trait EcmascriptParsable {
...
@@ -402,7 +403,7 @@ pub trait EcmascriptParsable {
}
}
#[turbo_tasks
::
value_trait]
#[turbo_tasks
::
value_trait]
pub
trait
EcmascriptAnalyzable
:
Module
{
pub
trait
EcmascriptAnalyzable
:
Module
+
Asset
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
fn
analyze
(
self
:
Vc
<
Self
>
)
->
Vc
<
AnalyzeEcmascriptModuleResult
>
;
fn
analyze
(
self
:
Vc
<
Self
>
)
->
Vc
<
AnalyzeEcmascriptModuleResult
>
;
...
@@ -773,6 +774,14 @@ impl Module for EcmascriptModuleAsset {
...
@@ -773,6 +774,14 @@ impl Module for EcmascriptModuleAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
EcmascriptModuleAsset
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.source
.content
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
EcmascriptModuleAsset
{
impl
ChunkableModule
for
EcmascriptModuleAsset
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs
View file @
a49cd429
...
@@ -3,6 +3,7 @@ use turbo_rcstr::{RcStr, rcstr};
...
@@ -3,6 +3,7 @@ use turbo_rcstr::{RcStr, rcstr};
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
Vc
};
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
chunk
::{
ChunkableModule
,
ChunkingContext
,
ChunkingContextExt
,
availability_info
::
AvailabilityInfo
,
ChunkableModule
,
ChunkingContext
,
ChunkingContextExt
,
availability_info
::
AvailabilityInfo
,
},
},
...
@@ -161,6 +162,14 @@ impl Module for ManifestAsyncModule {
...
@@ -161,6 +162,14 @@ impl Module for ManifestAsyncModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
ManifestAsyncModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
panic!
(
"content() should not be called"
);
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
ManifestAsyncModule
{
impl
ChunkableModule
for
ManifestAsyncModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-ecmascript/src/merged_module.rs
View file @
a49cd429
use
anyhow
::{
Context
,
Result
};
use
anyhow
::{
Context
,
Result
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
chunk
::{
AsyncModuleInfo
,
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
AsyncModuleInfo
,
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
MergeableModuleExposure
,
MergeableModules
,
MergeableModulesExposed
,
MergeableModuleExposure
,
MergeableModules
,
MergeableModulesExposed
,
...
@@ -59,6 +60,14 @@ impl MergedEcmascriptModule {
...
@@ -59,6 +60,14 @@ impl MergedEcmascriptModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
MergedEcmascriptModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
panic!
(
"content() should not be called"
);
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
Module
for
MergedEcmascriptModule
{
impl
Module
for
MergedEcmascriptModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-ecmascript/src/references/external_module.rs
View file @
a49cd429
...
@@ -4,8 +4,9 @@ use anyhow::Result;
...
@@ -4,8 +4,9 @@ use anyhow::Result;
use
serde
::{
Deserialize
,
Serialize
};
use
serde
::{
Deserialize
,
Serialize
};
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_tasks
::{
NonLocalValue
,
ResolvedVc
,
TaskInput
,
TryJoinIterExt
,
Vc
,
trace
::
TraceRawVcs
};
use
turbo_tasks
::{
NonLocalValue
,
ResolvedVc
,
TaskInput
,
TryJoinIterExt
,
Vc
,
trace
::
TraceRawVcs
};
use
turbo_tasks_fs
::{
FileSystem
,
VirtualFileSystem
,
glob
::
Glob
,
rope
::
RopeBuilder
};
use
turbo_tasks_fs
::{
File
Content
,
File
System
,
VirtualFileSystem
,
glob
::
Glob
,
rope
::
RopeBuilder
};
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
AsyncModuleInfo
,
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
},
chunk
::{
AsyncModuleInfo
,
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
},
ident
::{
AssetIdent
,
Layer
},
ident
::{
AssetIdent
,
Layer
},
module
::
Module
,
module
::
Module
,
...
@@ -312,6 +313,15 @@ impl Module for CachedExternalModule {
...
@@ -312,6 +313,15 @@ impl Module for CachedExternalModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
CachedExternalModule
{
#[turbo_tasks
::
function]
fn
content
(
self
:
Vc
<
Self
>
)
->
Vc
<
AssetContent
>
{
// should be `NotFound` as this function gets called to detect source changes
AssetContent
::
file
(
FileContent
::
NotFound
.cell
())
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
CachedExternalModule
{
impl
ChunkableModule
for
CachedExternalModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
@@ -435,6 +445,14 @@ impl ModuleWithoutSelfAsync {
...
@@ -435,6 +445,14 @@ impl ModuleWithoutSelfAsync {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
ModuleWithoutSelfAsync
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.module
.content
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
Module
for
ModuleWithoutSelfAsync
{
impl
Module
for
ModuleWithoutSelfAsync
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
@@ -444,7 +462,7 @@ impl Module for ModuleWithoutSelfAsync {
...
@@ -444,7 +462,7 @@ impl Module for ModuleWithoutSelfAsync {
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
fn
source
(
&
self
)
->
Vc
<
turbopack_core
::
source
::
OptionSource
>
{
fn
source
(
&
self
)
->
Vc
<
turbopack_core
::
source
::
OptionSource
>
{
self
.module
.source
(
)
Vc
::
cell
(
None
)
}
}
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-ecmascript/src/references/require_context.rs
View file @
a49cd429
...
@@ -21,6 +21,7 @@ use turbo_tasks::{
...
@@ -21,6 +21,7 @@ use turbo_tasks::{
};
};
use
turbo_tasks_fs
::{
DirectoryContent
,
DirectoryEntry
,
FileSystemPath
,
glob
::
Glob
};
use
turbo_tasks_fs
::{
DirectoryContent
,
DirectoryEntry
,
FileSystemPath
,
glob
::
Glob
};
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkableModuleReference
,
ChunkingContext
,
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkableModuleReference
,
ChunkingContext
,
MinifyType
,
ModuleChunkItemIdExt
,
MinifyType
,
ModuleChunkItemIdExt
,
...
@@ -435,6 +436,14 @@ impl Module for RequireContextAsset {
...
@@ -435,6 +436,14 @@ impl Module for RequireContextAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
RequireContextAsset
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
unimplemented!
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
RequireContextAsset
{
impl
ChunkableModule
for
RequireContextAsset
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/module.rs
View file @
a49cd429
...
@@ -2,8 +2,9 @@ use std::collections::BTreeMap;
...
@@ -2,8 +2,9 @@ use std::collections::BTreeMap;
use
anyhow
::{
Result
,
bail
};
use
anyhow
::{
Result
,
bail
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbo_tasks_fs
::
{
File
,
FileContent
,
glob
::
Glob
}
;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
chunk
::{
AsyncModuleInfo
,
ChunkableModule
,
ChunkingContext
,
EvaluatableAsset
,
MergeableModule
,
AsyncModuleInfo
,
ChunkableModule
,
ChunkingContext
,
EvaluatableAsset
,
MergeableModule
,
MergeableModules
,
MergeableModulesExposed
,
MergeableModules
,
MergeableModulesExposed
,
...
@@ -197,6 +198,16 @@ impl Module for EcmascriptModuleFacadeModule {
...
@@ -197,6 +198,16 @@ impl Module for EcmascriptModuleFacadeModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
EcmascriptModuleFacadeModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
let
f
=
File
::
from
(
""
);
AssetContent
::
file
(
FileContent
::
Content
(
f
)
.cell
())
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptAnalyzable
for
EcmascriptModuleFacadeModule
{
impl
EcmascriptAnalyzable
for
EcmascriptModuleFacadeModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/module.rs
View file @
a49cd429
...
@@ -4,6 +4,7 @@ use anyhow::{Result, bail};
...
@@ -4,6 +4,7 @@ use anyhow::{Result, bail};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
chunk
::{
AsyncModuleInfo
,
ChunkableModule
,
ChunkingContext
,
MergeableModule
,
MergeableModules
,
AsyncModuleInfo
,
ChunkableModule
,
ChunkingContext
,
MergeableModule
,
MergeableModules
,
MergeableModulesExposed
,
MergeableModulesExposed
,
...
@@ -78,6 +79,14 @@ impl Module for EcmascriptModuleLocalsModule {
...
@@ -78,6 +79,14 @@ impl Module for EcmascriptModuleLocalsModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
EcmascriptModuleLocalsModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.module
.content
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptAnalyzable
for
EcmascriptModuleLocalsModule
{
impl
EcmascriptAnalyzable
for
EcmascriptModuleLocalsModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs
View file @
a49cd429
...
@@ -3,6 +3,7 @@ use turbo_rcstr::{RcStr, rcstr};
...
@@ -3,6 +3,7 @@ use turbo_rcstr::{RcStr, rcstr};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
AsyncModuleInfo
,
ChunkableModule
,
ChunkingContext
,
EvaluatableAsset
},
chunk
::{
AsyncModuleInfo
,
ChunkableModule
,
ChunkingContext
,
EvaluatableAsset
},
context
::
AssetContext
,
context
::
AssetContext
,
ident
::
AssetIdent
,
ident
::
AssetIdent
,
...
@@ -365,6 +366,14 @@ impl Module for EcmascriptModulePartAsset {
...
@@ -365,6 +366,14 @@ impl Module for EcmascriptModulePartAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
EcmascriptModulePartAsset
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.full_module
.content
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
EcmascriptModulePartAsset
{
impl
EcmascriptChunkPlaceable
for
EcmascriptModulePartAsset
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-ecmascript/src/tree_shake/side_effect_module.rs
View file @
a49cd429
use
anyhow
::
Result
;
use
anyhow
::
Result
;
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
Vc
};
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbo_tasks_fs
::
{
FileContent
,
glob
::
Glob
}
;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
ChunkableModule
,
ChunkingContext
,
EvaluatableAsset
},
chunk
::{
ChunkableModule
,
ChunkingContext
,
EvaluatableAsset
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::
Module
,
module
::
Module
,
...
@@ -118,6 +119,21 @@ impl Module for SideEffectsModule {
...
@@ -118,6 +119,21 @@ impl Module for SideEffectsModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
SideEffectsModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
AssetContent
::
File
(
FileContent
::
Content
(
"// This is a proxy module for reexportings a module with additional side effects."
.into
(),
)
.resolved_cell
(),
)
.cell
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
EcmascriptChunkPlaceable
for
SideEffectsModule
{
impl
EcmascriptChunkPlaceable
for
SideEffectsModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-ecmascript/src/typescript/mod.rs
View file @
a49cd429
...
@@ -4,7 +4,7 @@ use turbo_rcstr::{RcStr, rcstr};
...
@@ -4,7 +4,7 @@ use turbo_rcstr::{RcStr, rcstr};
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
ValueToString
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
TryJoinIterExt
,
ValueToString
,
Vc
};
use
turbo_tasks_fs
::
DirectoryContent
;
use
turbo_tasks_fs
::
DirectoryContent
;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::
Asset
,
asset
::
{
Asset
,
AssetContent
}
,
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::
Module
,
module
::
Module
,
raw_module
::
RawModule
,
raw_module
::
RawModule
,
...
@@ -180,6 +180,14 @@ impl Module for TsConfigModuleAsset {
...
@@ -180,6 +180,14 @@ impl Module for TsConfigModuleAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
TsConfigModuleAsset
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.source
.content
()
}
}
#[turbo_tasks
::
value]
#[turbo_tasks
::
value]
#[derive(Hash,
Debug)]
#[derive(Hash,
Debug)]
pub
struct
CompilerReference
{
pub
struct
CompilerReference
{
...
...
turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs
View file @
a49cd429
...
@@ -3,6 +3,7 @@ use swc_core::ecma::ast::Lit;
...
@@ -3,6 +3,7 @@ use swc_core::ecma::ast::Lit;
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_tasks
::{
ResolvedVc
,
ValueToString
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
ValueToString
,
Vc
};
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
file_source
::
FileSource
,
file_source
::
FileSource
,
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::
Module
,
module
::
Module
,
...
@@ -65,6 +66,14 @@ impl Module for WebpackModuleAsset {
...
@@ -65,6 +66,14 @@ impl Module for WebpackModuleAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
WebpackModuleAsset
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.source
.content
()
}
}
#[turbo_tasks
::
value(shared)]
#[turbo_tasks
::
value(shared)]
pub
struct
WebpackChunkAssetReference
{
pub
struct
WebpackChunkAssetReference
{
#[turbo_tasks(trace_ignore)]
#[turbo_tasks(trace_ignore)]
...
...
turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs
View file @
a49cd429
...
@@ -3,6 +3,7 @@ use turbo_rcstr::{RcStr, rcstr};
...
@@ -3,6 +3,7 @@ use turbo_rcstr::{RcStr, rcstr};
use
turbo_tasks
::{
ResolvedVc
,
ValueToString
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
ValueToString
,
Vc
};
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
chunk
::{
ChunkGroupType
,
ChunkableModule
,
ChunkableModuleReference
,
ChunkingContext
,
ChunkingType
,
ChunkGroupType
,
ChunkableModule
,
ChunkableModuleReference
,
ChunkingContext
,
ChunkingType
,
ChunkingTypeOption
,
ChunkingTypeOption
,
...
@@ -66,6 +67,14 @@ impl Module for WorkerLoaderModule {
...
@@ -66,6 +67,14 @@ impl Module for WorkerLoaderModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
WorkerLoaderModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
panic!
(
"content() should not be called"
);
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
WorkerLoaderModule
{
impl
ChunkableModule
for
WorkerLoaderModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-json/src/lib.rs
View file @
a49cd429
...
@@ -16,7 +16,7 @@ use turbo_rcstr::rcstr;
...
@@ -16,7 +16,7 @@ use turbo_rcstr::rcstr;
use
turbo_tasks
::{
ResolvedVc
,
ValueToString
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
ValueToString
,
Vc
};
use
turbo_tasks_fs
::{
FileContent
,
FileJsonContent
,
glob
::
Glob
};
use
turbo_tasks_fs
::{
FileContent
,
FileJsonContent
,
glob
::
Glob
};
use
turbopack_core
::{
use
turbopack_core
::{
asset
::
Asset
,
asset
::
{
Asset
,
AssetContent
}
,
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
},
code_builder
::
CodeBuilder
,
code_builder
::
CodeBuilder
,
ident
::
AssetIdent
,
ident
::
AssetIdent
,
...
@@ -67,6 +67,14 @@ impl Module for JsonModuleAsset {
...
@@ -67,6 +67,14 @@ impl Module for JsonModuleAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
JsonModuleAsset
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.source
.content
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
JsonModuleAsset
{
impl
ChunkableModule
for
JsonModuleAsset
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
@@ -130,7 +138,7 @@ impl EcmascriptChunkItem for JsonChunkItem {
...
@@ -130,7 +138,7 @@ impl EcmascriptChunkItem for JsonChunkItem {
async
fn
content
(
&
self
)
->
Result
<
Vc
<
EcmascriptChunkItemContent
>>
{
async
fn
content
(
&
self
)
->
Result
<
Vc
<
EcmascriptChunkItemContent
>>
{
// We parse to JSON and then stringify again to ensure that the
// We parse to JSON and then stringify again to ensure that the
// JSON is valid.
// JSON is valid.
let
content
=
self
.module.
await
?
.source
.
content
()
.file_content
();
let
content
=
self
.module
.content
()
.file_content
();
let
data
=
content
.parse_json
()
.await
?
;
let
data
=
content
.parse_json
()
.await
?
;
match
&*
data
{
match
&*
data
{
FileJsonContent
::
Content
(
data
)
=>
{
FileJsonContent
::
Content
(
data
)
=>
{
...
...
turbopack/crates/turbopack-static/src/css.rs
View file @
a49cd429
...
@@ -2,7 +2,12 @@ use turbo_rcstr::{RcStr, rcstr};
...
@@ -2,7 +2,12 @@ use turbo_rcstr::{RcStr, rcstr};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbopack_core
::{
use
turbopack_core
::{
chunk
::
ChunkingContext
,
ident
::
AssetIdent
,
module
::
Module
,
output
::
OutputAsset
,
source
::
Source
,
asset
::{
Asset
,
AssetContent
},
chunk
::
ChunkingContext
,
ident
::
AssetIdent
,
module
::
Module
,
output
::
OutputAsset
,
source
::
Source
,
};
};
use
turbopack_css
::
embed
::
CssEmbed
;
use
turbopack_css
::
embed
::
CssEmbed
;
...
@@ -56,6 +61,14 @@ impl Module for StaticUrlCssModule {
...
@@ -56,6 +61,14 @@ impl Module for StaticUrlCssModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
StaticUrlCssModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.source
.content
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
CssEmbed
for
StaticUrlCssModule
{
impl
CssEmbed
for
StaticUrlCssModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-static/src/ecma.rs
View file @
a49cd429
...
@@ -3,6 +3,7 @@ use turbo_rcstr::{RcStr, rcstr};
...
@@ -3,6 +3,7 @@ use turbo_rcstr::{RcStr, rcstr};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks
::{
ResolvedVc
,
Vc
};
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbo_tasks_fs
::
glob
::
Glob
;
use
turbopack_core
::{
use
turbopack_core
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
},
ident
::
AssetIdent
,
ident
::
AssetIdent
,
module
::
Module
,
module
::
Module
,
...
@@ -72,6 +73,14 @@ impl Module for StaticUrlJsModule {
...
@@ -72,6 +73,14 @@ impl Module for StaticUrlJsModule {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
StaticUrlJsModule
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.source
.content
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
StaticUrlJsModule
{
impl
ChunkableModule
for
StaticUrlJsModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-wasm/src/module_asset.rs
View file @
a49cd429
...
@@ -3,6 +3,7 @@ use turbo_rcstr::rcstr;
...
@@ -3,6 +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
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
chunk
::{
AsyncModuleInfo
,
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
AsyncModuleInfo
,
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
,
chunk_group
::
references_to_output_assets
,
chunk_group
::
references_to_output_assets
,
...
@@ -145,6 +146,14 @@ impl Module for WebAssemblyModuleAsset {
...
@@ -145,6 +146,14 @@ impl Module for WebAssemblyModuleAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
WebAssemblyModuleAsset
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.source
.content
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
WebAssemblyModuleAsset
{
impl
ChunkableModule
for
WebAssemblyModuleAsset
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
turbopack/crates/turbopack-wasm/src/raw.rs
View file @
a49cd429
...
@@ -2,6 +2,7 @@ use anyhow::{Result, bail};
...
@@ -2,6 +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
::{
asset
::{
Asset
,
AssetContent
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
},
chunk
::{
ChunkItem
,
ChunkType
,
ChunkableModule
,
ChunkingContext
},
context
::
AssetContext
,
context
::
AssetContext
,
ident
::
AssetIdent
,
ident
::
AssetIdent
,
...
@@ -65,6 +66,14 @@ impl Module for RawWebAssemblyModuleAsset {
...
@@ -65,6 +66,14 @@ impl Module for RawWebAssemblyModuleAsset {
}
}
}
}
#[turbo_tasks
::
value_impl]
impl
Asset
for
RawWebAssemblyModuleAsset
{
#[turbo_tasks
::
function]
fn
content
(
&
self
)
->
Vc
<
AssetContent
>
{
self
.source
.content
()
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
impl
ChunkableModule
for
RawWebAssemblyModuleAsset
{
impl
ChunkableModule
for
RawWebAssemblyModuleAsset
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
...
...
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