Skip to content

Commit b6f8743

Browse files
kdy1mischnic
andauthored
Update swc_core to v13.0.4 (#75684)
### What? ChangeLog: swc-project/swc@[email protected][email protected] ### Why? - To keep in sync - To drop `rustc-hash` v1 - To apply swc-project/swc#9978 --------- Co-authored-by: Niklas Mischkulnig <[email protected]>
1 parent 0f6fc0a commit b6f8743

File tree

10 files changed

+220
-192
lines changed

10 files changed

+220
-192
lines changed

Cargo.lock

+193-166
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+9-9
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,21 @@ turbopack-trace-utils = { path = "turbopack/crates/turbopack-trace-utils" }
9191
turbopack-wasm = { path = "turbopack/crates/turbopack-wasm" }
9292

9393
# SWC crates
94-
swc_core = { version = "12.0.0", features = [
94+
swc_core = { version = "13.0.4", features = [
9595
"ecma_loader_lru",
9696
"ecma_loader_parking_lot",
9797
] }
98-
testing = { version = "5.0.0" }
98+
testing = { version = "6.0.0" }
9999

100100
# Keep consistent with preset_env_base through swc_core
101101
browserslist-rs = { version = "0.17.0" }
102102
miette = { version = "5.10.0", features = ["fancy"] }
103-
mdxjs = "0.2.15"
104-
modularize_imports = { version = "0.74.0" }
105-
styled_components = { version = "0.102.0" }
106-
styled_jsx = { version = "0.78.0" }
107-
swc_emotion = { version = "0.78.0" }
108-
swc_relay = { version = "0.48.0" }
103+
mdxjs = "0.3"
104+
modularize_imports = { version = "0.75.0" }
105+
styled_components = { version = "0.103.0" }
106+
styled_jsx = { version = "0.79.0" }
107+
swc_emotion = { version = "0.79.0" }
108+
swc_relay = { version = "0.49.0" }
109109

110110
# General Deps
111111
chromiumoxide = { version = "0.5.4", features = [
@@ -227,4 +227,4 @@ wasmer-compiler-cranelift = { git = "https://github.com/kdy1/wasmer", branch = "
227227
wasmer-wasix = { git = "https://github.com/kdy1/wasmer", branch = "build-deps" }
228228

229229
# Remove this once https://github.com/wooorm/mdxjs-rs/pull/62 is merged and released
230-
mdxjs = { git="https://github.com/kdy1/mdxjs-rs.git", branch="swc-core-11" }
230+
mdxjs = { git="https://github.com/kdy1/mdxjs-rs.git", branch="swc-core-13" }

crates/next-core/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ lazy_static = { workspace = true }
3232
thiserror = { workspace = true }
3333
tracing = { workspace = true }
3434
rustc-hash = { workspace = true }
35-
react_remove_properties = "0.28.0"
36-
remove_console = "0.29.0"
35+
react_remove_properties = "0.29.0"
36+
remove_console = "0.30.0"
3737

3838
auto-hash-map = { workspace = true }
3939

crates/next-custom-transforms/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ swc_relay = { workspace = true }
6060
turbopack-ecmascript-plugins = { workspace = true, optional = true }
6161
turbo-rcstr = { workspace = true }
6262

63-
react_remove_properties = "0.28.0"
64-
remove_console = "0.29.0"
65-
preset_env_base = "2.0.0"
63+
react_remove_properties = "0.29.0"
64+
remove_console = "0.30.0"
65+
preset_env_base = "2.0.1"
6666

6767
[dev-dependencies]
6868
swc_core = { workspace = true, features = ["testing_transform"]}

crates/next-custom-transforms/src/transforms/cjs_optimizer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct State {
5050

5151
extra_stmts: Vec<Stmt>,
5252

53-
rename_map: swc_rustc_hash::FxHashMap<Id, Id>,
53+
rename_map: FxHashMap<Id, Id>,
5454

5555
/// Ignored identifiers for `obj` of [MemberExpr].
5656
ignored: FxHashSet<Id>,

crates/next-custom-transforms/src/transforms/fonts/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use rustc_hash::FxHashSet;
1+
use rustc_hash::{FxHashMap, FxHashSet};
22
use serde::Deserialize;
33
use swc_core::{
4-
common::{collections::AHashMap, BytePos, Spanned},
4+
common::{BytePos, Spanned},
55
ecma::{
66
ast::{Id, ModuleItem, Pass},
77
atoms::JsWord,
@@ -36,7 +36,7 @@ pub struct FontFunction {
3636
}
3737
#[derive(Debug, Default)]
3838
pub struct State {
39-
font_functions: AHashMap<Id, FontFunction>,
39+
font_functions: FxHashMap<Id, FontFunction>,
4040
removeable_module_items: FxHashSet<BytePos>,
4141
font_imports: Vec<ModuleItem>,
4242
font_exports: Vec<ModuleItem>,

crates/next-custom-transforms/src/transforms/import_analyzer.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use rustc_hash::{FxHashMap, FxHashSet};
12
use swc_core::{
23
atoms::JsWord,
3-
common::collections::{AHashMap, AHashSet},
44
ecma::{
55
ast::{
66
Expr, Id, ImportDecl, ImportNamedSpecifier, ImportSpecifier, MemberExpr, MemberProp,
@@ -13,11 +13,11 @@ use swc_core::{
1313
#[derive(Debug, Default)]
1414
pub(crate) struct ImportMap {
1515
/// Map from module name to (module path, exported symbol)
16-
imports: AHashMap<Id, (JsWord, JsWord)>,
16+
imports: FxHashMap<Id, (JsWord, JsWord)>,
1717

18-
namespace_imports: AHashMap<Id, JsWord>,
18+
namespace_imports: FxHashMap<Id, JsWord>,
1919

20-
imported_modules: AHashSet<JsWord>,
20+
imported_modules: FxHashSet<JsWord>,
2121
}
2222

2323
#[allow(unused)]

turbopack/crates/turbopack-core/src/chunk/chunk_group.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::collections::HashSet;
33
use anyhow::{Context, Result};
44
use auto_hash_map::AutoSet;
55
use futures::future::Either;
6-
use swc_core::alloc::collections::FxHashMap;
6+
use rustc_hash::FxHashMap;
77
use turbo_tasks::{
88
FxIndexMap, FxIndexSet, ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt, Value, Vc,
99
};

turbopack/crates/turbopack-ecmascript/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ swc_core = { workspace = true, features = [
6767
"testing",
6868
"base",
6969
] }
70-
swc_ecma_visit = { version = "5.0.0", features = ["serde-impl"] }
70+
swc_ecma_visit = { version = "6.0.0", features = ["serde-impl"] }
7171

7272
[dev-dependencies]
7373
criterion = { workspace = true, features = ["async_tokio"] }

turbopack/crates/turbopack-ecmascript/src/transform/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ use std::{fmt::Debug, hash::Hash, sync::Arc};
22

33
use anyhow::Result;
44
use async_trait::async_trait;
5+
use rustc_hash::FxHashMap;
56
use swc_core::{
67
atoms::{atom, Atom},
78
base::SwcComments,
8-
common::{collections::AHashMap, comments::Comments, util::take::Take, Mark, SourceMap},
9+
common::{comments::Comments, util::take::Take, Mark, SourceMap},
910
ecma::{
1011
ast::{Module, ModuleItem, Program, Script},
1112
preset_env::{self, Targets},
@@ -129,7 +130,7 @@ impl EcmascriptInputTransform {
129130
} = ctx;
130131
match self {
131132
EcmascriptInputTransform::GlobalTypeofs { window_value } => {
132-
let mut typeofs: AHashMap<Atom, Atom> = Default::default();
133+
let mut typeofs: FxHashMap<Atom, Atom> = Default::default();
133134
typeofs.insert(Atom::from("window"), Atom::from(&**window_value));
134135

135136
program.mutate(inline_globals2(

0 commit comments

Comments
 (0)