Skip to content

Commit 4b3dfda

Browse files
kdy1sokra
andauthored
build: Update swc_core to v0.86.1 (#56770)
### What? Update SWC crates, to apply bugfixes. ### Why? We adjusted the mangling option to make it identical with `swcMinify: false` with #56281, and it revealed some bugs of the name mangler of the SWC minifier. ### How? - Fixes #56550 - Fixes #56614 - Turbopack counterpart: vercel/turborepo#6171 ### Other Turbopack Changes * vercel/turborepo#6177 <!-- Tim Neutkens - Add support for FreeVarReference::Error --> * vercel/turborepo#6180 <!-- Tobias Koppers - fix chunk loading in build runtime --> * vercel/turborepo#6191 <!-- Justin Ridgewell - Deduplicate referenced_output_assets --> * vercel/turborepo#6171 <!-- Donny/강동윤 - build: Update `swc_core` to `v0.86.1` --> Closes WEB-1775 --------- Co-authored-by: Tobias Koppers <[email protected]>
1 parent 552b974 commit 4b3dfda

File tree

8 files changed

+457
-193
lines changed

8 files changed

+457
-193
lines changed

Cargo.lock

Lines changed: 438 additions & 172 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ next-transform-dynamic = { path = "packages/next-swc/crates/next-transform-dynam
3333
next-transform-strip-page-exports = { path = "packages/next-swc/crates/next-transform-strip-page-exports" }
3434

3535
# SWC crates
36-
swc_core = { version = "0.83.28", features = [
36+
swc_core = { version = "0.86.1", features = [
3737
"ecma_loader_lru",
3838
"ecma_loader_parking_lot",
3939
] }
40-
testing = { version = "0.34.1" }
40+
testing = { version = "0.35.0" }
4141

4242
# Turbo crates
43-
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231013.3" }
43+
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231017.3" }
4444
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
45-
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231013.3" }
45+
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231017.3" }
4646
# [TODO]: need to refactor embed_directory! macro usage in next-core
47-
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231013.3" }
47+
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231017.3" }
4848

4949
# General Deps
5050

packages/next-swc/crates/core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ turbopack-binding = { workspace = true, features = [
3333
"__swc_transform_modularize_imports",
3434
"__swc_transform_relay",
3535
] }
36-
react_remove_properties = "0.3.0"
37-
remove_console = "0.4.0"
36+
react_remove_properties = "0.5.0"
37+
remove_console = "0.6.0"
3838

3939
[dev-dependencies]
4040
turbopack-binding = { workspace = true, features = [

packages/next-swc/crates/core/src/cjs_optimizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ impl VisitMut for CjsOptimizer {
233233
self.data.imports.insert(
234234
key,
235235
ImportRecord {
236-
module_specifier: v.value.clone().into(),
236+
module_specifier: v.value.clone(),
237237
},
238238
);
239239
}

packages/next-swc/crates/core/src/optimize_server_react.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl Fold for OptimizeServerReact {
6868
new_items.push(item.clone().fold_with(self));
6969

7070
if let ModuleItem::ModuleDecl(ModuleDecl::Import(import_decl)) = &item {
71-
if import_decl.src.value.to_string() != "react" {
71+
if import_decl.src.value != "react" {
7272
continue;
7373
}
7474
for specifier in &import_decl.specifiers {
@@ -119,9 +119,7 @@ impl Fold for OptimizeServerReact {
119119
if &f.to_id() == react_ident {
120120
if let MemberProp::Ident(i) = &member.prop {
121121
// Remove `React.useEffect` and `React.useLayoutEffect` calls
122-
if i.sym.to_string() == "useEffect"
123-
|| i.sym.to_string() == "useLayoutEffect"
124-
{
122+
if i.sym == "useEffect" || i.sym == "useLayoutEffect" {
125123
return Expr::Lit(Lit::Null(Null { span: DUMMY_SP }));
126124
}
127125
}

packages/next-swc/crates/core/src/page_config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl Fold for PageConfig {
7777
for decl in &var_decl.decls {
7878
let mut is_config = false;
7979
if let Pat::Ident(ident) = &decl.name {
80-
if &ident.id.sym == CONFIG_KEY {
80+
if ident.id.sym == CONFIG_KEY {
8181
is_config = true;
8282
}
8383
}
@@ -151,14 +151,14 @@ impl Fold for PageConfig {
151151
match &specifier.exported {
152152
Some(ident) => {
153153
if let ModuleExportName::Ident(ident) = ident {
154-
if &ident.sym == CONFIG_KEY {
154+
if ident.sym == CONFIG_KEY {
155155
self.handle_error("Config cannot be re-exported.", specifier.span)
156156
}
157157
}
158158
}
159159
None => {
160160
if let ModuleExportName::Ident(ident) = &specifier.orig {
161-
if &ident.sym == CONFIG_KEY {
161+
if ident.sym == CONFIG_KEY {
162162
self.handle_error("Config cannot be re-exported.", specifier.span)
163163
}
164164
}

packages/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
"@types/ws": "8.2.0",
192192
"@vercel/ncc": "0.34.0",
193193
"@vercel/nft": "0.22.6",
194-
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231013.3",
194+
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231017.3",
195195
"acorn": "8.5.0",
196196
"amphtml-validator": "1.0.35",
197197
"anser": "1.4.9",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)