Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Update swc_core to v0.86.1 #56770

Merged
merged 8 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
610 changes: 438 additions & 172 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

# SWC crates
swc_core = { version = "0.83.28", features = [
swc_core = { version = "0.86.1", features = [
"ecma_loader_lru",
"ecma_loader_parking_lot",
] }
testing = { version = "0.34.1" }
testing = { version = "0.35.0" }

# 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..
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
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

Expand Down
4 changes: 2 additions & 2 deletions packages/next-swc/crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ turbopack-binding = { workspace = true, features = [
"__swc_transform_modularize_imports",
"__swc_transform_relay",
] }
react_remove_properties = "0.3.0"
remove_console = "0.4.0"
react_remove_properties = "0.5.0"
remove_console = "0.6.0"

[dev-dependencies]
turbopack-binding = { workspace = true, features = [
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/crates/core/src/cjs_optimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl VisitMut for CjsOptimizer {
self.data.imports.insert(
key,
ImportRecord {
module_specifier: v.value.clone().into(),
module_specifier: v.value.clone(),
},
);
}
Expand Down
6 changes: 2 additions & 4 deletions packages/next-swc/crates/core/src/optimize_server_react.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl Fold for OptimizeServerReact {
new_items.push(item.clone().fold_with(self));

if let ModuleItem::ModuleDecl(ModuleDecl::Import(import_decl)) = &item {
if import_decl.src.value.to_string() != "react" {
if import_decl.src.value != "react" {
continue;
}
for specifier in &import_decl.specifiers {
Expand Down Expand Up @@ -119,9 +119,7 @@ impl Fold for OptimizeServerReact {
if &f.to_id() == react_ident {
if let MemberProp::Ident(i) = &member.prop {
// Remove `React.useEffect` and `React.useLayoutEffect` calls
if i.sym.to_string() == "useEffect"
|| i.sym.to_string() == "useLayoutEffect"
{
if i.sym == "useEffect" || i.sym == "useLayoutEffect" {
return Expr::Lit(Lit::Null(Null { span: DUMMY_SP }));
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/next-swc/crates/core/src/page_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl Fold for PageConfig {
for decl in &var_decl.decls {
let mut is_config = false;
if let Pat::Ident(ident) = &decl.name {
if &ident.id.sym == CONFIG_KEY {
if ident.id.sym == CONFIG_KEY {
is_config = true;
}
}
Expand Down Expand Up @@ -151,14 +151,14 @@ impl Fold for PageConfig {
match &specifier.exported {
Some(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)
}
}
}
None => {
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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"@types/ws": "8.2.0",
"@vercel/ncc": "0.34.0",
"@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",
"amphtml-validator": "1.0.35",
"anser": "1.4.9",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading