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

chore: Update swc #40520

Merged
merged 18 commits into from Sep 15, 2022
179 changes: 95 additions & 84 deletions packages/next-swc/Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/next-swc/crates/core/Cargo.toml
Expand Up @@ -28,7 +28,7 @@ styled_jsx = {path="../styled_jsx"}
modularize_imports = {path="../modularize_imports"}
tracing = { version = "0.1.32", features = ["release_max_level_info"] }

swc_core = { version = "0.22.4", features = [
swc_core = { version = "0.23.17", features = [
"common_concurrent",
"ecma_ast",
"ecma_visit",
Expand All @@ -47,6 +47,6 @@ swc_core = { version = "0.22.4", features = [
] }

[dev-dependencies]
swc_core = { version = "0.22.4", features = ["testing_transform"] }
testing = "0.30.0"
swc_core = { version = "0.23.17", features = ["testing_transform"] }
testing = "0.30.3"
walkdir = "2.3.2"
Expand Up @@ -8,4 +8,4 @@ export default function Home() {
</div>

</div>;
};
}
Expand Up @@ -8,4 +8,4 @@ export default function Home() {
</div>

</div>;
};
}
@@ -1,4 +1,4 @@
let shouldBeKept = 'should be kept';
export default function shouldBeKept() {
console.log(shouldBeKept);
};
}
Expand Up @@ -3,4 +3,4 @@ const [foo] = other;
export var __N_SSP = true;
export default function Home() {
return __jsx("div", null);
};
}
Expand Up @@ -3,4 +3,4 @@ const [foo] = other;
export var __N_SSG = true;
export default function Home() {
return __jsx("div", null);
};
}
Expand Up @@ -3,4 +3,4 @@ const { a , cat: bar } = other;
export var __N_SSG = true;
export default function Home() {
return __jsx("div", null);
};
}
@@ -1,4 +1,4 @@
export var __N_SSG = true;
export default function Home({}) {
return __jsx("div", null, __jsx("p", null, "Hello World"));
};
}
Expand Up @@ -2,4 +2,4 @@ export var __N_SSG = true;
export const revalidateInSeconds = 5 * 60;
export default function Home({}) {
return __jsx("div", null, __jsx("p", null, "Hello World"));
};
}
Expand Up @@ -3,4 +3,4 @@ export class MyClass {
}
export default function Test() {
return __jsx("div", null);
};
}
Expand Up @@ -2,4 +2,4 @@ export var __N_SSG = true;
export function Noop() {}
export default function Test() {
return __jsx("div", null);
};
}
Expand Up @@ -2,4 +2,4 @@ export var __N_SSG = true;
export const foo = 2;
export default function Test() {
return __jsx("div", null);
};
}
Expand Up @@ -12,4 +12,4 @@ export default function Test() {
attr: AttributeValue,
jsx: __jsx(AttributeJSX, null)
}), __jsx(JSXMemberExpression.Deep.Property, null)));
};
}
@@ -1,4 +1,4 @@
export var __N_SSG = true;
export default function Test() {
return __jsx("div", null);
};
}
Expand Up @@ -2,4 +2,4 @@ export var __N_SSG = true;
export { foo, bar as baz } from '.';
export default function Test() {
return __jsx("div", null);
};
}
@@ -1,4 +1,4 @@
export var __N_SSG = true;
export default function Test() {
return __jsx("div", null);
};
}
@@ -1,4 +1,4 @@
export var __N_SSG = true;
export default function Test() {
return __jsx("div", null);
};
}
@@ -1,4 +1,4 @@
export var __N_SSG = true;
export default function Test() {
return __jsx("div", null);
};
}
@@ -1,4 +1,4 @@
export var __N_SSG = true;
export default function Test() {
return __jsx("div", null);
};
}
Expand Up @@ -7,4 +7,4 @@ function dont_bug_me_either() {}
export var __N_SSG = true;
export default function Test() {
return __jsx("div", null);
};
}
@@ -1,4 +1,4 @@
export var __N_SSG = true;
export default function Test() {
return __jsx("div", null);
};
}
Expand Up @@ -2,4 +2,4 @@ const a = 2;
export var __N_SSG = true;
export default function Test() {
return __jsx("div", null);
};
}
@@ -1,4 +1,4 @@
export var __N_SSG = true;
export default function Test() {
return __jsx("div", null);
};
}
@@ -1,4 +1,4 @@
export var __N_SSG = true;
export default function Test() {
return __jsx("div", null);
};
}
@@ -1,4 +1,4 @@
export var __N_SSG = true;
export default function Home() {
return __jsx("div", null);
};
}
Expand Up @@ -3,4 +3,4 @@ export default class Test extends React.Component {
render() {
return __jsx("div", null);
}
};
}
Expand Up @@ -38,4 +38,4 @@ import r from "other";
export var __N_SSG = !0;
export default function n() {
return React.createElement("div", null);
};
}
Expand Up @@ -58,4 +58,4 @@ var Foo = function Foo() {
export var __N_SSG = true;
export default function Home() {
return /*#__PURE__*/ React.createElement("div", null);
};
}
Expand Up @@ -10,4 +10,4 @@ export default function Foo() {
}, React.createElement(_JSXStyle, {
id: "eb368961fd3b0a99"
}, "span.jsx-eb368961fd3b0a99{color:red}"));
};
}
Expand Up @@ -14,7 +14,7 @@ export default function Home() {
}, /*#__PURE__*/ React.createElement("path", null), /*#__PURE__*/ React.createElement("path", null)), /*#__PURE__*/ React.createElement("g", {
className: "group"
}, /*#__PURE__*/ React.createElement("path", null), /*#__PURE__*/ React.createElement("path", null)));
};
}
var MyClass = function MyClass() {
"use strict";
_classCallCheck(this, MyClass);
Expand Down
6 changes: 3 additions & 3 deletions packages/next-swc/crates/emotion/Cargo.toml
Expand Up @@ -19,9 +19,9 @@ regex = "1.5"
serde = "1"
sourcemap = "6.0.1"
tracing = { version = "0.1.32", features = ["release_max_level_info"] }
swc_core = { version = "0.22.4", features = ["common", "ecma_ast","ecma_codegen", "ecma_utils", "ecma_visit", "trace_macro"] }
swc_core = { version = "0.23.17", features = ["common", "ecma_ast","ecma_codegen", "ecma_utils", "ecma_visit", "trace_macro"] }

[dev-dependencies]
swc_core = { version = "0.22.4", features = ["testing_transform", "ecma_transforms_react"] }
testing = "0.30.0"
swc_core = { version = "0.23.17", features = ["testing_transform", "ecma_transforms_react"] }
testing = "0.30.3"
serde_json = "1"
6 changes: 3 additions & 3 deletions packages/next-swc/crates/modularize_imports/Cargo.toml
Expand Up @@ -15,8 +15,8 @@ handlebars = "4.2.1"
once_cell = "1.13.0"
regex = "1.5"
serde = "1"
swc_core = { version = "0.22.4", features = ["cached", "ecma_ast", "ecma_visit"] }
swc_core = { version = "0.23.17", features = ["cached", "ecma_ast", "ecma_visit"] }

[dev-dependencies]
swc_core = { version = "0.22.4", features = ["testing_transform"] }
testing = "0.30.0"
swc_core = { version = "0.23.17", features = ["testing_transform"] }
testing = "0.30.3"
2 changes: 1 addition & 1 deletion packages/next-swc/crates/napi/Cargo.toml
Expand Up @@ -30,7 +30,7 @@ next-swc = {version = "0.0.0", path = "../core"}
once_cell = "1.13.0"
serde = "1"
serde_json = "1"
swc_core = { version = "0.22.4", features = [
swc_core = { version = "0.23.17", features = [
"allocator_node",
"base_concurrent", # concurrent?
"common_concurrent",
Expand Down
6 changes: 3 additions & 3 deletions packages/next-swc/crates/styled_components/Cargo.toml
Expand Up @@ -16,7 +16,7 @@ once_cell = "1.13.0"
regex = {version = "1.5.4", features = ["std", "perf"], default-features = false}
serde = {version = "1.0.130", features = ["derive"]}
tracing = "0.1.32"
swc_core = { version = "0.22.4", features = [
swc_core = { version = "0.23.17", features = [
"common",
"ecma_ast",
"ecma_utils",
Expand All @@ -25,8 +25,8 @@ swc_core = { version = "0.22.4", features = [

[dev-dependencies]
serde_json = "1"
testing = "0.30.0"
swc_core = { version = "0.22.4", features = [
testing = "0.30.3"
swc_core = { version = "0.23.17", features = [
"ecma_parser",
"ecma_transforms",
"testing_transform"
Expand Down
6 changes: 3 additions & 3 deletions packages/next-swc/crates/styled_jsx/Cargo.toml
Expand Up @@ -13,7 +13,7 @@ version = "0.17.1"
easy-error = "1.0.0"
tracing = "0.1.32"

swc_core = { version = "0.22.4", features = [
swc_core = { version = "0.23.17", features = [
"common",
"css_ast",
"css_codegen",
Expand All @@ -27,7 +27,7 @@ swc_core = { version = "0.22.4", features = [
] }

[dev-dependencies]
testing = "0.30.0"
swc_core = { version = "0.22.4", features = [
testing = "0.30.3"
swc_core = { version = "0.23.17", features = [
"testing_transform"
] }
Expand Up @@ -9,4 +9,4 @@ export default class {

</div>;
}
};
}
Expand Up @@ -9,4 +9,4 @@ export default class {

</div>;
}
};
}
Expand Up @@ -10,7 +10,7 @@ export default class {

</Element>;
}
};
}
const Element2 = 'div';
export const Test2 = class {
render() {
Expand Down
Expand Up @@ -8,79 +8,79 @@ const animationName = 'my-cool-animation';
const obj = {
display: 'block'
};
export default (({ display })=><div className={"jsx-9f11e5fc71d05085 " + _JSXStyle.dynamic([
export default (({ display })=><div className={"jsx-78f0c8c617eb8e50 " + _JSXStyle.dynamic([
[
"e4db21be651d572a",
"cf795552a2848e6c",
[
display ? 'block' : 'none'
]
],
[
"1f060869c7312fe5",
"e9bc1314d862fde1",
[
darken(color) + 2
]
],
[
"e0c373c6551675e4",
"97b2dd85b3a5c42d",
[
darken(color)
]
]
])}>

<p className={"jsx-9f11e5fc71d05085 " + _JSXStyle.dynamic([
<p className={"jsx-78f0c8c617eb8e50 " + _JSXStyle.dynamic([
[
"e4db21be651d572a",
"cf795552a2848e6c",
[
display ? 'block' : 'none'
]
],
[
"1f060869c7312fe5",
"e9bc1314d862fde1",
[
darken(color) + 2
]
],
[
"e0c373c6551675e4",
"97b2dd85b3a5c42d",
[
darken(color)
]
]
])}>test</p>

<_JSXStyle id={"13bce568d963e978"}>{`p.${color}.jsx-9f11e5fc71d05085{color:${otherColor};display:${obj.display}}`}</_JSXStyle>
<_JSXStyle id={"95409d3438a768bd"}>{`p.${color}.jsx-78f0c8c617eb8e50{color:${otherColor};display:${obj.display}}`}</_JSXStyle>

<_JSXStyle id={"94239b6d6b42c9b5"}>{"p.jsx-9f11e5fc71d05085{color:red}"}</_JSXStyle>
<_JSXStyle id={"94239b6d6b42c9b5"}>{"p.jsx-78f0c8c617eb8e50{color:red}"}</_JSXStyle>

<_JSXStyle id={"ecd8dfc6d11e2c5e"}>{`body{background:${color}}`}</_JSXStyle>

<_JSXStyle id={"ecd8dfc6d11e2c5e"}>{`body{background:${color}}`}</_JSXStyle>

// TODO: the next two should have the same hash

<_JSXStyle id={"e7486f61219e66af"}>{`p.jsx-9f11e5fc71d05085{color:${color}}`}</_JSXStyle>
<_JSXStyle id={"e7486f61219e66af"}>{`p.jsx-78f0c8c617eb8e50{color:${color}}`}</_JSXStyle>

<_JSXStyle id={"e7486f61219e66af"}>{`p.jsx-9f11e5fc71d05085{color:${color}}`}</_JSXStyle>
<_JSXStyle id={"e7486f61219e66af"}>{`p.jsx-78f0c8c617eb8e50{color:${color}}`}</_JSXStyle>

<_JSXStyle id={"e0c373c6551675e4"} dynamic={[
<_JSXStyle id={"97b2dd85b3a5c42d"} dynamic={[
darken(color)
]}>{`p.__jsx-style-dynamic-selector{color:${darken(color)}}`}</_JSXStyle>

<_JSXStyle id={"1f060869c7312fe5"} dynamic={[
<_JSXStyle id={"e9bc1314d862fde1"} dynamic={[
darken(color) + 2
]}>{`p.__jsx-style-dynamic-selector{color:${darken(color) + 2}}`}</_JSXStyle>

<_JSXStyle id={"7c5c5bde49d6c65d"}>{`@media(min-width:${mediumScreen}){p.jsx-9f11e5fc71d05085{color:green}p.jsx-9f11e5fc71d05085{color:${`red`}}}p.jsx-9f11e5fc71d05085{color:red}`}</_JSXStyle>
<_JSXStyle id={"7c5c5bde49d6c65d"}>{`@media(min-width:${mediumScreen}){p.jsx-78f0c8c617eb8e50{color:green}p.jsx-78f0c8c617eb8e50{color:${`red`}}}p.jsx-78f0c8c617eb8e50{color:red}`}</_JSXStyle>

<_JSXStyle id={"c5506be0b4762e0b"}>{`p.jsx-9f11e5fc71d05085{-webkit-animation-duration:${animationDuration};-moz-animation-duration:${animationDuration};-o-animation-duration:${animationDuration};animation-duration:${animationDuration}}`}</_JSXStyle>
<_JSXStyle id={"c5506be0b4762e0b"}>{`p.jsx-78f0c8c617eb8e50{-webkit-animation-duration:${animationDuration};-moz-animation-duration:${animationDuration};-o-animation-duration:${animationDuration};animation-duration:${animationDuration}}`}</_JSXStyle>

<_JSXStyle id={"82f0f2f07692d2e2"}>{`p.jsx-9f11e5fc71d05085{-webkit-animation:${animationDuration} forwards ${animationName};-moz-animation:${animationDuration} forwards ${animationName};-o-animation:${animationDuration} forwards ${animationName};animation:${animationDuration} forwards ${animationName}}div.jsx-9f11e5fc71d05085{background:${color}}`}</_JSXStyle>
<_JSXStyle id={"82f0f2f07692d2e2"}>{`p.jsx-78f0c8c617eb8e50{-webkit-animation:${animationDuration} forwards ${animationName};-moz-animation:${animationDuration} forwards ${animationName};-o-animation:${animationDuration} forwards ${animationName};animation:${animationDuration} forwards ${animationName}}div.jsx-78f0c8c617eb8e50{background:${color}}`}</_JSXStyle>



<_JSXStyle id={"e4db21be651d572a"} dynamic={[
<_JSXStyle id={"cf795552a2848e6c"} dynamic={[
display ? 'block' : 'none'
]}>{`span.__jsx-style-dynamic-selector{display:${display ? 'block' : 'none'}}`}</_JSXStyle>

Expand Down
Expand Up @@ -7,4 +7,4 @@ export default function IndexPage() {
<_JSXStyle id={"b6abd0684ba81871"}>{"div{color:blue}"}</_JSXStyle>

</div>;
};
}
Expand Up @@ -9,4 +9,4 @@ export default function IndexPage() {
<_JSXStyle id={"bbdada4ef17d18ef"}>{"@supports((display:flex)or (display:-webkit-box)or (display:-webkit-flex)or (display:-moz-box)or (display:-ms-flexbox)){h1{color:hotpink}}"}</_JSXStyle>

</div>;
};
}