Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(turbopack): Use ResolvedVc for turbopack-ecmascript #72564

Merged
merged 279 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
279 commits
Select commit Hold shift + click to select a range
c8654fa
Fix more
kdy1 Nov 6, 2024
16e6824
Fix more
kdy1 Nov 6, 2024
0f1a8cf
Fix more
kdy1 Nov 6, 2024
6347c9d
Fix more
kdy1 Nov 6, 2024
f788342
Fix more
kdy1 Nov 6, 2024
a075adb
Fix more
kdy1 Nov 6, 2024
bae7a0d
Fix more
kdy1 Nov 6, 2024
ce0b297
Fix more
kdy1 Nov 6, 2024
5c70dbf
Fix more
kdy1 Nov 6, 2024
79405d5
Fix more
kdy1 Nov 6, 2024
ec2cdcc
Fix more
kdy1 Nov 6, 2024
f190ec0
Fix more
kdy1 Nov 6, 2024
6d736a9
Fix more
kdy1 Nov 6, 2024
7aad506
Fix more
kdy1 Nov 6, 2024
45840e5
Fix more
kdy1 Nov 6, 2024
68b7008
Fix more
kdy1 Nov 6, 2024
58f7437
Fix more
kdy1 Nov 6, 2024
4496f82
Fix more
kdy1 Nov 6, 2024
64fc607
Fix more
kdy1 Nov 6, 2024
0613556
Fix more
kdy1 Nov 6, 2024
6db089b
Fix more
kdy1 Nov 6, 2024
c0723d6
Fix more
kdy1 Nov 6, 2024
e3805fb
Fix more
kdy1 Nov 6, 2024
d7f5788
Fix more
kdy1 Nov 6, 2024
c6a7fa7
Fix more
kdy1 Nov 6, 2024
c6077da
Fix more
kdy1 Nov 6, 2024
80fb630
Fix more
kdy1 Nov 6, 2024
f75e939
Fix more
kdy1 Nov 6, 2024
a4716a5
Fix more
kdy1 Nov 6, 2024
f1afba6
Fix more
kdy1 Nov 6, 2024
13df35d
Fix more
kdy1 Nov 6, 2024
3ab3a84
Fix more
kdy1 Nov 6, 2024
50eed35
Fix more
kdy1 Nov 6, 2024
c77c131
Fix more
kdy1 Nov 6, 2024
37ab3c8
Fix more
kdy1 Nov 6, 2024
1ede70c
More work
kdy1 Nov 11, 2024
ef37c7c
Fix more
kdy1 Nov 11, 2024
1534924
Fix more
kdy1 Nov 11, 2024
af78ae7
Fix more
kdy1 Nov 11, 2024
ebb2948
Fix more
kdy1 Nov 11, 2024
88e8acb
Fix more
kdy1 Nov 11, 2024
191ba8f
Fix more
kdy1 Nov 11, 2024
c10fac6
Fix more
kdy1 Nov 11, 2024
76ad2f9
Fix more
kdy1 Nov 11, 2024
64fa141
Fix more
kdy1 Nov 11, 2024
b5f6ff6
Fix more
kdy1 Nov 11, 2024
f5cb9be
Fix more
kdy1 Nov 11, 2024
2c3abb6
Fix more
kdy1 Nov 11, 2024
afc4a7a
Fix more
kdy1 Nov 11, 2024
c7777d4
Fix more
kdy1 Nov 11, 2024
25857cb
Fix more
kdy1 Nov 11, 2024
06f16a7
Fix more
kdy1 Nov 11, 2024
3861a81
Fix more
kdy1 Nov 11, 2024
69699f4
Fix more
kdy1 Nov 11, 2024
618a18f
Fix more
kdy1 Nov 11, 2024
ebfb80b
Fix more
kdy1 Nov 11, 2024
7ecc5ac
Fix more
kdy1 Nov 11, 2024
9d54476
More
kdy1 Nov 11, 2024
f761e97
More
kdy1 Nov 11, 2024
b412657
Revert
kdy1 Nov 11, 2024
59f248d
Revert
kdy1 Nov 11, 2024
4555453
Revert
kdy1 Nov 11, 2024
17cbff5
Revert
kdy1 Nov 11, 2024
dd68d99
More
kdy1 Nov 11, 2024
58e38f0
More
kdy1 Nov 11, 2024
5d82b8e
More
kdy1 Nov 11, 2024
372f501
More
kdy1 Nov 11, 2024
3b69e51
More
kdy1 Nov 11, 2024
12bab7e
More
kdy1 Nov 11, 2024
b08d4b4
More
kdy1 Nov 11, 2024
07a1f4c
More
kdy1 Nov 11, 2024
65ae9a7
More
kdy1 Nov 11, 2024
b366ffa
More
kdy1 Nov 11, 2024
c8fe073
More
kdy1 Nov 11, 2024
945bdbf
More
kdy1 Nov 11, 2024
39810ea
More
kdy1 Nov 11, 2024
e40bcb3
More
kdy1 Nov 11, 2024
293c9c4
More
kdy1 Nov 11, 2024
e50ca49
Fix more
kdy1 Nov 11, 2024
f04e236
More
kdy1 Nov 11, 2024
f256501
More
kdy1 Nov 11, 2024
ae4080b
More
kdy1 Nov 11, 2024
96ad1f3
More
kdy1 Nov 11, 2024
e5f6a2f
More
kdy1 Nov 11, 2024
ad02567
More
kdy1 Nov 11, 2024
e23b8f3
More
kdy1 Nov 11, 2024
59598ce
More
kdy1 Nov 11, 2024
ea4f5c3
More
kdy1 Nov 11, 2024
621f2fc
More
kdy1 Nov 11, 2024
ab300e5
More
kdy1 Nov 11, 2024
f1754ca
More
kdy1 Nov 11, 2024
16d0d0a
More
kdy1 Nov 11, 2024
36a3a2f
More
kdy1 Nov 11, 2024
9da472a
More
kdy1 Nov 11, 2024
475bfde
More
kdy1 Nov 11, 2024
0f735cf
More
kdy1 Nov 11, 2024
26330c2
More
kdy1 Nov 11, 2024
8f5bcc4
More
kdy1 Nov 11, 2024
2bc236f
More
kdy1 Nov 11, 2024
0aa696e
More
kdy1 Nov 11, 2024
703eeac
More
kdy1 Nov 11, 2024
f9a3366
Fix
kdy1 Nov 11, 2024
98af20b
Fix
kdy1 Nov 11, 2024
66109eb
Fix
kdy1 Nov 11, 2024
b960fb3
Fix
kdy1 Nov 11, 2024
8957e92
Fix
kdy1 Nov 11, 2024
d450117
Fix
kdy1 Nov 11, 2024
398f863
Fix
kdy1 Nov 11, 2024
fbb6ab8
Fix
kdy1 Nov 11, 2024
a1b4ce7
Fix
kdy1 Nov 11, 2024
dbac42c
Fix
kdy1 Nov 11, 2024
08618fe
Fix
kdy1 Nov 11, 2024
e87a287
Fix
kdy1 Nov 11, 2024
c77d350
Fix
kdy1 Nov 11, 2024
5d43068
Fix
kdy1 Nov 11, 2024
c9f21ee
Fix
kdy1 Nov 11, 2024
9dab593
Fix
kdy1 Nov 11, 2024
829a328
Fix
kdy1 Nov 11, 2024
b044d00
Fix
kdy1 Nov 11, 2024
4a304ff
Fix
kdy1 Nov 11, 2024
ef8495e
Fix
kdy1 Nov 11, 2024
1086ab4
Fix
kdy1 Nov 11, 2024
46de799
Fix
kdy1 Nov 11, 2024
a0c64cc
Fix
kdy1 Nov 11, 2024
9be7b3d
Fix
kdy1 Nov 11, 2024
b01d6da
Fix
kdy1 Nov 11, 2024
64a64ea
Fix
kdy1 Nov 11, 2024
5d3ff29
Fix
kdy1 Nov 11, 2024
f6b30af
Fix
kdy1 Nov 11, 2024
d1ff7bc
Fix
kdy1 Nov 11, 2024
1730a2f
Fix
kdy1 Nov 11, 2024
69a17a6
Fix
kdy1 Nov 11, 2024
8748ee1
Fix
kdy1 Nov 11, 2024
aa99cfa
Fix
kdy1 Nov 11, 2024
96178eb
Fix
kdy1 Nov 11, 2024
8fc405b
Fix
kdy1 Nov 11, 2024
38d2cec
Fix
kdy1 Nov 11, 2024
8e2e1ae
Fix
kdy1 Nov 11, 2024
355c185
Fix
kdy1 Nov 11, 2024
5a79c2c
Fix
kdy1 Nov 11, 2024
f34d47c
More
kdy1 Nov 11, 2024
bd83e33
Fix
kdy1 Nov 11, 2024
a54dd63
Fix
kdy1 Nov 11, 2024
e842e75
Fix
kdy1 Nov 11, 2024
2e4557d
Fix
kdy1 Nov 11, 2024
aaecb63
Fix
kdy1 Nov 11, 2024
2e7cc2b
Fix
kdy1 Nov 11, 2024
15f642a
Fix
kdy1 Nov 11, 2024
1234f0e
Fix
kdy1 Nov 11, 2024
00064d6
Fix
kdy1 Nov 11, 2024
0e768c3
Fix
kdy1 Nov 11, 2024
5297bb9
Fix
kdy1 Nov 11, 2024
d6e224a
Fix
kdy1 Nov 11, 2024
f0500fa
Fix
kdy1 Nov 11, 2024
5e863be
Fix
kdy1 Nov 11, 2024
73f16fe
Fix
kdy1 Nov 11, 2024
e211892
Fix
kdy1 Nov 11, 2024
ce294a0
Fix
kdy1 Nov 11, 2024
51ce76f
Fix
kdy1 Nov 11, 2024
1c47075
Fix
kdy1 Nov 11, 2024
7c63f66
Fix
kdy1 Nov 11, 2024
0d14f24
Fix
kdy1 Nov 11, 2024
0ecad41
Fix
kdy1 Nov 11, 2024
a7f4ced
Fix more
kdy1 Nov 11, 2024
cedd8bd
Fix more
kdy1 Nov 11, 2024
6474f7e
Fix more
kdy1 Nov 11, 2024
de7c6ba
Fix more
kdy1 Nov 11, 2024
f055b55
Fix more
kdy1 Nov 11, 2024
2474749
Fix more
kdy1 Nov 11, 2024
8ae209c
Fix more
kdy1 Nov 11, 2024
71bc592
Fix more
kdy1 Nov 11, 2024
88269fb
Fix more
kdy1 Nov 11, 2024
534943c
Fix more
kdy1 Nov 11, 2024
ab501b7
Fix more
kdy1 Nov 11, 2024
53d5e8b
Fix more
kdy1 Nov 11, 2024
06877fe
Fix more
kdy1 Nov 11, 2024
8126ec2
Fix more
kdy1 Nov 11, 2024
763bd08
Fix more
kdy1 Nov 11, 2024
dad6f75
Fix more
kdy1 Nov 11, 2024
793ff0a
Fix more
kdy1 Nov 11, 2024
9545a6e
Fix more
kdy1 Nov 11, 2024
12fd670
Fix more
kdy1 Nov 11, 2024
f9f9174
Fix more
kdy1 Nov 11, 2024
893c63b
Fix more
kdy1 Nov 11, 2024
7467e7e
Fix more
kdy1 Nov 11, 2024
cd87ccc
Fix more
kdy1 Nov 11, 2024
a14bc74
Fix more
kdy1 Nov 11, 2024
bdee2d0
Fix more
kdy1 Nov 11, 2024
3d0553a
Fix more
kdy1 Nov 11, 2024
55a6b2a
Fix more
kdy1 Nov 11, 2024
51874e3
Fix more
kdy1 Nov 11, 2024
934087e
Fix more
kdy1 Nov 11, 2024
b42a696
Fix more
kdy1 Nov 11, 2024
bb73959
Fix more
kdy1 Nov 11, 2024
e77a7c9
Fix more
kdy1 Nov 11, 2024
c03edf1
Fix more
kdy1 Nov 11, 2024
33bb0ea
Fix more
kdy1 Nov 11, 2024
968eca6
Fix more
kdy1 Nov 11, 2024
30a0084
Fix more
kdy1 Nov 11, 2024
08d9bb8
Fix more
kdy1 Nov 11, 2024
e3dc1cb
Fix more
kdy1 Nov 11, 2024
375afa3
Fix more
kdy1 Nov 11, 2024
7fb5a5c
Fix more
kdy1 Nov 11, 2024
c5201e6
Fix more
kdy1 Nov 11, 2024
5ee5cb9
Fix more
kdy1 Nov 11, 2024
941f7e5
Fix more
kdy1 Nov 11, 2024
7a09a27
Fix more
kdy1 Nov 11, 2024
016e3f4
Fix more
kdy1 Nov 11, 2024
10a283e
Fix more
kdy1 Nov 11, 2024
cc506de
Fix more
kdy1 Nov 11, 2024
c750239
Fix more
kdy1 Nov 11, 2024
77322fd
Fix more
kdy1 Nov 11, 2024
1cb0961
Fix more
kdy1 Nov 11, 2024
7200e04
Fix more
kdy1 Nov 11, 2024
e9991db
Fix more
kdy1 Nov 11, 2024
9d267b2
Fix more
kdy1 Nov 11, 2024
66997bf
Fix more
kdy1 Nov 11, 2024
f98c375
Fix more
kdy1 Nov 11, 2024
315705b
Fix more
kdy1 Nov 11, 2024
e92d683
Fix more
kdy1 Nov 11, 2024
d900cb6
Fix more
kdy1 Nov 11, 2024
88ce00d
Fix more
kdy1 Nov 11, 2024
7ef6fe0
Fix more
kdy1 Nov 11, 2024
7e305c0
Fix more
kdy1 Nov 11, 2024
fd7efce
Fix more
kdy1 Nov 11, 2024
9784078
Fix more
kdy1 Nov 11, 2024
202308f
Fix more
kdy1 Nov 11, 2024
76da26f
Fix more
kdy1 Nov 11, 2024
e683c59
Fix more
kdy1 Nov 11, 2024
3b82b41
Fix more
kdy1 Nov 11, 2024
98a8fe7
Fix more
kdy1 Nov 11, 2024
d66ade2
Fix more
kdy1 Nov 11, 2024
1fa75cc
Fix more
kdy1 Nov 11, 2024
c4f1641
Fix more
kdy1 Nov 11, 2024
3a1a395
Fix more
kdy1 Nov 11, 2024
33e091e
Fix build
kdy1 Nov 11, 2024
f206bf3
feedback 1
kdy1 Nov 12, 2024
20bb118
fixup
kdy1 Nov 12, 2024
89baa7d
feedback 2
kdy1 Nov 12, 2024
3a17dad
revert
kdy1 Nov 12, 2024
a107325
revert
kdy1 Nov 12, 2024
3712374
remove to_resolved()
kdy1 Nov 12, 2024
e8ab545
remove to_resolved()
kdy1 Nov 12, 2024
638ebee
More fix
kdy1 Nov 12, 2024
4d457a4
Fix build
kdy1 Nov 12, 2024
cba8336
ResolvedVc in args
kdy1 Nov 14, 2024
d5cc815
Feedback for args
kdy1 Nov 14, 2024
a825be1
Feedback for args
kdy1 Nov 14, 2024
629f1b5
Remove more `.to_resolved().await?`s, add back resolution performance…
bgw Nov 16, 2024
422baf7
Fix unused imports left over by my crappy rebasing job
bgw Nov 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions crates/next-core/src/next_shared/transforms/debug_fn_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ use anyhow::Result;
use async_trait::async_trait;
use next_custom_transforms::transforms::debug_fn_name::debug_fn_name;
use swc_core::ecma::{ast::Program, visit::VisitMutWith};
use turbo_tasks::{ResolvedVc, Vc};
use turbo_tasks::ResolvedVc;
use turbopack::module_options::{ModuleRule, ModuleRuleEffect};
use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext};

use super::module_rule_match_js_no_url;

pub fn get_debug_fn_name_rule(enable_mdx_rs: bool) -> ModuleRule {
let debug_fn_name_transform =
EcmascriptInputTransform::Plugin(Vc::cell(Box::new(DebugFnNameTransformer {}) as _));
let debug_fn_name_transform = EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(
DebugFnNameTransformer {},
) as _));

ModuleRule::new(
module_rule_match_js_no_url(enable_mdx_rs),
Expand Down
4 changes: 2 additions & 2 deletions crates/next-core/src/next_shared/transforms/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub use next_font::get_next_font_transform_rule;
pub use next_lint::get_next_lint_transform_rule;
pub use next_strip_page_exports::get_next_pages_transforms_rule;
pub use server_actions::get_server_actions_transform_rule;
use turbo_tasks::{ReadRef, ResolvedVc, Value, Vc};
use turbo_tasks::{ReadRef, ResolvedVc, Value};
use turbo_tasks_fs::FileSystemPath;
use turbopack::module_options::{ModuleRule, ModuleRuleEffect, ModuleType, RuleCondition};
use turbopack_core::reference_type::{ReferenceType, UrlReferenceSubType};
Expand Down Expand Up @@ -136,7 +136,7 @@ pub(crate) fn get_ecma_transform_rule(
enable_mdx_rs: bool,
prepend: bool,
) -> ModuleRule {
let transformer = EcmascriptInputTransform::Plugin(Vc::cell(transformer as _));
let transformer = EcmascriptInputTransform::Plugin(ResolvedVc::cell(transformer as _));
let (prepend, append) = if prepend {
(
ResolvedVc::cell(vec![transformer]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use async_trait::async_trait;
use modularize_imports::{modularize_imports, PackageConfig};
use serde::{Deserialize, Serialize};
use swc_core::ecma::ast::Program;
use turbo_tasks::{trace::TraceRawVcs, FxIndexMap, ResolvedVc, Vc};
use turbo_tasks::{trace::TraceRawVcs, FxIndexMap, ResolvedVc};
use turbopack::module_options::{ModuleRule, ModuleRuleEffect};
use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext};

Expand Down Expand Up @@ -35,7 +35,7 @@ pub fn get_next_modularize_imports_rule(
modularize_imports_config: &FxIndexMap<String, ModularizeImportPackageConfig>,
enable_mdx_rs: bool,
) -> ModuleRule {
let transformer = EcmascriptInputTransform::Plugin(Vc::cell(Box::new(
let transformer = EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(
ModularizeImportsTransformer::new(modularize_imports_config),
) as _));
ModuleRule::new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ use anyhow::Result;
use async_trait::async_trait;
use next_custom_transforms::transforms::amp_attributes::amp_attributes;
use swc_core::ecma::ast::*;
use turbo_tasks::{ResolvedVc, Vc};
use turbo_tasks::ResolvedVc;
use turbopack::module_options::{ModuleRule, ModuleRuleEffect};
use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext};

use super::module_rule_match_js_no_url;

pub fn get_next_amp_attr_rule(enable_mdx_rs: bool) -> ModuleRule {
let transformer =
EcmascriptInputTransform::Plugin(Vc::cell(Box::new(NextAmpAttributes {}) as _));
EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(NextAmpAttributes {}) as _));
ModuleRule::new(
module_rule_match_js_no_url(enable_mdx_rs),
vec![ModuleRuleEffect::ExtendEcmascriptTransforms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use swc_core::{
common::SyntaxContext,
ecma::{ast::*, visit::VisitMutWith},
};
use turbo_tasks::{ResolvedVc, Vc};
use turbo_tasks::ResolvedVc;
use turbopack::module_options::{ModuleRule, ModuleRuleEffect};
use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext};

Expand Down Expand Up @@ -47,8 +47,9 @@ pub fn get_next_cjs_optimizer_rule(enable_mdx_rs: bool) -> ModuleRule {
)]),
};

let transformer =
EcmascriptInputTransform::Plugin(Vc::cell(Box::new(NextCjsOptimizer { config }) as _));
let transformer = EcmascriptInputTransform::Plugin(ResolvedVc::cell(
Box::new(NextCjsOptimizer { config }) as _,
));
ModuleRule::new(
module_rule_match_js_no_url(enable_mdx_rs),
vec![ModuleRuleEffect::ExtendEcmascriptTransforms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::Result;
use async_trait::async_trait;
use next_custom_transforms::transforms::disallow_re_export_all_in_page::disallow_re_export_all_in_page;
use swc_core::ecma::ast::*;
use turbo_tasks::{ReadRef, ResolvedVc, Vc};
use turbo_tasks::{ReadRef, ResolvedVc};
use turbo_tasks_fs::FileSystemPath;
use turbopack::module_options::{ModuleRule, ModuleRuleEffect};
use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext};
Expand All @@ -13,8 +13,9 @@ pub fn get_next_disallow_export_all_in_page_rule(
enable_mdx_rs: bool,
pages_dir: ReadRef<FileSystemPath>,
) -> ModuleRule {
let transformer =
EcmascriptInputTransform::Plugin(Vc::cell(Box::new(NextDisallowReExportAllInPage) as _));
let transformer = EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(
NextDisallowReExportAllInPage,
) as _));
ModuleRule::new(
module_rule_match_pages_page_file(enable_mdx_rs, pages_dir),
vec![ModuleRuleEffect::ExtendEcmascriptTransforms {
Expand Down
13 changes: 7 additions & 6 deletions crates/next-core/src/next_shared/transforms/next_dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ pub async fn get_next_dynamic_transform_rule(
mode: Vc<NextMode>,
enable_mdx_rs: bool,
) -> Result<ModuleRule> {
let dynamic_transform = EcmascriptInputTransform::Plugin(Vc::cell(Box::new(NextJsDynamic {
is_server_compiler,
is_react_server_layer,
is_app_dir,
mode: *mode.await?,
}) as _));
let dynamic_transform =
EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(NextJsDynamic {
is_server_compiler,
is_react_server_layer,
is_app_dir,
mode: *mode.await?,
}) as _));
Ok(ModuleRule::new(
module_rule_match_js_no_url(enable_mdx_rs),
vec![ModuleRuleEffect::ExtendEcmascriptTransforms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use swc_core::{
common::SyntaxContext,
ecma::{ast::*, utils::ExprCtx, visit::VisitWith},
};
use turbo_tasks::{ResolvedVc, Vc};
use turbo_tasks::ResolvedVc;
use turbopack::module_options::{ModuleRule, ModuleRuleEffect};
use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext};

Expand All @@ -16,10 +16,11 @@ pub fn next_edge_node_api_assert(
should_error_for_node_apis: bool,
is_production: bool,
) -> ModuleRule {
let transformer = EcmascriptInputTransform::Plugin(Vc::cell(Box::new(NextEdgeNodeApiAssert {
should_error_for_node_apis,
is_production,
}) as _));
let transformer =
EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(NextEdgeNodeApiAssert {
should_error_for_node_apis,
is_production,
}) as _));
ModuleRule::new(
module_rule_match_js_no_url(enable_mdx_rs),
vec![ModuleRuleEffect::ExtendEcmascriptTransforms {
Expand Down
6 changes: 4 additions & 2 deletions crates/next-core/src/next_shared/transforms/next_font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::Result;
use async_trait::async_trait;
use next_custom_transforms::transforms::fonts::*;
use swc_core::ecma::{ast::Program, atoms::JsWord, visit::VisitMutWith};
use turbo_tasks::{ResolvedVc, Vc};
use turbo_tasks::ResolvedVc;
use turbopack::module_options::{ModuleRule, ModuleRuleEffect};
use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext};

Expand All @@ -18,7 +18,9 @@ pub fn get_next_font_transform_rule(enable_mdx_rs: bool) -> ModuleRule {
];

let transformer =
EcmascriptInputTransform::Plugin(Vc::cell(Box::new(NextJsFont { font_loaders }) as _));
EcmascriptInputTransform::Plugin(ResolvedVc::cell(
Box::new(NextJsFont { font_loaders }) as _
));
ModuleRule::new(
// TODO: Only match in pages (not pages/api), app/, etc.
module_rule_match_js_no_url(enable_mdx_rs),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ use anyhow::Result;
use async_trait::async_trait;
use next_custom_transforms::transforms::middleware_dynamic::next_middleware_dynamic;
use swc_core::ecma::{ast::*, visit::VisitMutWith};
use turbo_tasks::{ResolvedVc, Vc};
use turbo_tasks::ResolvedVc;
use turbopack::module_options::{ModuleRule, ModuleRuleEffect};
use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext};

use super::module_rule_match_js_no_url;

pub fn get_middleware_dynamic_assert_rule(enable_mdx_rs: bool) -> ModuleRule {
let transformer =
EcmascriptInputTransform::Plugin(Vc::cell(Box::new(NextMiddlewareDynamicAssert {}) as _));
let transformer = EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(
NextMiddlewareDynamicAssert {},
) as _));
ModuleRule::new(
module_rule_match_js_no_url(enable_mdx_rs),
vec![ModuleRuleEffect::ExtendEcmascriptTransforms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::Result;
use async_trait::async_trait;
use next_custom_transforms::transforms::optimize_server_react::{optimize_server_react, Config};
use swc_core::ecma::ast::*;
use turbo_tasks::{ResolvedVc, Vc};
use turbo_tasks::ResolvedVc;
use turbopack::module_options::{ModuleRule, ModuleRuleEffect};
use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext};

Expand All @@ -14,7 +14,7 @@ pub fn get_next_optimize_server_react_rule(
optimize_use_state: bool,
) -> ModuleRule {
let transformer =
EcmascriptInputTransform::Plugin(Vc::cell(Box::new(NextOptimizeServerReact {
EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(NextOptimizeServerReact {
optimize_use_state,
}) as _));
ModuleRule::new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::Result;
use async_trait::async_trait;
use next_custom_transforms::transforms::page_config::page_config;
use swc_core::ecma::ast::*;
use turbo_tasks::{ReadRef, ResolvedVc, Vc};
use turbo_tasks::{ReadRef, ResolvedVc};
use turbo_tasks_fs::FileSystemPath;
use turbopack::module_options::{ModuleRule, ModuleRuleEffect};
use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext};
Expand All @@ -13,7 +13,7 @@ pub fn get_next_page_config_rule(
enable_mdx_rs: bool,
pages_dir: ReadRef<FileSystemPath>,
) -> ModuleRule {
let transformer = EcmascriptInputTransform::Plugin(Vc::cell(Box::new(NextPageConfig {
let transformer = EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(NextPageConfig {
// [TODO]: update once turbopack build works
is_development: true,
}) as _));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ pub fn get_next_page_static_info_assert_rule(
server_context: Option<ServerContextType>,
client_context: Option<ClientContextType>,
) -> ModuleRule {
let transformer = EcmascriptInputTransform::Plugin(Vc::cell(Box::new(NextPageStaticInfo {
server_context,
client_context,
}) as _));
let transformer =
EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(NextPageStaticInfo {
server_context,
client_context,
}) as _));
ModuleRule::new(
module_rule_match_js_no_url(enable_mdx_rs),
vec![ModuleRuleEffect::ExtendEcmascriptTransforms {
Expand Down Expand Up @@ -129,7 +130,7 @@ impl CustomTransformer for NextPageStaticInfo {

#[turbo_tasks::value(shared)]
pub struct PageStaticInfoIssue {
pub file_path: Vc<FileSystemPath>,
pub file_path: ResolvedVc<FileSystemPath>,
pub messages: Vec<String>,
pub severity: IssueSeverity,
}
Expand All @@ -153,7 +154,7 @@ impl Issue for PageStaticInfoIssue {

#[turbo_tasks::function]
fn file_path(&self) -> Vc<FileSystemPath> {
self.file_path
*self.file_path
}

#[turbo_tasks::function]
Expand Down
5 changes: 3 additions & 2 deletions crates/next-core/src/next_shared/transforms/next_pure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ use anyhow::Result;
use async_trait::async_trait;
use next_custom_transforms::transforms::pure::pure_magic;
use swc_core::ecma::{ast::*, visit::VisitMutWith};
use turbo_tasks::{ResolvedVc, Vc};
use turbo_tasks::ResolvedVc;
use turbopack::module_options::{ModuleRule, ModuleRuleEffect};
use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext};

use super::module_rule_match_js_no_url;

pub fn get_next_pure_rule(enable_mdx_rs: bool) -> ModuleRule {
let transformer = EcmascriptInputTransform::Plugin(Vc::cell(Box::new(NextPure {}) as _));
let transformer =
EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(NextPure {}) as _));
ModuleRule::new(
module_rule_match_js_no_url(enable_mdx_rs),
vec![ModuleRuleEffect::ExtendEcmascriptTransforms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ use anyhow::Result;
use async_trait::async_trait;
use next_custom_transforms::transforms::shake_exports::{shake_exports, Config};
use swc_core::ecma::ast::*;
use turbo_tasks::{ResolvedVc, Vc};
use turbo_tasks::ResolvedVc;
use turbopack::module_options::{ModuleRule, ModuleRuleEffect};
use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext};

use super::module_rule_match_js_no_url;

#[allow(dead_code)]
pub fn get_next_shake_exports_rule(enable_mdx_rs: bool, ignore: Vec<String>) -> ModuleRule {
let transformer =
EcmascriptInputTransform::Plugin(Vc::cell(Box::new(NextShakeExports { ignore }) as _));
let transformer = EcmascriptInputTransform::Plugin(ResolvedVc::cell(
Box::new(NextShakeExports { ignore }) as _,
));
ModuleRule::new(
module_rule_match_js_no_url(enable_mdx_rs),
vec![ModuleRuleEffect::ExtendEcmascriptTransforms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ pub async fn get_next_pages_transforms_rule(
enable_mdx_rs: bool,
) -> Result<ModuleRule> {
// Apply the Next SSG transform to all pages.
let strip_transform = EcmascriptInputTransform::Plugin(Vc::cell(Box::new(
NextJsStripPageExports { export_filter },
) as _));
let strip_transform =
EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(NextJsStripPageExports {
export_filter,
}) as _));
Ok(ModuleRule::new(
RuleCondition::all(vec![
RuleCondition::all(vec![
Expand Down
11 changes: 6 additions & 5 deletions crates/next-core/src/next_shared/transforms/server_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::Result;
use async_trait::async_trait;
use next_custom_transforms::transforms::server_actions::{server_actions, Config};
use swc_core::{common::FileName, ecma::ast::Program};
use turbo_tasks::{ResolvedVc, Vc};
use turbo_tasks::ResolvedVc;
use turbopack::module_options::{ModuleRule, ModuleRuleEffect};
use turbopack_ecmascript::{CustomTransformer, EcmascriptInputTransform, TransformContext};

Expand All @@ -20,10 +20,11 @@ pub fn get_server_actions_transform_rule(
enable_mdx_rs: bool,
dynamic_io_enabled: bool,
) -> ModuleRule {
let transformer = EcmascriptInputTransform::Plugin(Vc::cell(Box::new(NextServerActions {
transform,
dynamic_io_enabled,
}) as _));
let transformer =
EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(NextServerActions {
transform,
dynamic_io_enabled,
}) as _));
ModuleRule::new(
module_rule_match_js_no_url(enable_mdx_rs),
vec![ModuleRuleEffect::ExtendEcmascriptTransforms {
Expand Down
10 changes: 5 additions & 5 deletions turbopack/crates/turbopack-cli/src/contexts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,16 @@ async fn get_client_module_options_context(
conditions,
vec![ModuleRuleEffect::ExtendEcmascriptTransforms {
prepend: ResolvedVc::cell(vec![
EcmascriptInputTransform::Plugin(Vc::cell(Box::new(
EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(
EmotionTransformer::new(&EmotionTransformConfig::default())
.expect("Should be able to create emotion transformer"),
) as _)),
EcmascriptInputTransform::Plugin(Vc::cell(Box::new(
EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(
StyledComponentsTransformer::new(&StyledComponentsTransformConfig::default()),
) as _)),
EcmascriptInputTransform::Plugin(Vc::cell(Box::new(StyledJsxTransformer::new(
versions,
)) as _)),
EcmascriptInputTransform::Plugin(ResolvedVc::cell(Box::new(
StyledJsxTransformer::new(versions),
) as _)),
]),
append: ResolvedVc::cell(vec![]),
}],
Expand Down
4 changes: 2 additions & 2 deletions turbopack/crates/turbopack-core/src/introspect/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ pub async fn children_from_module_references(
let key = reference_ty();
let mut children = FxIndexSet::default();
let references = references.await?;
for reference in &*references {
for &reference in &*references {
let mut key = key;
if let Some(chunkable) =
Vc::try_resolve_downcast::<Box<dyn ChunkableModuleReference>>(*reference).await?
Vc::try_resolve_downcast::<Box<dyn ChunkableModuleReference>>(reference).await?
{
match &*chunkable.chunking_type().await? {
None => {}
Expand Down
Loading
Loading