build(cargo): bump up swc_core, turbopack (#43652)

<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## Bug

Fixes WEB-166.

This supersedes https://github.com/vercel/next.js/pull/43449, updating
swc_core and turbopack both with its transitive dependencies. Version
bump includes one important build side issues to having circular
dependencies.
This commit is contained in:
OJ Kwon 2022-12-08 12:58:48 -08:00 committed by GitHub
parent aa4b4bf8ae
commit f144c39ca4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 469 additions and 412 deletions

File diff suppressed because it is too large Load diff

View file

@ -19,10 +19,10 @@ pathdiff = "0.2.0"
regex = "1.5"
serde = "1"
serde_json = "1"
swc_emotion = "0.28.2"
styled_components = "0.52.5"
styled_jsx = "0.29.5"
modularize_imports = "0.25.5"
swc_emotion = "0.28.4"
styled_components = "0.52.8"
styled_jsx = "0.29.8"
modularize_imports = "0.25.8"
tracing = { version = "0.1.37", features = ["release_max_level_info"] }
swc_core = { features = [
@ -42,9 +42,9 @@ swc_core = { features = [
"ecma_parser_typescript",
"cached",
"base"
], version = "0.43.23" }
], version = "0.45.4" }
[dev-dependencies]
swc_core = { features = ["testing_transform"], version = "0.43.23" }
swc_core = { features = ["testing_transform"], version = "0.45.4" }
testing = "0.31.14"
walkdir = "2.3.2"

View file

@ -1,6 +1,7 @@
x next/dynamic requires at least one argument
,-[input.js:3:1]
,-[input.js:2:1]
2 |
3 | const DynamicComponent = dynamic()
: ^^^^^^^
`----

View file

@ -1,7 +1,9 @@
x next/dynamic options must be an object literal.
| Read more: https://nextjs.org/docs/messages/invalid-dynamic-options-type
,-[input.js:4:1]
,-[input.js:3:1]
3 | const options = { loading: () => <p>...</p>, ssr: false }
4 | const DynamicComponentWithCustomLoading = dynamic(
: ^^^^^^^
5 | () => import('../components/hello'),
`----

View file

@ -1,6 +1,8 @@
x next/dynamic only accepts 2 arguments
,-[input.js:3:1]
,-[input.js:2:1]
2 |
3 | const DynamicComponentWithCustomLoading = dynamic(
: ^^^^^^^
4 | () => import('../components/hello'),
`----

View file

@ -1,12 +1,15 @@
x Font loader calls must be assigned to a const
,-[input.js:3:1]
3 |
4 | export let firaCode = Abel()
: ^^^^^^^^^^^^^^^^^^^^^
5 | export var inter = Inter()
`----
x Font loader calls must be assigned to a const
,-[input.js:4:1]
4 | export let firaCode = Abel()
: ^^^^^^^^^^^^^^^^^^^^^
`----
x Font loader calls must be assigned to a const
,-[input.js:5:1]
5 | export var inter = Inter()
: ^^^^^^^^^^^^^^^^^^^
`----

View file

@ -1,13 +1,15 @@
x Font loader calls must be assigned to a const
,-[input.js:4:1]
,-[input.js:3:1]
3 | var i = 10
4 | ,-> var inter1 = Inter({
5 | | variant: '400',
6 | `-> })
`----
x Font loader calls must be assigned to a const
,-[input.js:9:1]
,-[input.js:8:1]
8 | var i2 = 20
9 | ,-> let inter2 = Inter({
10 | | variant: '400',
11 | `-> })

View file

@ -1,12 +1,16 @@
x Font loader calls must be assigned to an identifier
,-[input.js:3:1]
,-[input.js:2:1]
2 |
3 | const { a } = Inter({
: ^^^^^
4 | variant: '400',
`----
x Font loader calls must be assigned to an identifier
,-[input.js:7:1]
,-[input.js:6:1]
6 |
7 | const [b] = Inter({
: ^^^
8 | variant: '400',
`----

View file

@ -1,24 +1,28 @@
x Unexpected object key type
,-[input.js:4:1]
,-[input.js:3:1]
3 | const a = fn({ 10: 'hello' })
4 | const a = ABeeZee({ 10: 'hello' })
: ^^
`----
x Font loader values must be explicitly written literals.
,-[input.js:7:1]
,-[input.js:6:1]
6 | const a = fn({ variant: [i1] })
7 | const a = ABeeZee({ variant: [i1] })
: ^^
`----
x Font loader values must be explicitly written literals.
,-[input.js:10:1]
,-[input.js:9:1]
9 | const a = fn({ variant: () => {} })
10 | const a = ABeeZee({ variant: () => {} })
: ^^^^^^^^
`----
x Unexpected spread
,-[input.js:13:1]
,-[input.js:12:1]
12 | const a = fn({ ...{} })
13 | const a = ABeeZee({ ...{} })
: ^^^
`----

View file

@ -1,12 +1,14 @@
x Font loaders don't accept spreads
,-[input.js:4:1]
,-[input.js:3:1]
3 | const a = fn(...{}, ...[])
4 | const inter = Inter(...{}, ...[])
: ^^^
`----
x Font loaders don't accept spreads
,-[input.js:4:1]
,-[input.js:3:1]
3 | const a = fn(...{}, ...[])
4 | const inter = Inter(...{}, ...[])
: ^^^
`----

View file

@ -1,30 +1,38 @@
x Font loaders must be called and assigned to a const in the module scope
,-[input.js:3:1]
,-[input.js:2:1]
2 |
3 | Aladin({})
: ^^^^^^
`----
x Font loaders must be called and assigned to a const in the module scope
,-[input.js:6:1]
,-[input.js:5:1]
5 | let b
6 | const a = (b = Aladin({ variant: '400' }))
: ^^^^^^
`----
x Font loaders must be called and assigned to a const in the module scope
,-[input.js:9:3]
9 | const a = Aladin({
: ^^^^^^
`----
x Font loaders must be called and assigned to a const in the module scope
,-[input.js:16:5]
16 | Aladin({
: ^^^^^^
,-[input.js:8:1]
8 | function Hello() {
9 | const a = Aladin({
: ^^^^^^
10 | variant: '400',
`----
x Font loaders must be called and assigned to a const in the module scope
,-[input.js:23:3]
23 | Aladin({})
: ^^^^^^
,-[input.js:15:1]
15 | constructor() {
16 | Aladin({
: ^^^^^^
17 | variant: '400',
`----
x Font loaders must be called and assigned to a const in the module scope
,-[input.js:22:1]
22 | {
23 | Aladin({})
: ^^^^^^
24 | }
`----

View file

@ -1,6 +1,7 @@
x You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps
,-[input.js:2:1]
,-[input.js:1:1]
1 | export async function getStaticPaths() {}
2 | export const getServerSideProps = function getServerSideProps() {}
: ^^^^^^^^^^^^^^^^^^
`----

View file

@ -1,6 +1,7 @@
x You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps
,-[input.js:2:1]
2 | export { a as getServerSideProps }
,-[input.js:1:1]
1 | const getStaticProps = async () => {}
2 | export { a as getServerSideProps }
: ^^^^^^^^^^^^^^^^^^
`----

View file

@ -1,6 +1,7 @@
x You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps
,-[input.js:2:1]
,-[input.js:1:1]
1 | export { a as getServerSideProps } from './input'
2 | export { getStaticPaths } from 'a'
: ^^^^^^^^^^^^^^
`----

View file

@ -3,4 +3,5 @@
,-[input.js:1:1]
1 | export function getServerSideProps (){
: ^^^^^^^^^^^^^^^^^^
2 | }
`----

View file

@ -3,4 +3,5 @@
,-[input.js:1:1]
1 | export function getStaticProps (){
: ^^^^^^^^^^^^^^
2 | }
`----

View file

@ -1,6 +1,7 @@
x NEXT_RSC_ERR_CLIENT_IMPORT: server-only
,-[input.js:9:1]
,-[input.js:8:1]
8 |
9 | import "server-only"
: ^^^^^^^^^^^^^^^^^^^^
`----

View file

@ -1,6 +1,7 @@
x NEXT_RSC_ERR_CLIENT_DIRECTIVE
,-[input.js:3:1]
,-[input.js:2:1]
2 |
3 | "use client"
: ^^^^^^^^^^^^
`----

View file

@ -1,6 +1,7 @@
x NEXT_RSC_ERR_SERVER_IMPORT: client-only
,-[input.js:9:1]
,-[input.js:8:1]
8 |
9 | import "client-only"
: ^^^^^^^^^^^^^^^^^^^^
`----

View file

@ -3,4 +3,5 @@
,-[input.js:1:1]
1 | export function getServerSideProps (){
: ^^^^^^^^^^^^^^^^^^
2 | }
`----

View file

@ -3,4 +3,5 @@
,-[input.js:1:1]
1 | export function getStaticProps (){
: ^^^^^^^^^^^^^^
2 | }
`----

View file

@ -6,73 +6,94 @@
`----
x NEXT_RSC_ERR_REACT_API: createContext
,-[input.js:3:1]
,-[input.js:2:1]
2 |
3 | import { createContext } from 'react'
: ^^^^^^^^^^^^^
`----
x NEXT_RSC_ERR_REACT_API: useEffect
,-[input.js:5:1]
,-[input.js:4:1]
4 |
5 | import { useEffect, useImperativeHandle } from 'react'
: ^^^^^^^^^
`----
x NEXT_RSC_ERR_REACT_API: useImperativeHandle
,-[input.js:5:1]
,-[input.js:4:1]
4 |
5 | import { useEffect, useImperativeHandle } from 'react'
: ^^^^^^^^^^^^^^^^^^^
`----
x NEXT_RSC_ERR_REACT_API: Component
,-[input.js:8:5]
8 | Component,
: ^^^^^^^^^
,-[input.js:7:1]
7 | import {
8 | Component,
: ^^^^^^^^^
9 | createFactory,
`----
x NEXT_RSC_ERR_REACT_API: createFactory
,-[input.js:9:5]
9 | createFactory,
: ^^^^^^^^^^^^^
`----
,-[input.js:8:1]
8 | Component,
9 | createFactory,
: ^^^^^^^^^^^^^
10 | PureComponent,
`----
x NEXT_RSC_ERR_REACT_API: PureComponent
,-[input.js:10:5]
10 | PureComponent,
: ^^^^^^^^^^^^^
,-[input.js:9:1]
9 | createFactory,
10 | PureComponent,
: ^^^^^^^^^^^^^
11 | useDeferredValue,
`----
x NEXT_RSC_ERR_REACT_API: useDeferredValue
,-[input.js:11:3]
11 | useDeferredValue,
: ^^^^^^^^^^^^^^^^
,-[input.js:10:1]
10 | PureComponent,
11 | useDeferredValue,
: ^^^^^^^^^^^^^^^^
12 | useInsertionEffect,
`----
x NEXT_RSC_ERR_REACT_API: useInsertionEffect
,-[input.js:12:5]
12 | useInsertionEffect,
: ^^^^^^^^^^^^^^^^^^
,-[input.js:11:1]
11 | useDeferredValue,
12 | useInsertionEffect,
: ^^^^^^^^^^^^^^^^^^
13 | useLayoutEffect,
`----
x NEXT_RSC_ERR_REACT_API: useLayoutEffect
,-[input.js:13:5]
13 | useLayoutEffect,
: ^^^^^^^^^^^^^^^
,-[input.js:12:1]
12 | useInsertionEffect,
13 | useLayoutEffect,
: ^^^^^^^^^^^^^^^
14 | useReducer,
`----
x NEXT_RSC_ERR_REACT_API: useReducer
,-[input.js:14:5]
14 | useReducer,
: ^^^^^^^^^^
,-[input.js:13:1]
13 | useLayoutEffect,
14 | useReducer,
: ^^^^^^^^^^
15 | useRef,
`----
x NEXT_RSC_ERR_REACT_API: useRef
,-[input.js:15:5]
15 | useRef,
: ^^^^^^
,-[input.js:14:1]
14 | useReducer,
15 | useRef,
: ^^^^^^
16 | useSyncExternalStore
`----
x NEXT_RSC_ERR_REACT_API: useSyncExternalStore
,-[input.js:16:5]
16 | useSyncExternalStore
: ^^^^^^^^^^^^^^^^^^^^
,-[input.js:15:1]
15 | useRef,
16 | useSyncExternalStore
: ^^^^^^^^^^^^^^^^^^^^
17 | } from "react"
`----

View file

@ -1,18 +1,24 @@
x NEXT_RSC_ERR_REACT_API: findDOMNode
,-[input.js:2:5]
2 | findDOMNode,
: ^^^^^^^^^^^
,-[input.js:1:1]
1 | import {
2 | findDOMNode,
: ^^^^^^^^^^^
3 | flushSync,
`----
x NEXT_RSC_ERR_REACT_API: flushSync
,-[input.js:3:3]
3 | flushSync,
: ^^^^^^^^^
,-[input.js:2:1]
2 | findDOMNode,
3 | flushSync,
: ^^^^^^^^^
4 | unstable_batchedUpdates,
`----
x NEXT_RSC_ERR_REACT_API: unstable_batchedUpdates
,-[input.js:4:3]
4 | unstable_batchedUpdates,
: ^^^^^^^^^^^^^^^^^^^^^^^
,-[input.js:3:1]
3 | flushSync,
4 | unstable_batchedUpdates,
: ^^^^^^^^^^^^^^^^^^^^^^^
5 | } from "react-dom"
`----

View file

@ -1,12 +1,14 @@
x NEXT_RSC_ERR_SERVER_IMPORT: react-dom/server
,-[input.js:9:1]
,-[input.js:8:1]
8 |
9 | import "react-dom/server"
: ^^^^^^^^^^^^^^^^^^^^^^^^^
`----
x NEXT_RSC_ERR_SERVER_IMPORT: react-dom/client
,-[input.js:11:1]
,-[input.js:10:1]
10 |
11 | import "react-dom/client"
: ^^^^^^^^^^^^^^^^^^^^^^^^^
`----

View file

@ -50,14 +50,14 @@ swc_core = { features = [
"ecma_transforms_typescript",
"ecma_utils",
"ecma_visit",
], version = "0.43.23" }
], version = "0.45.4" }
tracing = { version = "0.1.37", features = ["release_max_level_info"] }
tracing-futures = "0.2.5"
tracing-subscriber = "0.3.9"
tracing-chrome = "0.5.0"
next-dev = { git = "https://github.com/vercel/turbo.git", rev = "5c2b933ce142d70e9774e933e805734f2c09248c", features = ["serializable"] }
node-file-trace = { git = "https://github.com/vercel/turbo.git", rev = "5c2b933ce142d70e9774e933e805734f2c09248c", default-features = false, features = ["node-api"] }
mdxjs = { version = "0.1.1", features = ["serializable"] }
next-dev = { git = "https://github.com/vercel/turbo.git", rev = "cc024fa59f1c3ad253e74eefe86e0386455455d1", features = ["serializable"] }
node-file-trace = { git = "https://github.com/vercel/turbo.git", rev = "cc024fa59f1c3ad253e74eefe86e0386455455d1", default-features = false, features = ["node-api"] }
mdxjs = { version = "0.1.3", features = ["serializable"] }
# There are few build targets we can't use native-tls which default features rely on,
# allow to specify alternative (rustls) instead via features.
# Note to opt in rustls default-features should be disabled
@ -70,7 +70,6 @@ _sentry_rustls = { package = "sentry", version = "0.27.0", default-features = fa
"rustls",
"reqwest"
], optional = true }
indexmap = "=1.6.2"
[build-dependencies]
napi-build = "2"

View file

@ -31,7 +31,7 @@ wasm-bindgen-futures = "0.4.8"
getrandom = { version = "0.2.5", optional = true, default-features = false }
js-sys = "0.3.59"
serde-wasm-bindgen = "0.4.3"
mdxjs = { version = "0.1.1", features = ["serializable"] }
mdxjs = { version = "0.1.3", features = ["serializable"] }
swc_core = { features = [
"common_concurrent",
@ -46,7 +46,7 @@ swc_core = { features = [
"ecma_parser_typescript",
"ecma_utils",
"ecma_visit"
], version = "0.43.23" }
], version = "0.45.4" }
# Workaround a bug

View file

@ -142,9 +142,12 @@ exports[`ReactRefreshLogBox app syntax > runtime error 2`] = `
"./index.js
Error:
x Expected '}', got '<eof>'
,----
8 | export default function FunctionNamed() {
: ^
,-[5:1]
5 | i++
6 | throw Error('no ' + i)
7 | }, 1000)
8 | export default function FunctionNamed() {
: ^
\`----
Caused by:
@ -157,9 +160,12 @@ exports[`ReactRefreshLogBox app syntax > runtime error 3`] = `
"./index.js
Error:
x Expected '}', got '<eof>'
,----
8 | export default function FunctionNamed() {
: ^
,-[5:1]
5 | i++
6 | throw Error('no ' + i)
7 | }, 1000)
8 | export default function FunctionNamed() {
: ^
\`----
Caused by:
@ -172,15 +178,21 @@ exports[`ReactRefreshLogBox app unterminated JSX 1`] = `
"./index.js
Error:
x Unexpected token. Did you mean \`{'}'}\` or \`&rbrace;\`?
,----
8 | }
: ^
,-[5:1]
5 | <p>lol</p>
6 | div
7 | )
8 | }
: ^
9 |
\`----
x Unexpected eof
,----
9 |
: ^
,-[6:1]
6 | div
7 | )
8 | }
9 |
\`----
Caused by:

View file

@ -4,16 +4,25 @@ exports[`ReactRefreshLogBox _app syntax error shows logbox 1`] = `
"./pages/_app.js
Error:
x Expression expected
,----
3 | return <<Component {...pageProps} />;
: ^
,-[1:1]
1 |
2 | function MyApp({ Component, pageProps }) {
3 | return <<Component {...pageProps} />;
: ^
4 | }
5 | export default MyApp
6 |
\`----
x Unexpected token \`jsx name (Component)\`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint,
| string, regexp, \` for template literal, (, or an identifier
,----
3 | return <<Component {...pageProps} />;
: ^^^^^^^^^
x Expression expected
,-[1:1]
1 |
2 | function MyApp({ Component, pageProps }) {
3 | return <<Component {...pageProps} />;
: ^^^^^^^^^
4 | }
5 | export default MyApp
6 |
\`----
Caused by:
@ -25,9 +34,15 @@ exports[`ReactRefreshLogBox _document syntax error shows logbox 1`] = `
"./pages/_document.js
Error:
x Unexpected token \`{\`. Expected identifier, string literal, numeric literal or [ for the computed key
,----
4 | class MyDocument extends Document {{
: ^
,-[1:1]
1 |
2 | import Document, { Html, Head, Main, NextScript } from 'next/document'
3 |
4 | class MyDocument extends Document {{
: ^
5 | static async getInitialProps(ctx) {
6 | const initialProps = await Document.getInitialProps(ctx)
7 | return { ...initialProps }
\`----
Caused by:

View file

@ -142,9 +142,12 @@ exports[`ReactRefreshLogBox syntax > runtime error 2`] = `
"./index.js
Error:
x Expected '}', got '<eof>'
,----
8 | export default function FunctionNamed() {
: ^
,-[5:1]
5 | i++
6 | throw Error('no ' + i)
7 | }, 1000)
8 | export default function FunctionNamed() {
: ^
\`----
Caused by:
@ -157,9 +160,12 @@ exports[`ReactRefreshLogBox syntax > runtime error 3`] = `
"./index.js
Error:
x Expected '}', got '<eof>'
,----
8 | export default function FunctionNamed() {
: ^
,-[5:1]
5 | i++
6 | throw Error('no ' + i)
7 | }, 1000)
8 | export default function FunctionNamed() {
: ^
\`----
Caused by:
@ -172,15 +178,21 @@ exports[`ReactRefreshLogBox unterminated JSX 1`] = `
"./index.js
Error:
x Unexpected token. Did you mean \`{'}'}\` or \`&rbrace;\`?
,----
8 | }
: ^
,-[5:1]
5 | <p>lol</p>
6 | div
7 | )
8 | }
: ^
9 |
\`----
x Unexpected eof
,----
9 |
: ^
,-[6:1]
6 | div
7 | )
8 | }
9 |
\`----
Caused by: