Skip to content

Commit

Permalink
chore: update SWC toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix-ru committed Sep 28, 2023
1 parent 85fec74 commit 22fda64
Show file tree
Hide file tree
Showing 10 changed files with 216 additions and 272 deletions.
433 changes: 191 additions & 242 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[workspace]
members = ["crates/*"]
resolver = "2"

[profile.release]
# Configurations explicitly listed here for clarity.
Expand Down
6 changes: 3 additions & 3 deletions crates/fervid/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ fervid_transform = { path="../fervid_transform", version = "0.0.1" }
nom = "7"
regex = "1"
phf = { version = "0.11", features = ["macros"] }
swc_ecma_codegen = "0.138.*"
swc_ecma_parser = "0.133.*"
swc_core = { version = "0.75.*", features = ["ecma_ast"] }
swc_ecma_codegen = "0.145.*"
swc_ecma_parser = "0.140.*"
swc_core = { version = "0.83.*", features = ["ecma_ast"] }
lazy_static = "1.4.0"
fxhash = "0.2.1"

Expand Down
6 changes: 3 additions & 3 deletions crates/fervid_codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ license = "Apache-2.0"
[dependencies]
fervid_core = { path="../fervid_core", version = "0.0.1" }
lazy_static = "1.4.0"
swc_core = { version = "0.75.*", features = ["ecma_ast"] }
swc_ecma_codegen = "0.138.*"
swc_core = { version = "0.83.*", features = ["ecma_ast"] }
swc_ecma_codegen = "0.145.*"
fxhash = "0.2.1"
smallvec = "1.10.0"
regex = "1"
flagset = "0.4.3"

[dev-dependencies]
panic-message = "0.3.0"
swc_ecma_parser = "0.133.*"
swc_ecma_parser = "0.140.*"
12 changes: 5 additions & 7 deletions crates/fervid_codegen/src/control_flow/sfc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl CodegenContext {
raw: None,
}),
type_only: false,
asserts: None,
with: None,
})));
}

Expand Down Expand Up @@ -169,13 +169,11 @@ impl CodegenContext {
let mut buff: Vec<u8> = Vec::new();
let writer: JsWriter<&mut Vec<u8>> = JsWriter::new(cm.clone(), "\n", &mut buff, None);

let mut emitter_cfg = swc_ecma_codegen::Config::default();
emitter_cfg.minify = minify;

let mut emitter = Emitter {
cfg: swc_ecma_codegen::Config {
target: Default::default(),
ascii_only: false,
minify,
omit_last_semi: false,
},
cfg: emitter_cfg,
comments: None,
wr: writer,
cm,
Expand Down
2 changes: 1 addition & 1 deletion crates/fervid_codegen/src/imports/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ mod tests {
raw: None,
}),
type_only: false,
asserts: None,
with: None,
};

assert_eq!(crate::test_utils::to_str(vue_import_decl), "import{createBlock as _createBlock,normalizeClass as _normalizeClass,openBlock as _openBlock,toDisplayString as _toDisplayString,withCtx as _withCtx,withDirectives as _withDirectives,withModifiers as _withModifiers}from\"vue\";");
Expand Down
10 changes: 4 additions & 6 deletions crates/fervid_codegen/src/test_utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ pub fn to_str(swc_node: impl Node) -> String {
let mut buff: Vec<u8> = Vec::with_capacity(128);
let writer: JsWriter<&mut Vec<u8>> = JsWriter::new(cm.clone(), "\n", &mut buff, None);

let mut emitter_cfg = swc_ecma_codegen::Config::default();
emitter_cfg.minify = true;

let mut emitter = Emitter {
cfg: swc_ecma_codegen::Config {
target: Default::default(),
ascii_only: false,
minify: true,
omit_last_semi: false,
},
cfg: emitter_cfg,
comments: None,
wr: writer,
cm,
Expand Down
2 changes: 1 addition & 1 deletion crates/fervid_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ license = "Apache-2.0"
[dependencies]
flagset = "0.4.3"
phf = { version = "0.11", features = ["macros"] }
swc_core = { version = "0.75.*", features = ["ecma_ast"] }
swc_core = { version = "0.83.*", features = ["ecma_ast"] }
6 changes: 3 additions & 3 deletions crates/fervid_transform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ license = "Apache-2.0"
fervid_core = { path="../fervid_core", version = "0.0.1" }
lazy_static = "1.4.0"
phf = { version = "0.11", features = ["macros"] }
swc_core = { version = "0.75.*", features = ["common", "ecma_ast", "ecma_visit"] }
swc_core = { version = "0.83.*", features = ["common", "ecma_ast", "ecma_visit"] }
smallvec = "1.10.0"

[dev-dependencies]
swc_ecma_codegen = "0.138.*"
swc_ecma_parser = "0.133.*"
swc_ecma_codegen = "0.145.*"
swc_ecma_parser = "0.140.*"
10 changes: 4 additions & 6 deletions crates/fervid_transform/src/test_utils/js_stringify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ pub fn to_str(swc_node: &impl Node) -> String {
let mut buff: Vec<u8> = Vec::with_capacity(128);
let writer: JsWriter<&mut Vec<u8>> = JsWriter::new(cm.clone(), "\n", &mut buff, None);

let mut emitter_cfg = swc_ecma_codegen::Config::default();
emitter_cfg.minify = true;

let mut emitter = Emitter {
cfg: swc_ecma_codegen::Config {
target: Default::default(),
ascii_only: false,
minify: true,
omit_last_semi: false,
},
cfg: emitter_cfg,
comments: None,
wr: writer,
cm,
Expand Down

0 comments on commit 22fda64

Please sign in to comment.