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
7af2a39e
Commit
7af2a39e
authored
Aug 13, 2025
by
Tobias Koppers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move evaluation to EcmascriptExports
parent
8c732389
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
58 additions
and
15 deletions
+58
-15
hmr_entry.rs
crates/next-core/src/hmr_entry.rs
+2
-0
dynamic_module.rs
crates/next-core/src/next_dynamic/dynamic_module.rs
+1
-1
server_component_module.rs
...core/src/next_server_component/server_component_module.rs
+1
-1
server_utility_module.rs
...ext-core/src/next_server_utility/server_utility_module.rs
+1
-1
module_asset.rs
turbopack/crates/turbopack-css/src/module_asset.rs
+2
-0
placeable.rs
turbopack/crates/turbopack-ecmascript/src/chunk/placeable.rs
+2
-1
chunk_asset.rs
...k/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs
+5
-1
export.rs
.../crates/turbopack-ecmascript/src/references/esm/export.rs
+0
-1
external_module.rs
...es/turbopack-ecmascript/src/references/external_module.rs
+6
-1
mod.rs
turbopack/crates/turbopack-ecmascript/src/references/mod.rs
+26
-5
require_context.rs
...es/turbopack-ecmascript/src/references/require_context.rs
+2
-0
module.rs
...-ecmascript/src/side_effect_optimization/facade/module.rs
+1
-1
module.rs
...-ecmascript/src/side_effect_optimization/locals/module.rs
+3
-2
lib.rs
turbopack/crates/turbopack-json/src/lib.rs
+2
-0
ecma.rs
turbopack/crates/turbopack-static/src/ecma.rs
+2
-0
raw.rs
turbopack/crates/turbopack-wasm/src/raw.rs
+2
-0
No files found.
crates/next-core/src/hmr_entry.rs
View file @
7af2a39e
...
@@ -21,6 +21,7 @@ use turbopack_ecmascript::{
...
@@ -21,6 +21,7 @@ use turbopack_ecmascript::{
EcmascriptChunkItem
,
EcmascriptChunkItemContent
,
EcmascriptChunkItemOptions
,
EcmascriptChunkItem
,
EcmascriptChunkItemContent
,
EcmascriptChunkItemOptions
,
EcmascriptChunkPlaceable
,
EcmascriptChunkType
,
EcmascriptExports
,
EcmascriptExportsType
,
EcmascriptChunkPlaceable
,
EcmascriptChunkType
,
EcmascriptExports
,
EcmascriptExportsType
,
},
},
references
::
esm
::
EsmEvaluation
,
runtime_functions
::
TURBOPACK_REQUIRE
,
runtime_functions
::
TURBOPACK_REQUIRE
,
utils
::
StringifyJs
,
utils
::
StringifyJs
,
};
};
...
@@ -104,6 +105,7 @@ impl EcmascriptChunkPlaceable for HmrEntryModule {
...
@@ -104,6 +105,7 @@ impl EcmascriptChunkPlaceable for HmrEntryModule {
fn
get_exports
(
self
:
Vc
<
Self
>
)
->
Vc
<
EcmascriptExports
>
{
fn
get_exports
(
self
:
Vc
<
Self
>
)
->
Vc
<
EcmascriptExports
>
{
EcmascriptExports
{
EcmascriptExports
{
ty
:
EcmascriptExportsType
::
None
,
ty
:
EcmascriptExportsType
::
None
,
evaluation
:
EsmEvaluation
::
SideEffects
,
}
}
.cell
()
.cell
()
}
}
...
...
crates/next-core/src/next_dynamic/dynamic_module.rs
View file @
7af2a39e
...
@@ -118,10 +118,10 @@ impl EcmascriptChunkPlaceable for NextDynamicEntryModule {
...
@@ -118,10 +118,10 @@ impl EcmascriptChunkPlaceable for NextDynamicEntryModule {
EsmExports
{
EsmExports
{
exports
,
exports
,
star_exports
:
vec!
[
module_reference
],
star_exports
:
vec!
[
module_reference
],
evaluation
:
EsmEvaluation
::
DelegatedSideEffects
(
module_reference
),
}
}
.resolved_cell
(),
.resolved_cell
(),
),
),
evaluation
:
EsmEvaluation
::
DelegatedSideEffects
(
module_reference
),
}
}
.cell
())
.cell
())
}
}
...
...
crates/next-core/src/next_server_component/server_component_module.rs
View file @
7af2a39e
...
@@ -111,10 +111,10 @@ impl EcmascriptChunkPlaceable for NextServerComponentModule {
...
@@ -111,10 +111,10 @@ impl EcmascriptChunkPlaceable for NextServerComponentModule {
EsmExports
{
EsmExports
{
exports
,
exports
,
star_exports
:
vec!
[
module_reference
],
star_exports
:
vec!
[
module_reference
],
evaluation
:
EsmEvaluation
::
DelegatedSideEffects
(
module_reference
),
}
}
.resolved_cell
(),
.resolved_cell
(),
),
),
evaluation
:
EsmEvaluation
::
DelegatedSideEffects
(
module_reference
),
}
}
.cell
())
.cell
())
}
}
...
...
crates/next-core/src/next_server_utility/server_utility_module.rs
View file @
7af2a39e
...
@@ -111,10 +111,10 @@ impl EcmascriptChunkPlaceable for NextServerUtilityModule {
...
@@ -111,10 +111,10 @@ impl EcmascriptChunkPlaceable for NextServerUtilityModule {
EsmExports
{
EsmExports
{
exports
,
exports
,
star_exports
:
vec!
[
module_reference
],
star_exports
:
vec!
[
module_reference
],
evaluation
:
EsmEvaluation
::
DelegatedSideEffects
(
module_reference
),
}
}
.resolved_cell
(),
.resolved_cell
(),
),
),
evaluation
:
EsmEvaluation
::
DelegatedSideEffects
(
module_reference
),
}
}
.cell
())
.cell
())
}
}
...
...
turbopack/crates/turbopack-css/src/module_asset.rs
View file @
7af2a39e
...
@@ -29,6 +29,7 @@ use turbopack_ecmascript::{
...
@@ -29,6 +29,7 @@ use turbopack_ecmascript::{
EcmascriptChunkType
,
EcmascriptExports
,
EcmascriptExportsType
,
EcmascriptChunkType
,
EcmascriptExports
,
EcmascriptExportsType
,
},
},
parse
::
generate_js_source_map
,
parse
::
generate_js_source_map
,
references
::
esm
::
EsmEvaluation
,
runtime_functions
::{
TURBOPACK_EXPORT_VALUE
,
TURBOPACK_IMPORT
},
runtime_functions
::{
TURBOPACK_EXPORT_VALUE
,
TURBOPACK_IMPORT
},
utils
::
StringifyJs
,
utils
::
StringifyJs
,
};
};
...
@@ -265,6 +266,7 @@ impl EcmascriptChunkPlaceable for ModuleCssAsset {
...
@@ -265,6 +266,7 @@ impl EcmascriptChunkPlaceable for ModuleCssAsset {
fn
get_exports
(
&
self
)
->
Vc
<
EcmascriptExports
>
{
fn
get_exports
(
&
self
)
->
Vc
<
EcmascriptExports
>
{
EcmascriptExports
{
EcmascriptExports
{
ty
:
EcmascriptExportsType
::
Value
,
ty
:
EcmascriptExportsType
::
Value
,
evaluation
:
EsmEvaluation
::
SideEffects
,
}
}
.cell
()
.cell
()
}
}
...
...
turbopack/crates/turbopack-ecmascript/src/chunk/placeable.rs
View file @
7af2a39e
...
@@ -21,7 +21,7 @@ use turbopack_core::{
...
@@ -21,7 +21,7 @@ use turbopack_core::{
use
crate
::
references
::{
use
crate
::
references
::{
async_module
::
OptionAsyncModule
,
async_module
::
OptionAsyncModule
,
esm
::{
EsmExport
,
EsmExports
},
esm
::{
EsmE
valuation
,
EsmE
xport
,
EsmExports
},
};
};
#[turbo_tasks
::
value_trait]
#[turbo_tasks
::
value_trait]
...
@@ -222,6 +222,7 @@ pub async fn is_marked_as_side_effect_free(
...
@@ -222,6 +222,7 @@ pub async fn is_marked_as_side_effect_free(
#[turbo_tasks
::
value(shared)]
#[turbo_tasks
::
value(shared)]
pub
struct
EcmascriptExports
{
pub
struct
EcmascriptExports
{
pub
ty
:
EcmascriptExportsType
,
pub
ty
:
EcmascriptExportsType
,
pub
evaluation
:
EsmEvaluation
,
}
}
#[derive(Debug,
Clone,
Eq,
PartialEq,
Serialize,
Deserialize,
TraceRawVcs,
NonLocalValue)]
#[derive(Debug,
Clone,
Eq,
PartialEq,
Serialize,
Deserialize,
TraceRawVcs,
NonLocalValue)]
...
...
turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs
View file @
7af2a39e
...
@@ -16,7 +16,10 @@ use turbopack_core::{
...
@@ -16,7 +16,10 @@ use turbopack_core::{
};
};
use
super
::
chunk_item
::
ManifestChunkItem
;
use
super
::
chunk_item
::
ManifestChunkItem
;
use
crate
::
chunk
::{
EcmascriptChunkPlaceable
,
EcmascriptExports
,
EcmascriptExportsType
};
use
crate
::{
chunk
::{
EcmascriptChunkPlaceable
,
EcmascriptExports
,
EcmascriptExportsType
},
references
::
esm
::
EsmEvaluation
,
};
/// The manifest module is deferred until requested by the manifest loader
/// The manifest module is deferred until requested by the manifest loader
/// item when the dynamic `import()` expression is reached.
/// item when the dynamic `import()` expression is reached.
...
@@ -174,6 +177,7 @@ impl EcmascriptChunkPlaceable for ManifestAsyncModule {
...
@@ -174,6 +177,7 @@ impl EcmascriptChunkPlaceable for ManifestAsyncModule {
fn
get_exports
(
&
self
)
->
Vc
<
EcmascriptExports
>
{
fn
get_exports
(
&
self
)
->
Vc
<
EcmascriptExports
>
{
EcmascriptExports
{
EcmascriptExports
{
ty
:
EcmascriptExportsType
::
Value
,
ty
:
EcmascriptExportsType
::
Value
,
evaluation
:
EsmEvaluation
::
SideEffects
,
}
}
.cell
()
.cell
()
}
}
...
...
turbopack/crates/turbopack-ecmascript/src/references/esm/export.rs
View file @
7af2a39e
...
@@ -561,7 +561,6 @@ pub enum EsmEvaluation {
...
@@ -561,7 +561,6 @@ pub enum EsmEvaluation {
pub
struct
EsmExports
{
pub
struct
EsmExports
{
pub
exports
:
BTreeMap
<
RcStr
,
EsmExport
>
,
pub
exports
:
BTreeMap
<
RcStr
,
EsmExport
>
,
pub
star_exports
:
Vec
<
ResolvedVc
<
Box
<
dyn
ModuleReference
>>>
,
pub
star_exports
:
Vec
<
ResolvedVc
<
Box
<
dyn
ModuleReference
>>>
,
pub
evaluation
:
EsmEvaluation
,
}
}
/// The expanded version of [`EsmExports`], the `exports` field here includes all exports that could
/// The expanded version of [`EsmExports`], the `exports` field here includes all exports that could
...
...
turbopack/crates/turbopack-ecmascript/src/references/external_module.rs
View file @
7af2a39e
...
@@ -26,7 +26,10 @@ use crate::{
...
@@ -26,7 +26,10 @@ use crate::{
EcmascriptChunkItem
,
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptChunkItem
,
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptChunkType
,
EcmascriptExports
,
EcmascriptExportsType
,
EcmascriptChunkType
,
EcmascriptExports
,
EcmascriptExportsType
,
},
},
references
::
async_module
::{
AsyncModule
,
OptionAsyncModule
},
references
::{
async_module
::{
AsyncModule
,
OptionAsyncModule
},
esm
::
EsmEvaluation
,
},
runtime_functions
::{
runtime_functions
::{
TURBOPACK_EXPORT_NAMESPACE
,
TURBOPACK_EXPORT_VALUE
,
TURBOPACK_EXTERNAL_IMPORT
,
TURBOPACK_EXPORT_NAMESPACE
,
TURBOPACK_EXPORT_VALUE
,
TURBOPACK_EXTERNAL_IMPORT
,
TURBOPACK_EXTERNAL_REQUIRE
,
TURBOPACK_LOAD_BY_URL
,
TURBOPACK_EXTERNAL_REQUIRE
,
TURBOPACK_LOAD_BY_URL
,
...
@@ -321,11 +324,13 @@ impl EcmascriptChunkPlaceable for CachedExternalModule {
...
@@ -321,11 +324,13 @@ impl EcmascriptChunkPlaceable for CachedExternalModule {
if
self
.external_type
==
CachedExternalType
::
CommonJs
{
if
self
.external_type
==
CachedExternalType
::
CommonJs
{
EcmascriptExports
{
EcmascriptExports
{
ty
:
EcmascriptExportsType
::
CommonJs
,
ty
:
EcmascriptExportsType
::
CommonJs
,
evaluation
:
EsmEvaluation
::
SideEffects
,
}
}
.cell
()
.cell
()
}
else
{
}
else
{
EcmascriptExports
{
EcmascriptExports
{
ty
:
EcmascriptExportsType
::
DynamicNamespace
,
ty
:
EcmascriptExportsType
::
DynamicNamespace
,
evaluation
:
EsmEvaluation
::
SideEffects
,
}
}
.cell
()
.cell
()
}
}
...
...
turbopack/crates/turbopack-ecmascript/src/references/mod.rs
View file @
7af2a39e
...
@@ -227,6 +227,7 @@ pub struct AnalyzeEcmascriptModuleResultBuilder {
...
@@ -227,6 +227,7 @@ pub struct AnalyzeEcmascriptModuleResultBuilder {
code_gens
:
Vec
<
CodeGen
>
,
code_gens
:
Vec
<
CodeGen
>
,
exports
:
EcmascriptExportsType
,
exports
:
EcmascriptExportsType
,
evaluation
:
EsmEvaluation
,
async_module
:
ResolvedVc
<
OptionAsyncModule
>
,
async_module
:
ResolvedVc
<
OptionAsyncModule
>
,
successful
:
bool
,
successful
:
bool
,
source_map
:
Option
<
ResolvedVc
<
Box
<
dyn
GenerateSourceMap
>>>
,
source_map
:
Option
<
ResolvedVc
<
Box
<
dyn
GenerateSourceMap
>>>
,
...
@@ -245,6 +246,7 @@ impl AnalyzeEcmascriptModuleResultBuilder {
...
@@ -245,6 +246,7 @@ impl AnalyzeEcmascriptModuleResultBuilder {
esm_references_free_var
:
Default
::
default
(),
esm_references_free_var
:
Default
::
default
(),
code_gens
:
Default
::
default
(),
code_gens
:
Default
::
default
(),
exports
:
EcmascriptExportsType
::
Unknown
,
exports
:
EcmascriptExportsType
::
Unknown
,
evaluation
:
EsmEvaluation
::
SideEffects
,
async_module
:
ResolvedVc
::
cell
(
None
),
async_module
:
ResolvedVc
::
cell
(
None
),
successful
:
false
,
successful
:
false
,
source_map
:
None
,
source_map
:
None
,
...
@@ -305,6 +307,11 @@ impl AnalyzeEcmascriptModuleResultBuilder {
...
@@ -305,6 +307,11 @@ impl AnalyzeEcmascriptModuleResultBuilder {
self
.exports
=
exports
;
self
.exports
=
exports
;
}
}
/// Sets the analysis result evaluation.
pub
fn
set_evaluation
(
&
mut
self
,
evaluation
:
EsmEvaluation
)
{
self
.evaluation
=
evaluation
;
}
/// Sets the analysis result ES export.
/// Sets the analysis result ES export.
pub
fn
set_async_module
(
&
mut
self
,
async_module
:
ResolvedVc
<
AsyncModule
>
)
{
pub
fn
set_async_module
(
&
mut
self
,
async_module
:
ResolvedVc
<
AsyncModule
>
)
{
self
.async_module
=
ResolvedVc
::
cell
(
Some
(
async_module
));
self
.async_module
=
ResolvedVc
::
cell
(
Some
(
async_module
));
...
@@ -411,7 +418,11 @@ impl AnalyzeEcmascriptModuleResultBuilder {
...
@@ -411,7 +418,11 @@ impl AnalyzeEcmascriptModuleResultBuilder {
esm_reexport_references
.unwrap_or_default
(),
esm_reexport_references
.unwrap_or_default
(),
),
),
code_generation
:
ResolvedVc
::
cell
(
self
.code_gens
),
code_generation
:
ResolvedVc
::
cell
(
self
.code_gens
),
exports
:
EcmascriptExports
{
ty
:
self
.exports
}
.resolved_cell
(),
exports
:
EcmascriptExports
{
ty
:
self
.exports
,
evaluation
:
self
.evaluation
,
}
.resolved_cell
(),
async_module
:
self
.async_module
,
async_module
:
self
.async_module
,
has_side_effect_free_directive
:
self
.has_side_effect_free_directive
,
has_side_effect_free_directive
:
self
.has_side_effect_free_directive
,
successful
:
self
.successful
,
successful
:
self
.successful
,
...
@@ -580,6 +591,18 @@ pub async fn analyse_ecmascript_module_internal(
...
@@ -580,6 +591,18 @@ pub async fn analyse_ecmascript_module_internal(
..
..
}
=
&*
parsed
}
=
&*
parsed
else
{
else
{
// Even a file that failed parsing can be side effect free.
// That's important as
let
marked_as_side_effect_free
=
*
is_marked_as_side_effect_free
(
path
,
options
.side_effect_free_packages
.map
(|
l
|
*
l
))
.await
?
;
let
evaluation
=
if
marked_as_side_effect_free
{
EsmEvaluation
::
SideEffectFree
}
else
{
EsmEvaluation
::
SideEffects
};
analysis
.set_evaluation
(
evaluation
);
return
analysis
.build
(
Default
::
default
(),
false
)
.await
;
return
analysis
.build
(
Default
::
default
(),
false
)
.await
;
};
};
...
@@ -806,6 +829,8 @@ pub async fn analyse_ecmascript_module_internal(
...
@@ -806,6 +829,8 @@ pub async fn analyse_ecmascript_module_internal(
}
else
{
}
else
{
EsmEvaluation
::
SideEffects
EsmEvaluation
::
SideEffects
};
};
analysis
.set_evaluation
(
evaluation
);
let
exports
=
if
!
esm_exports
.is_empty
()
||
!
esm_star_exports
.is_empty
()
{
let
exports
=
if
!
esm_exports
.is_empty
()
||
!
esm_star_exports
.is_empty
()
{
if
specified_type
==
SpecifiedModuleType
::
CommonJs
{
if
specified_type
==
SpecifiedModuleType
::
CommonJs
{
SpecifiedModuleTypeIssue
{
SpecifiedModuleTypeIssue
{
...
@@ -820,7 +845,6 @@ pub async fn analyse_ecmascript_module_internal(
...
@@ -820,7 +845,6 @@ pub async fn analyse_ecmascript_module_internal(
let
esm_exports
=
EsmExports
{
let
esm_exports
=
EsmExports
{
exports
:
esm_exports
,
exports
:
esm_exports
,
star_exports
:
esm_star_exports
,
star_exports
:
esm_star_exports
,
evaluation
,
}
}
.cell
();
.cell
();
...
@@ -841,7 +865,6 @@ pub async fn analyse_ecmascript_module_internal(
...
@@ -841,7 +865,6 @@ pub async fn analyse_ecmascript_module_internal(
EsmExports
{
EsmExports
{
exports
:
Default
::
default
(),
exports
:
Default
::
default
(),
star_exports
:
Default
::
default
(),
star_exports
:
Default
::
default
(),
evaluation
,
}
}
.resolved_cell
(),
.resolved_cell
(),
)
)
...
@@ -853,7 +876,6 @@ pub async fn analyse_ecmascript_module_internal(
...
@@ -853,7 +876,6 @@ pub async fn analyse_ecmascript_module_internal(
EsmExports
{
EsmExports
{
exports
:
Default
::
default
(),
exports
:
Default
::
default
(),
star_exports
:
Default
::
default
(),
star_exports
:
Default
::
default
(),
evaluation
,
}
}
.resolved_cell
(),
.resolved_cell
(),
),
),
...
@@ -868,7 +890,6 @@ pub async fn analyse_ecmascript_module_internal(
...
@@ -868,7 +890,6 @@ pub async fn analyse_ecmascript_module_internal(
EsmExports
{
EsmExports
{
exports
:
Default
::
default
(),
exports
:
Default
::
default
(),
star_exports
:
Default
::
default
(),
star_exports
:
Default
::
default
(),
evaluation
,
}
}
.resolved_cell
(),
.resolved_cell
(),
)
)
...
...
turbopack/crates/turbopack-ecmascript/src/references/require_context.rs
View file @
7af2a39e
...
@@ -47,6 +47,7 @@ use crate::{
...
@@ -47,6 +47,7 @@ use crate::{
create_visitor
,
create_visitor
,
references
::{
references
::{
AstPath
,
AstPath
,
esm
::
EsmEvaluation
,
pattern_mapping
::{
PatternMapping
,
ResolveType
},
pattern_mapping
::{
PatternMapping
,
ResolveType
},
},
},
runtime_functions
::{
TURBOPACK_EXPORT_VALUE
,
TURBOPACK_MODULE_CONTEXT
,
TURBOPACK_REQUIRE
},
runtime_functions
::{
TURBOPACK_EXPORT_VALUE
,
TURBOPACK_MODULE_CONTEXT
,
TURBOPACK_REQUIRE
},
...
@@ -458,6 +459,7 @@ impl EcmascriptChunkPlaceable for RequireContextAsset {
...
@@ -458,6 +459,7 @@ impl EcmascriptChunkPlaceable for RequireContextAsset {
fn
get_exports
(
&
self
)
->
Vc
<
EcmascriptExports
>
{
fn
get_exports
(
&
self
)
->
Vc
<
EcmascriptExports
>
{
EcmascriptExports
{
EcmascriptExports
{
ty
:
EcmascriptExportsType
::
Value
,
ty
:
EcmascriptExportsType
::
Value
,
evaluation
:
EsmEvaluation
::
SideEffects
,
}
}
.cell
()
.cell
()
}
}
...
...
turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/module.rs
View file @
7af2a39e
...
@@ -343,11 +343,11 @@ impl EcmascriptChunkPlaceable for EcmascriptModuleFacadeModule {
...
@@ -343,11 +343,11 @@ impl EcmascriptChunkPlaceable for EcmascriptModuleFacadeModule {
let
exports
=
EsmExports
{
let
exports
=
EsmExports
{
exports
,
exports
,
star_exports
,
star_exports
,
evaluation
,
}
}
.resolved_cell
();
.resolved_cell
();
Ok
(
EcmascriptExports
{
Ok
(
EcmascriptExports
{
ty
:
EcmascriptExportsType
::
EsmExports
(
exports
),
ty
:
EcmascriptExportsType
::
EsmExports
(
exports
),
evaluation
,
}
}
.cell
())
.cell
())
}
}
...
...
turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/module.rs
View file @
7af2a39e
...
@@ -133,7 +133,8 @@ impl EcmascriptAnalyzable for EcmascriptModuleLocalsModule {
...
@@ -133,7 +133,8 @@ impl EcmascriptAnalyzable for EcmascriptModuleLocalsModule {
impl
EcmascriptChunkPlaceable
for
EcmascriptModuleLocalsModule
{
impl
EcmascriptChunkPlaceable
for
EcmascriptModuleLocalsModule
{
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
async
fn
get_exports
(
&
self
)
->
Result
<
Vc
<
EcmascriptExports
>>
{
async
fn
get_exports
(
&
self
)
->
Result
<
Vc
<
EcmascriptExports
>>
{
let
EcmascriptExportsType
::
EsmExports
(
exports
)
=
self
.module
.get_exports
()
.await
?
.ty
else
{
let
module_exports
=
self
.module
.get_exports
()
.await
?
;
let
EcmascriptExportsType
::
EsmExports
(
exports
)
=
&
module_exports
.ty
else
{
bail!
(
"EcmascriptModuleLocalsModule must only be used on modules with EsmExports"
);
bail!
(
"EcmascriptModuleLocalsModule must only be used on modules with EsmExports"
);
};
};
let
esm_exports
=
exports
.await
?
;
let
esm_exports
=
exports
.await
?
;
...
@@ -159,11 +160,11 @@ impl EcmascriptChunkPlaceable for EcmascriptModuleLocalsModule {
...
@@ -159,11 +160,11 @@ impl EcmascriptChunkPlaceable for EcmascriptModuleLocalsModule {
let
exports
=
EsmExports
{
let
exports
=
EsmExports
{
exports
,
exports
,
star_exports
:
vec!
[],
star_exports
:
vec!
[],
evaluation
:
esm_exports
.evaluation
,
}
}
.resolved_cell
();
.resolved_cell
();
Ok
(
EcmascriptExports
{
Ok
(
EcmascriptExports
{
ty
:
EcmascriptExportsType
::
EsmExports
(
exports
),
ty
:
EcmascriptExportsType
::
EsmExports
(
exports
),
evaluation
:
module_exports
.evaluation
,
}
}
.cell
())
.cell
())
}
}
...
...
turbopack/crates/turbopack-json/src/lib.rs
View file @
7af2a39e
...
@@ -28,6 +28,7 @@ use turbopack_ecmascript::{
...
@@ -28,6 +28,7 @@ use turbopack_ecmascript::{
EcmascriptChunkItem
,
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptChunkItem
,
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptChunkType
,
EcmascriptExports
,
EcmascriptExportsType
,
EcmascriptChunkType
,
EcmascriptExports
,
EcmascriptExportsType
,
},
},
references
::
esm
::
EsmEvaluation
,
runtime_functions
::
TURBOPACK_EXPORT_VALUE
,
runtime_functions
::
TURBOPACK_EXPORT_VALUE
,
};
};
...
@@ -81,6 +82,7 @@ impl EcmascriptChunkPlaceable for JsonModuleAsset {
...
@@ -81,6 +82,7 @@ impl EcmascriptChunkPlaceable for JsonModuleAsset {
fn
get_exports
(
&
self
)
->
Vc
<
EcmascriptExports
>
{
fn
get_exports
(
&
self
)
->
Vc
<
EcmascriptExports
>
{
EcmascriptExports
{
EcmascriptExports
{
ty
:
EcmascriptExportsType
::
Value
,
ty
:
EcmascriptExportsType
::
Value
,
evaluation
:
EsmEvaluation
::
SideEffects
,
}
}
.cell
()
.cell
()
}
}
...
...
turbopack/crates/turbopack-static/src/ecma.rs
View file @
7af2a39e
...
@@ -15,6 +15,7 @@ use turbopack_ecmascript::{
...
@@ -15,6 +15,7 @@ use turbopack_ecmascript::{
EcmascriptChunkItem
,
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptChunkItem
,
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptChunkType
,
EcmascriptExports
,
EcmascriptExportsType
,
EcmascriptChunkType
,
EcmascriptExports
,
EcmascriptExportsType
,
},
},
references
::
esm
::
EsmEvaluation
,
runtime_functions
::
TURBOPACK_EXPORT_VALUE
,
runtime_functions
::
TURBOPACK_EXPORT_VALUE
,
utils
::
StringifyJs
,
utils
::
StringifyJs
,
};
};
...
@@ -88,6 +89,7 @@ impl EcmascriptChunkPlaceable for StaticUrlJsModule {
...
@@ -88,6 +89,7 @@ impl EcmascriptChunkPlaceable for StaticUrlJsModule {
fn
get_exports
(
&
self
)
->
Vc
<
EcmascriptExports
>
{
fn
get_exports
(
&
self
)
->
Vc
<
EcmascriptExports
>
{
EcmascriptExports
{
EcmascriptExports
{
ty
:
EcmascriptExportsType
::
Value
,
ty
:
EcmascriptExportsType
::
Value
,
evaluation
:
EsmEvaluation
::
SideEffects
,
}
}
.cell
()
.cell
()
}
}
...
...
turbopack/crates/turbopack-wasm/src/raw.rs
View file @
7af2a39e
...
@@ -16,6 +16,7 @@ use turbopack_ecmascript::{
...
@@ -16,6 +16,7 @@ use turbopack_ecmascript::{
EcmascriptChunkItem
,
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptChunkItem
,
EcmascriptChunkItemContent
,
EcmascriptChunkPlaceable
,
EcmascriptChunkType
,
EcmascriptExports
,
EcmascriptExportsType
,
EcmascriptChunkType
,
EcmascriptExports
,
EcmascriptExportsType
,
},
},
references
::
esm
::
EsmEvaluation
,
runtime_functions
::
TURBOPACK_EXPORT_VALUE
,
runtime_functions
::
TURBOPACK_EXPORT_VALUE
,
utils
::
StringifyJs
,
utils
::
StringifyJs
,
};
};
...
@@ -94,6 +95,7 @@ impl EcmascriptChunkPlaceable for RawWebAssemblyModuleAsset {
...
@@ -94,6 +95,7 @@ impl EcmascriptChunkPlaceable for RawWebAssemblyModuleAsset {
fn
get_exports
(
self
:
Vc
<
Self
>
)
->
Vc
<
EcmascriptExports
>
{
fn
get_exports
(
self
:
Vc
<
Self
>
)
->
Vc
<
EcmascriptExports
>
{
EcmascriptExports
{
EcmascriptExports
{
ty
:
EcmascriptExportsType
::
Value
,
ty
:
EcmascriptExportsType
::
Value
,
evaluation
:
EsmEvaluation
::
SideEffects
,
}
}
.cell
()
.cell
()
}
}
...
...
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