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

Update swc #37009

Merged
merged 8 commits into from
May 19, 2022
Merged

Update swc #37009

merged 8 commits into from
May 19, 2022

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented May 18, 2022

This PR

  • updates swc crates to swc-project/swc@224a2ea

  • resolveshttps://github.com/vercel/next.js/discussions/30237?sort=new#discussioncomment-2759673

  • resolves https://github.com/vercel/next.js/discussions/30237?sort=new#discussioncomment-2780370

image

@ijjk
Copy link
Member

ijjk commented May 18, 2022

Failing test suites

Commit: 8b55154

yarn testheadless test/development/acceptance/ReactRefreshLogBox-app-doc.test.ts

  • ReactRefreshLogBox > _app syntax error shows logbox
  • ReactRefreshLogBox > _document syntax error shows logbox
Expand output

● ReactRefreshLogBox › _app syntax error shows logbox

expect(received).toMatchSnapshot()

Snapshot name: `ReactRefreshLogBox _app syntax error shows logbox 1`

- Snapshot  - 1
+ Received  + 2

@@ -13,6 +13,7 @@
     :          ^^^^^^^^^
     `----

  Caused by:
      0: failed to process input file
-     1: Syntax Error
+     1: Parser config: Es(EsConfig { jsx: true, fn_bind: false, decorators: false, decorators_before_export: false, export_default_from: false, import_assertions: true, private_in_object: false, allow_super_outside_method: false })
+     2: Syntax Error

  108 |     )
  109 |     expect(await session.hasRedbox(true)).toBe(true)
> 110 |     expect(await session.getRedboxSource()).toMatchSnapshot()
      |                                             ^
  111 |
  112 |     await session.patch(
  113 |       'pages/_app.js',

  at Object.<anonymous> (development/acceptance/ReactRefreshLogBox-app-doc.test.ts:110:45)

● ReactRefreshLogBox › _document syntax error shows logbox

expect(received).toMatchSnapshot()

Snapshot name: `ReactRefreshLogBox _document syntax error shows logbox 1`

- Snapshot  - 1
+ Received  + 2

@@ -6,6 +6,7 @@
     :                                    ^
     `----

  Caused by:
      0: failed to process input file
-     1: Syntax Error
+     1: Parser config: Es(EsConfig { jsx: true, fn_bind: false, decorators: false, decorators_before_export: false, export_default_from: false, import_assertions: true, private_in_object: false, allow_super_outside_method: false })
+     2: Syntax Error

  157 |     )
  158 |     expect(await session.hasRedbox(true)).toBe(true)
