Unverified Commit b6f8743e authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

Update `swc_core` to `v13.0.4` (#75684)

### What?

ChangeLog:
https://github.com/swc-project/swc/compare/swc_core%40v12.0.0...swc_core%40v13.0.4

### Why?


 - To keep in sync
 - To drop `rustc-hash` v1
 - To apply https://github.com/swc-project/swc/pull/9978

---------
Co-authored-by: 's avatarNiklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
parent 0f6fc0a9
This diff is collapsed.
...@@ -91,21 +91,21 @@ turbopack-trace-utils = { path = "turbopack/crates/turbopack-trace-utils" } ...@@ -91,21 +91,21 @@ turbopack-trace-utils = { path = "turbopack/crates/turbopack-trace-utils" }
turbopack-wasm = { path = "turbopack/crates/turbopack-wasm" } turbopack-wasm = { path = "turbopack/crates/turbopack-wasm" }
# SWC crates # SWC crates
swc_core = { version = "12.0.0", features = [ swc_core = { version = "13.0.4", features = [
"ecma_loader_lru", "ecma_loader_lru",
"ecma_loader_parking_lot", "ecma_loader_parking_lot",
] } ] }
testing = { version = "5.0.0" } testing = { version = "6.0.0" }
# Keep consistent with preset_env_base through swc_core # Keep consistent with preset_env_base through swc_core
browserslist-rs = { version = "0.17.0" } browserslist-rs = { version = "0.17.0" }
miette = { version = "5.10.0", features = ["fancy"] } miette = { version = "5.10.0", features = ["fancy"] }
mdxjs = "0.2.15" mdxjs = "0.3"
modularize_imports = { version = "0.74.0" } modularize_imports = { version = "0.75.0" }
styled_components = { version = "0.102.0" } styled_components = { version = "0.103.0" }
styled_jsx = { version = "0.78.0" } styled_jsx = { version = "0.79.0" }
swc_emotion = { version = "0.78.0" } swc_emotion = { version = "0.79.0" }
swc_relay = { version = "0.48.0" } swc_relay = { version = "0.49.0" }
# General Deps # General Deps
chromiumoxide = { version = "0.5.4", features = [ chromiumoxide = { version = "0.5.4", features = [
...@@ -227,4 +227,4 @@ wasmer-compiler-cranelift = { git = "https://github.com/kdy1/wasmer", branch = " ...@@ -227,4 +227,4 @@ wasmer-compiler-cranelift = { git = "https://github.com/kdy1/wasmer", branch = "
wasmer-wasix = { git = "https://github.com/kdy1/wasmer", branch = "build-deps" } wasmer-wasix = { git = "https://github.com/kdy1/wasmer", branch = "build-deps" }
# Remove this once https://github.com/wooorm/mdxjs-rs/pull/62 is merged and released # Remove this once https://github.com/wooorm/mdxjs-rs/pull/62 is merged and released
mdxjs = { git="https://github.com/kdy1/mdxjs-rs.git", branch="swc-core-11" } mdxjs = { git="https://github.com/kdy1/mdxjs-rs.git", branch="swc-core-13" }
...@@ -32,8 +32,8 @@ lazy_static = { workspace = true } ...@@ -32,8 +32,8 @@ lazy_static = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
tracing = { workspace = true } tracing = { workspace = true }
rustc-hash = { workspace = true } rustc-hash = { workspace = true }
react_remove_properties = "0.28.0" react_remove_properties = "0.29.0"
remove_console = "0.29.0" remove_console = "0.30.0"
auto-hash-map = { workspace = true } auto-hash-map = { workspace = true }
......
...@@ -60,9 +60,9 @@ swc_relay = { workspace = true } ...@@ -60,9 +60,9 @@ swc_relay = { workspace = true }
turbopack-ecmascript-plugins = { workspace = true, optional = true } turbopack-ecmascript-plugins = { workspace = true, optional = true }
turbo-rcstr = { workspace = true } turbo-rcstr = { workspace = true }
react_remove_properties = "0.28.0" react_remove_properties = "0.29.0"
remove_console = "0.29.0" remove_console = "0.30.0"
preset_env_base = "2.0.0" preset_env_base = "2.0.1"
[dev-dependencies] [dev-dependencies]
swc_core = { workspace = true, features = ["testing_transform"]} swc_core = { workspace = true, features = ["testing_transform"]}
......
...@@ -50,7 +50,7 @@ struct State { ...@@ -50,7 +50,7 @@ struct State {
extra_stmts: Vec<Stmt>, extra_stmts: Vec<Stmt>,
rename_map: swc_rustc_hash::FxHashMap<Id, Id>, rename_map: FxHashMap<Id, Id>,
/// Ignored identifiers for `obj` of [MemberExpr]. /// Ignored identifiers for `obj` of [MemberExpr].
ignored: FxHashSet<Id>, ignored: FxHashSet<Id>,
......
use rustc_hash::FxHashSet; use rustc_hash::{FxHashMap, FxHashSet};
use serde::Deserialize; use serde::Deserialize;
use swc_core::{ use swc_core::{
common::{collections::AHashMap, BytePos, Spanned}, common::{BytePos, Spanned},
ecma::{ ecma::{
ast::{Id, ModuleItem, Pass}, ast::{Id, ModuleItem, Pass},
atoms::JsWord, atoms::JsWord,
...@@ -36,7 +36,7 @@ pub struct FontFunction { ...@@ -36,7 +36,7 @@ pub struct FontFunction {
} }
#[derive(Debug, Default)] #[derive(Debug, Default)]
pub struct State { pub struct State {
font_functions: AHashMap<Id, FontFunction>, font_functions: FxHashMap<Id, FontFunction>,
removeable_module_items: FxHashSet<BytePos>, removeable_module_items: FxHashSet<BytePos>,
font_imports: Vec<ModuleItem>, font_imports: Vec<ModuleItem>,
font_exports: Vec<ModuleItem>, font_exports: Vec<ModuleItem>,
......
use rustc_hash::{FxHashMap, FxHashSet};
use swc_core::{ use swc_core::{
atoms::JsWord, atoms::JsWord,
common::collections::{AHashMap, AHashSet},
ecma::{ ecma::{
ast::{ ast::{
Expr, Id, ImportDecl, ImportNamedSpecifier, ImportSpecifier, MemberExpr, MemberProp, Expr, Id, ImportDecl, ImportNamedSpecifier, ImportSpecifier, MemberExpr, MemberProp,
...@@ -13,11 +13,11 @@ use swc_core::{ ...@@ -13,11 +13,11 @@ use swc_core::{
#[derive(Debug, Default)] #[derive(Debug, Default)]
pub(crate) struct ImportMap { pub(crate) struct ImportMap {
/// Map from module name to (module path, exported symbol) /// Map from module name to (module path, exported symbol)
imports: AHashMap<Id, (JsWord, JsWord)>, imports: FxHashMap<Id, (JsWord, JsWord)>,
namespace_imports: AHashMap<Id, JsWord>, namespace_imports: FxHashMap<Id, JsWord>,
imported_modules: AHashSet<JsWord>, imported_modules: FxHashSet<JsWord>,
} }
#[allow(unused)] #[allow(unused)]
......
...@@ -3,7 +3,7 @@ use std::collections::HashSet; ...@@ -3,7 +3,7 @@ use std::collections::HashSet;
use anyhow::{Context, Result}; use anyhow::{Context, Result};
use auto_hash_map::AutoSet; use auto_hash_map::AutoSet;
use futures::future::Either; use futures::future::Either;
use swc_core::alloc::collections::FxHashMap; use rustc_hash::FxHashMap;
use turbo_tasks::{ use turbo_tasks::{
FxIndexMap, FxIndexSet, ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt, Value, Vc, FxIndexMap, FxIndexSet, ResolvedVc, TryFlatJoinIterExt, TryJoinIterExt, Value, Vc,
}; };
......
...@@ -67,7 +67,7 @@ swc_core = { workspace = true, features = [ ...@@ -67,7 +67,7 @@ swc_core = { workspace = true, features = [
"testing", "testing",
"base", "base",
] } ] }
swc_ecma_visit = { version = "5.0.0", features = ["serde-impl"] } swc_ecma_visit = { version = "6.0.0", features = ["serde-impl"] }
[dev-dependencies] [dev-dependencies]
criterion = { workspace = true, features = ["async_tokio"] } criterion = { workspace = true, features = ["async_tokio"] }
......
...@@ -2,10 +2,11 @@ use std::{fmt::Debug, hash::Hash, sync::Arc}; ...@@ -2,10 +2,11 @@ use std::{fmt::Debug, hash::Hash, sync::Arc};
use anyhow::Result; use anyhow::Result;
use async_trait::async_trait; use async_trait::async_trait;
use rustc_hash::FxHashMap;
use swc_core::{ use swc_core::{
atoms::{atom, Atom}, atoms::{atom, Atom},
base::SwcComments, base::SwcComments,
common::{collections::AHashMap, comments::Comments, util::take::Take, Mark, SourceMap}, common::{comments::Comments, util::take::Take, Mark, SourceMap},
ecma::{ ecma::{
ast::{Module, ModuleItem, Program, Script}, ast::{Module, ModuleItem, Program, Script},
preset_env::{self, Targets}, preset_env::{self, Targets},
...@@ -129,7 +130,7 @@ impl EcmascriptInputTransform { ...@@ -129,7 +130,7 @@ impl EcmascriptInputTransform {
} = ctx; } = ctx;
match self { match self {
EcmascriptInputTransform::GlobalTypeofs { window_value } => { EcmascriptInputTransform::GlobalTypeofs { window_value } => {
let mut typeofs: AHashMap<Atom, Atom> = Default::default(); let mut typeofs: FxHashMap<Atom, Atom> = Default::default();
typeofs.insert(Atom::from("window"), Atom::from(&**window_value)); typeofs.insert(Atom::from("window"), Atom::from(&**window_value));
program.mutate(inline_globals2( program.mutate(inline_globals2(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment