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

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 https://github.com/vercel/next.js/pull/56281, and it
revealed some bugs of the name mangler of the SWC minifier.

### How?


 - Fixes #56550
 - Fixes #56614

 - Turbopack counterpart: https://github.com/vercel/turbo/pull/6171

### Other Turbopack Changes

* https://github.com/vercel/turbo/pull/6177 <!-- Tim Neutkens - Add
support for FreeVarReference::Error -->
* https://github.com/vercel/turbo/pull/6180 <!-- Tobias Koppers - fix
chunk loading in build runtime -->
* https://github.com/vercel/turbo/pull/6191 <!-- Justin Ridgewell -
Deduplicate referenced_output_assets -->
* https://github.com/vercel/turbo/pull/6171 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.86.1` -->

Closes WEB-1775

---------
Co-authored-by: 's avatarTobias Koppers <tobias.koppers@googlemail.com>
parent 552b9747
This diff is collapsed.
...@@ -33,18 +33,18 @@ next-transform-dynamic = { path = "packages/next-swc/crates/next-transform-dynam ...@@ -33,18 +33,18 @@ next-transform-dynamic = { path = "packages/next-swc/crates/next-transform-dynam
next-transform-strip-page-exports = { path = "packages/next-swc/crates/next-transform-strip-page-exports" } next-transform-strip-page-exports = { path = "packages/next-swc/crates/next-transform-strip-page-exports" }
# SWC crates # SWC crates
swc_core = { version = "0.83.28", features = [ swc_core = { version = "0.86.1", features = [
"ecma_loader_lru", "ecma_loader_lru",
"ecma_loader_parking_lot", "ecma_loader_parking_lot",
] } ] }
testing = { version = "0.34.1" } testing = { version = "0.35.0" }
# Turbo crates # Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231013.3" } turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231017.3" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros.. # [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231013.3" } turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231017.3" }
# [TODO]: need to refactor embed_directory! macro usage in next-core # [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231013.3" } turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231017.3" }
# General Deps # General Deps
......
...@@ -33,8 +33,8 @@ turbopack-binding = { workspace = true, features = [ ...@@ -33,8 +33,8 @@ turbopack-binding = { workspace = true, features = [
"__swc_transform_modularize_imports", "__swc_transform_modularize_imports",
"__swc_transform_relay", "__swc_transform_relay",
] } ] }
react_remove_properties = "0.3.0" react_remove_properties = "0.5.0"
remove_console = "0.4.0" remove_console = "0.6.0"
[dev-dependencies] [dev-dependencies]
turbopack-binding = { workspace = true, features = [ turbopack-binding = { workspace = true, features = [
......
...@@ -233,7 +233,7 @@ impl VisitMut for CjsOptimizer { ...@@ -233,7 +233,7 @@ impl VisitMut for CjsOptimizer {
self.data.imports.insert( self.data.imports.insert(
key, key,
ImportRecord { ImportRecord {
module_specifier: v.value.clone().into(), module_specifier: v.value.clone(),
}, },
); );
} }
......
...@@ -68,7 +68,7 @@ impl Fold for OptimizeServerReact { ...@@ -68,7 +68,7 @@ impl Fold for OptimizeServerReact {
new_items.push(item.clone().fold_with(self)); new_items.push(item.clone().fold_with(self));
if let ModuleItem::ModuleDecl(ModuleDecl::Import(import_decl)) = &item { if let ModuleItem::ModuleDecl(ModuleDecl::Import(import_decl)) = &item {
if import_decl.src.value.to_string() != "react" { if import_decl.src.value != "react" {
continue; continue;
} }
for specifier in &import_decl.specifiers { for specifier in &import_decl.specifiers {
...@@ -119,9 +119,7 @@ impl Fold for OptimizeServerReact { ...@@ -119,9 +119,7 @@ impl Fold for OptimizeServerReact {
if &f.to_id() == react_ident { if &f.to_id() == react_ident {
if let MemberProp::Ident(i) = &member.prop { if let MemberProp::Ident(i) = &member.prop {
// Remove `React.useEffect` and `React.useLayoutEffect` calls // Remove `React.useEffect` and `React.useLayoutEffect` calls
if i.sym.to_string() == "useEffect" if i.sym == "useEffect" || i.sym == "useLayoutEffect" {
|| i.sym.to_string() == "useLayoutEffect"
{
return Expr::Lit(Lit::Null(Null { span: DUMMY_SP })); return Expr::Lit(Lit::Null(Null { span: DUMMY_SP }));
} }
} }
......
...@@ -77,7 +77,7 @@ impl Fold for PageConfig { ...@@ -77,7 +77,7 @@ impl Fold for PageConfig {
for decl in &var_decl.decls { for decl in &var_decl.decls {
let mut is_config = false; let mut is_config = false;
if let Pat::Ident(ident) = &decl.name { if let Pat::Ident(ident) = &decl.name {
if &ident.id.sym == CONFIG_KEY { if ident.id.sym == CONFIG_KEY {
is_config = true; is_config = true;
} }
} }
...@@ -151,14 +151,14 @@ impl Fold for PageConfig { ...@@ -151,14 +151,14 @@ impl Fold for PageConfig {
match &specifier.exported { match &specifier.exported {
Some(ident) => { Some(ident) => {
if let ModuleExportName::Ident(ident) = ident { if let ModuleExportName::Ident(ident) = ident {
if &ident.sym == CONFIG_KEY { if ident.sym == CONFIG_KEY {
self.handle_error("Config cannot be re-exported.", specifier.span) self.handle_error("Config cannot be re-exported.", specifier.span)
} }
} }
} }
None => { None => {
if let ModuleExportName::Ident(ident) = &specifier.orig { if let ModuleExportName::Ident(ident) = &specifier.orig {
if &ident.sym == CONFIG_KEY { if ident.sym == CONFIG_KEY {
self.handle_error("Config cannot be re-exported.", specifier.span) self.handle_error("Config cannot be re-exported.", specifier.span)
} }
} }
......
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
"@types/ws": "8.2.0", "@types/ws": "8.2.0",
"@vercel/ncc": "0.34.0", "@vercel/ncc": "0.34.0",
"@vercel/nft": "0.22.6", "@vercel/nft": "0.22.6",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231013.3", "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231017.3",
"acorn": "8.5.0", "acorn": "8.5.0",
"amphtml-validator": "1.0.35", "amphtml-validator": "1.0.35",
"anser": "1.4.9", "anser": "1.4.9",
......
...@@ -1061,8 +1061,8 @@ importers: ...@@ -1061,8 +1061,8 @@ importers:
specifier: 0.22.6 specifier: 0.22.6
version: 0.22.6 version: 0.22.6
'@vercel/turbopack-ecmascript-runtime': '@vercel/turbopack-ecmascript-runtime':
specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231013.3 specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231017.3
version: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231013.3(react-refresh@0.12.0)(webpack@5.86.0)' version: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231017.3(react-refresh@0.12.0)(webpack@5.86.0)'
acorn: acorn:
specifier: 8.5.0 specifier: 8.5.0
version: 8.5.0 version: 8.5.0
...@@ -25109,9 +25109,9 @@ packages: ...@@ -25109,9 +25109,9 @@ packages:
/zwitch@2.0.4: /zwitch@2.0.4:
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
'@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231013.3(react-refresh@0.12.0)(webpack@5.86.0)': '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231017.3(react-refresh@0.12.0)(webpack@5.86.0)':
resolution: {registry: https://registry.npmjs.org/, tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231013.3} resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231017.3}
id: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231013.3' id: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-231017.3'
name: '@vercel/turbopack-ecmascript-runtime' name: '@vercel/turbopack-ecmascript-runtime'
version: 0.0.0 version: 0.0.0
dependencies: dependencies:
......
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