> 159 |     expect(await session.getRedboxSource()).toMatchSnapshot()
      |                                             ^
  160 |
  161 |     await session.patch(
  162 |       'pages/_document.js',

  at Object.<anonymous> (development/acceptance/ReactRefreshLogBox-app-doc.test.ts:159:45)

Read more about building and testing Next.js in contributing.md.

yarn testheadless test/integration/url-imports/test/index.test.js

  • Handle url imports > with next dev > should render the /ssg page
Expand output

● Handle url imports › with next dev › should render the /ssg page

expect(received).toMatch(expected)

Expected pattern: /Hello <!-- -->42<!-- -->\+<!-- -->42<!-- -->\+<!-- -->\/_next\/static\/media\/vercel\.[0-9a-f]{8}\.png<!-- -->\+<!-- -->\/_next\/static\/media\/vercel\.[0-9a-f]{8}\.png/
Received string:  "<!DOCTYPE html><html><head><style data-next-hide-fouc=\"true\">body{display:none}</style><noscript data-next-hide-fouc=\"true\"><style>body{display:block}</style></noscript><meta charSet=\"utf-8\"/><meta name=\"viewport\" content=\"width=device-width\"/><meta name=\"next-head-count\" content=\"2\"/><noscript data-n-css=\"\"></noscript><script defer=\"\" nomodule=\"\" src=\"/_next/static/chunks/polyfills.js?ts=1652938389733\"></script><script src=\"/_next/static/chunks/webpack.js?ts=1652938389733\" defer=\"\"></script><script src=\"/_next/static/chunks/main.js?ts=1652938389733\" defer=\"\"></script><script src=\"/_next/static/chunks/pages/_app.js?ts=1652938389733\" defer=\"\"></script><script src=\"/_next/static/chunks/pages/_error.js?ts=1652938389733\" defer=\"\"></script><script src=\"/_next/static/development/_buildManifest.js?ts=1652938389733\" defer=\"\"></script><script src=\"/_next/static/development/_ssgManifest.js?ts=1652938389733\" defer=\"\"></script><script src=\"/_next/static/development/_middlewareManifest.js?ts=1652938389733\" defer=\"\"></script><noscript id=\"__next_css__DO_NOT_USE__\"></noscript></head><body><div id=\"__next\"></div><script src=\"/_next/static/chunks/react-refresh.js?ts=1652938389733\"></script><script id=\"__NEXT_DATA__\" type=\"application/json\">{\"props\":{\"pageProps\":{\"statusCode\":500}},\"page\":\"/_error\",\"query\":{\"__NEXT_PAGE\":\"/ssg\"},\"buildId\":\"development\",\"isFallback\":false,\"err\":{\"name\":\"Error\",\"message\":\"Cannot find module '/home/runner/work/next.js/next.js/test/integration/url-imports/.next/server/pages/ssg.js'\\nRequire stack:\\n- /home/runner/work/next.js/next.js/packages/next/dist/server/require.js\\n- /home/runner/work/next.js/next.js/packages/next/dist/server/next-server.js\\n- /home/runner/work/next.js/next.js/packages/next/dist/server/next.js\\n- /home/runner/work/next.js/next.js/packages/next/dist/server/lib/start-server.js\\n- /home/runner/work/next.js/next.js/packages/next/dist/cli/next-dev.js\\n- /home/runner/work/next.js/next.js/packages/next/dist/bin/next\",\"stack\":\"Error: Cannot find module '/home/runner/work/next.js/next.js/test/integration/url-imports/.next/server/pages/ssg.js'\\nRequire stack:\\n- /home/runner/work/next.js/next.js/packages/next/dist/server/require.js\\n- /home/runner/work/next.js/next.js/packages/next/dist/server/next-server.js\\n- /home/runner/work/next.js/next.js/packages/next/dist/server/next.js\\n- /home/runner/work/next.js/next.js/packages/next/dist/server/lib/start-server.js\\n- /home/runner/work/next.js/next.js/packages/next/dist/cli/next-dev.js\\n- /home/runner/work/next.js/next.js/packages/next/dist/bin/next\\n    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)\\n    at Function.mod._resolveFilename (/home/runner/work/next.js/next.js/test/lib/mocks-require-hook.js:23:26)\\n    at Function.mod._resolveFilename (/home/runner/work/next.js/next.js/packages/next/dist/build/webpack/require-hook.js:183:28)\\n    at Function.Module._load (node:internal/modules/cjs/loader:778:27)\\n    at Module.require (node:internal/modules/cjs/loader:1005:19)\\n    at require (node:internal/modules/cjs/helpers:102:18)\\n    at Object.requirePage (/home/runner/work/next.js/next.js/packages/next/dist/server/require.js:65:12)\\n    at /home/runner/work/next.js/next.js/packages/next/dist/server/load-components.js:61:50\\n    at runMicrotasks (\\u003canonymous\\u003e)\\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\"},\"gip\":true,\"scriptLoader\":[]}</script></body></html>"

  65 |         it(`should render the ${page} page`, async () => {
  66 |           const html = await renderViaHTTP(appPort, page)
> 67 |           expect(html).toMatch(expectedServer)
     |                        ^
  68 |         })
  69 |
  70 |         it(`should client-render the ${page} page`, async () => {

  at Object.<anonymous> (integration/url-imports/test/index.test.js:67:24)

Read more about building and testing Next.js in contributing.md.

@ijjk
Copy link
Member

ijjk commented May 18, 2022

Stats from current PR

Default Build (Decrease detected ✓)
General
vercel/next.js canary kdy1/next.js swc-up-2 Change
buildDuration 15s 15.1s ⚠️ +128ms
buildDurationCached 6.1s 6.1s ⚠️ +18ms
nodeModulesSize 479 MB 479 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary kdy1/next.js swc-up-2 Change
/ failed reqs 0 0
/ total time (seconds) 3.766 3.797 ⚠️ +0.03
/ avg req/sec 663.79 658.45 ⚠️ -5.34
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.247 1.313 ⚠️ +0.07
/error-in-render avg req/sec 2005.51 1904.3 ⚠️ -101.21
Client Bundles (main, webpack)
vercel/next.js canary kdy1/next.js swc-up-2 Change
925.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42 kB 42 kB
main-HASH.js gzip 29 kB 29 kB
webpack-HASH.js gzip 1.44 kB 1.44 kB
Overall change 72.6 kB 72.6 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary kdy1/next.js swc-up-2 Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary kdy1/next.js swc-up-2 Change
_app-HASH.js gzip 1.36 kB 1.36 kB
_error-HASH.js gzip 193 B 193 B
amp-HASH.js gzip 308 B 308 B
css-HASH.js gzip 327 B 327 B
dynamic-HASH.js gzip 2.71 kB 2.71 kB
head-HASH.js gzip 359 B 359 B
hooks-HASH.js gzip 920 B 920 B
image-HASH.js gzip 5.73 kB 5.73 kB
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 2.65 kB 2.65 kB
routerDirect..HASH.js gzip 320 B 320 B
script-HASH.js gzip 391 B 391 B
withRouter-HASH.js gzip 318 B 318 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 16 kB 16 kB
Client Build Manifests
vercel/next.js canary kdy1/next.js swc-up-2 Change
_buildManifest.js gzip 458 B 458 B
Overall change 458 B 458 B
Rendered Page Sizes
vercel/next.js canary kdy1/next.js swc-up-2 Change
index.html gzip 532 B 532 B
link.html gzip 546 B 546 B
withRouter.html gzip 527 B 527 B
Overall change 1.6 kB 1.6 kB

Default Build with SWC (Decrease detected ✓)
General
vercel/next.js canary kdy1/next.js swc-up-2 Change
buildDuration 17.5s 17.2s -221ms
buildDurationCached 6.3s 6s -280ms
nodeModulesSize 479 MB 479 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary kdy1/next.js swc-up-2 Change
/ failed reqs 0 0
/ total time (seconds) 3.642 3.769 ⚠️ +0.13
/ avg req/sec 686.36 663.33 ⚠️ -23.03
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.267 1.285 ⚠️ +0.02
/error-in-render avg req/sec 1973.2 1945.35 ⚠️ -27.85
Client Bundles (main, webpack)
vercel/next.js canary kdy1/next.js swc-up-2 Change
925.HASH.js gzip 178 B 178 B
framework-HASH.js gzip 42.7 kB 42.7 kB
main-HASH.js gzip 29.5 kB 29.5 kB
webpack-HASH.js gzip 1.45 kB 1.45 kB
Overall change 73.8 kB 73.8 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary kdy1/next.js swc-up-2 Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary kdy1/next.js swc-up-2 Change
_app-HASH.js gzip 1.35 kB 1.35 kB
_error-HASH.js gzip 179 B 179 B
amp-HASH.js gzip 311 B 311 B
css-HASH.js gzip 324 B 324 B
dynamic-HASH.js gzip 2.89 kB 2.89 kB
head-HASH.js gzip 357 B 357 B
hooks-HASH.js gzip 920 B 920 B
image-HASH.js gzip 5.82 kB 5.82 kB
index-HASH.js gzip 261 B 261 B
link-HASH.js gzip 2.78 kB 2.78 kB
routerDirect..HASH.js gzip 322 B 322 B
script-HASH.js gzip 392 B 392 B
withRouter-HASH.js gzip 317 B 317 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 16.3 kB 16.3 kB
Client Build Manifests
vercel/next.js canary kdy1/next.js swc-up-2 Change
_buildManifest.js gzip 457 B 457 B
Overall change 457 B 457 B
Rendered Page Sizes
vercel/next.js canary kdy1/next.js swc-up-2 Change
index.html gzip 532 B 532 B
link.html gzip 546 B 546 B
withRouter.html gzip 528 B 528 B
Overall change 1.61 kB 1.61 kB
Commit: 3f0e4e3

@kdy1 kdy1 marked this pull request as draft May 19, 2022 04:48
@kdy1 kdy1 marked this pull request as ready for review May 19, 2022 05:15
@kdy1 kdy1 requested a review from Brooooooklyn May 19, 2022 05:15
Brooooooklyn
Brooooooklyn previously approved these changes May 19, 2022
@kodiakhq kodiakhq bot merged commit 9732463 into vercel:canary May 19, 2022
@PupoSDC
Copy link

PupoSDC commented May 20, 2022

@kdy1 Just wanted to confirm that the newest canary indeed fixed all my issues. Thanks a lot! 🤗

@kdy1 kdy1 deleted the swc-up-2 branch May 20, 2022 08:03
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants