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

fix(next): resolve absolute path to @babel/runtime #18921

Merged
merged 7 commits into from Nov 11, 2020

Conversation

merceyz
Copy link
Contributor

@merceyz merceyz commented Nov 7, 2020

What's the problem this PR addresses?

#18768 started to ncc @babel/plugin-transform-runtime which broke its Yarn PnP support since the version of resolve it uses can't be patched by Yarn.

Fixes https://github.com/yarnpkg/berry/runs/1359235077?check_suite_focus=true#step:5:79

cc @guybedford

How did you fix it?

Resolve the absolute path to @babel/runtime so it doesn't have to go through resolve


Fixes #19026

@ijjk
Copy link
Member

ijjk commented Nov 7, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
buildDuration 13.7s 13.7s ⚠️ +72ms
nodeModulesSize 84.9 MB 84.9 MB ⚠️ +76 B
Page Load Tests Overall increase ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
/ failed reqs 0 0
/ total time (seconds) 2.583 2.595 ⚠️ +0.01
/ avg req/sec 967.99 963.51 ⚠️ -4.48
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.637 1.584 -0.05
/error-in-render avg req/sec 1526.75 1578.48 +51.73
Client Bundles (main, webpack, commons)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-d942eb5..343f.js gzip 7.4 kB 7.4 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.4 kB 58.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-34e64ff..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_buildManifest.js gzip 322 B 321 B -1 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 651 B -1 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
index.html gzip 1 kB 999 B -2 B
link.html gzip 1.01 kB 1.01 kB -2 B
withRouter.html gzip 995 B 993 B -2 B
Overall change 3.01 kB 3 kB -6 B

Diffs

Diff for _buildManifest.js
@@ -2,12 +2,12 @@ self.__BUILD_MANIFEST = {
   __rewrites: [],
   "/": ["static\u002Fchunks\u002Fpages\u002Findex-283eed3c1520dcc26e8d.js"],
   "/_error": [
-    "static\u002Fchunks\u002Fpages\u002F_error-9b57cae5694a39479222.js"
+    "static\u002Fchunks\u002Fpages\u002F_error-760f653e71e48010adf7.js"
   ],
   "/hooks": [
-    "static\u002Fchunks\u002Fpages\u002Fhooks-bdd2cad07648acf22380.js"
+    "static\u002Fchunks\u002Fpages\u002Fhooks-880757f1d73d6b241fc3.js"
   ],
-  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-fcaf825022c62b02057c.js"],
+  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-3125d338b922d5ab1776.js"],
   "/routerDirect": [
     "static\u002Fchunks\u002Fpages\u002FrouterDirect-2e9bfd441bd88cd3382e.js"
   ],
Diff for _buildManifest.module.js
@@ -4,7 +4,7 @@ self.__BUILD_MANIFEST = {
     "static\u002Fchunks\u002Fpages\u002Findex-dc79232991b9d18c3260.module.js"
   ],
   "/_error": [
-    "static\u002Fchunks\u002Fpages\u002F_error-714d7bb4196263406c6e.module.js"
+    "static\u002Fchunks\u002Fpages\u002F_error-b59ce1d1aef722bdb502.module.js"
   ],
   "/hooks": [
     "static\u002Fchunks\u002Fpages\u002Fhooks-56fa58a6f0993d7d36d7.module.js"
Diff for index.html
@@ -85,7 +85,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-33a267df08fa8c5852a0.js"
+      src="/_next/static/chunks/main-e2ee97cbd323a481a27d.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -121,7 +121,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -133,7 +133,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
Diff for link.html
@@ -90,7 +90,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-33a267df08fa8c5852a0.js"
+      src="/_next/static/chunks/main-e2ee97cbd323a481a27d.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -126,7 +126,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -138,7 +138,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -150,7 +150,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/link-fcaf825022c62b02057c.js"
+      src="/_next/static/chunks/pages/link-3125d338b922d5ab1776.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
Diff for withRouter.html
@@ -85,7 +85,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-33a267df08fa8c5852a0.js"
+      src="/_next/static/chunks/main-e2ee97cbd323a481a27d.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -121,7 +121,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -133,7 +133,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""

Serverless Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
buildDuration 15.6s 15.6s ⚠️ +64ms
nodeModulesSize 84.9 MB 84.9 MB ⚠️ +76 B
Client Bundles (main, webpack, commons)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..7d3b.js gzip 11.3 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-d942eb5..343f.js gzip 7.4 kB N/A N/A
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..5283.js gzip N/A 11.3 kB N/A
main-ea56374..0cae.js gzip N/A 7.4 kB N/A
Overall change 58.4 kB 58.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-34e64ff..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-7231d4b..5856.js gzip 1.28 kB N/A N/A
_error-fca3d..2eb1.js gzip 3.44 kB N/A N/A
hooks-d4591d..e7c2.js gzip 887 B N/A N/A
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB N/A N/A
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
_app-3b0cf13..85f8.js gzip N/A 1.28 kB N/A
_error-6f635..c393.js gzip N/A 3.44 kB N/A
hooks-d4ffc3..9e0f.js gzip N/A 887 B N/A
link-0abe79e..7616.js gzip N/A 1.55 kB N/A
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB N/A N/A
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
_error-f2fcc..dule.js gzip N/A 2.29 kB N/A
Overall change 5.59 kB 5.59 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_buildManifest.js gzip 322 B 321 B -1 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 651 B -1 B
Serverless bundles
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_error.js 915 kB 915 kB
404.html 4.73 kB 4.73 kB
hooks.html 3.92 kB 3.92 kB
index.js 915 kB 915 kB
link.js 964 kB 964 kB
routerDirect.js 957 kB 957 kB
withRouter.js 957 kB 957 kB
Overall change 4.72 MB 4.72 MB
Commit: 32637b4

@ijjk
Copy link
Member

ijjk commented Nov 7, 2020

Failing test suites

Commit: 32637b4

test/unit/next-babel.test.js

  • next/babel > jsx-pragma > should transform JSX to use a local identifier in CommonJS mode
Expand output

● next/babel › jsx-pragma › should transform JSX to use a local identifier in CommonJS mode

expect(received).toMatchInlineSnapshot(snapshot)

Snapshot name: `next/babel jsx-pragma should transform JSX to use a local identifier in CommonJS mode 1`

Snapshot: "\"use strict\";var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");var _react=_interopRequireDefault(require(\"react\"));var __jsx=_react[\"default\"].createElement;var a=function a(){return __jsx(\"a\",{href:\"/\"},\"home\");};"
Received: "\"use strict\";var _interopRequireDefault=require(\"/home/runner/work/next.js/next.js/packages/next/node_modules/@babel/runtime/helpers/interopRequireDefault\");var _react=_interopRequireDefault(require(\"react\"));var __jsx=_react[\"default\"].createElement;var a=function a(){return __jsx(\"a\",{href:\"/\"},\"home\");};"

  65 |       expect(output).toMatch(`__jsx("a",{href:"/"`)
  66 | 
> 67 |       expect(babel(`const a = ()=><a href="/">home</a>`)).toMatchInlineSnapshot(
     |                                                           ^
  68 |         `"\\"use strict\\";var _interopRequireDefault=require(\\"@babel/runtime/helpers/interopRequireDefault\\");var _react=_interopRequireDefault(require(\\"react\\"));var __jsx=_react[\\"default\\"].createElement;var a=function a(){return __jsx(\\"a\\",{href:\\"/\\"},\\"home\\");};"`
  69 |       )
  70 |     })

  at Object.<anonymous> (unit/next-babel.test.js:67:59)

@ijjk
Copy link
Member

ijjk commented Nov 7, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
buildDuration 13.8s 13.4s -396ms
nodeModulesSize 84.9 MB 84.9 MB ⚠️ +76 B
Page Load Tests Overall increase ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
/ failed reqs 0 0
/ total time (seconds) 2.52 2.43 -0.09
/ avg req/sec 991.97 1029.02 +37.05
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.358 1.3 -0.06
/error-in-render avg req/sec 1840.38 1923.22 +82.84
Client Bundles (main, webpack, commons)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-d942eb5..343f.js gzip 7.4 kB 7.4 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.4 kB 58.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-34e64ff..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_buildManifest.js gzip 322 B 321 B -1 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 651 B -1 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
index.html gzip 1 kB 999 B -2 B
link.html gzip 1.01 kB 1.01 kB -2 B
withRouter.html gzip 995 B 993 B -2 B
Overall change 3.01 kB 3 kB -6 B

Diffs

Diff for _buildManifest.js
@@ -2,12 +2,12 @@ self.__BUILD_MANIFEST = {
   __rewrites: [],
   "/": ["static\u002Fchunks\u002Fpages\u002Findex-283eed3c1520dcc26e8d.js"],
   "/_error": [
-    "static\u002Fchunks\u002Fpages\u002F_error-9b57cae5694a39479222.js"
+    "static\u002Fchunks\u002Fpages\u002F_error-760f653e71e48010adf7.js"
   ],
   "/hooks": [
-    "static\u002Fchunks\u002Fpages\u002Fhooks-bdd2cad07648acf22380.js"
+    "static\u002Fchunks\u002Fpages\u002Fhooks-880757f1d73d6b241fc3.js"
   ],
-  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-fcaf825022c62b02057c.js"],
+  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-3125d338b922d5ab1776.js"],
   "/routerDirect": [
     "static\u002Fchunks\u002Fpages\u002FrouterDirect-2e9bfd441bd88cd3382e.js"
   ],
Diff for _buildManifest.module.js
@@ -4,7 +4,7 @@ self.__BUILD_MANIFEST = {
     "static\u002Fchunks\u002Fpages\u002Findex-dc79232991b9d18c3260.module.js"
   ],
   "/_error": [
-    "static\u002Fchunks\u002Fpages\u002F_error-714d7bb4196263406c6e.module.js"
+    "static\u002Fchunks\u002Fpages\u002F_error-b59ce1d1aef722bdb502.module.js"
   ],
   "/hooks": [
     "static\u002Fchunks\u002Fpages\u002Fhooks-56fa58a6f0993d7d36d7.module.js"
Diff for index.html
@@ -85,7 +85,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-33a267df08fa8c5852a0.js"
+      src="/_next/static/chunks/main-e2ee97cbd323a481a27d.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -121,7 +121,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -133,7 +133,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
Diff for link.html
@@ -90,7 +90,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-33a267df08fa8c5852a0.js"
+      src="/_next/static/chunks/main-e2ee97cbd323a481a27d.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -126,7 +126,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -138,7 +138,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -150,7 +150,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/link-fcaf825022c62b02057c.js"
+      src="/_next/static/chunks/pages/link-3125d338b922d5ab1776.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
Diff for withRouter.html
@@ -85,7 +85,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-33a267df08fa8c5852a0.js"
+      src="/_next/static/chunks/main-e2ee97cbd323a481a27d.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -121,7 +121,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -133,7 +133,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""

Serverless Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
buildDuration 15.4s 15.2s -251ms
nodeModulesSize 84.9 MB 84.9 MB ⚠️ +76 B
Client Bundles (main, webpack, commons)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..7d3b.js gzip 11.3 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-d942eb5..343f.js gzip 7.4 kB N/A N/A
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..5283.js gzip N/A 11.3 kB N/A
main-ea56374..0cae.js gzip N/A 7.4 kB N/A
Overall change 58.4 kB 58.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-34e64ff..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-7231d4b..5856.js gzip 1.28 kB N/A N/A
_error-fca3d..2eb1.js gzip 3.44 kB N/A N/A
hooks-d4591d..e7c2.js gzip 887 B N/A N/A
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB N/A N/A
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
_app-3b0cf13..85f8.js gzip N/A 1.28 kB N/A
_error-6f635..c393.js gzip N/A 3.44 kB N/A
hooks-d4ffc3..9e0f.js gzip N/A 887 B N/A
link-0abe79e..7616.js gzip N/A 1.55 kB N/A
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB N/A N/A
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
_error-f2fcc..dule.js gzip N/A 2.29 kB N/A
Overall change 5.59 kB 5.59 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_buildManifest.js gzip 322 B 321 B -1 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 651 B -1 B
Serverless bundles
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_error.js 915 kB 915 kB
404.html 4.73 kB 4.73 kB
hooks.html 3.92 kB 3.92 kB
index.js 915 kB 915 kB
link.js 964 kB 964 kB
routerDirect.js 957 kB 957 kB
withRouter.js 957 kB 957 kB
Overall change 4.72 MB 4.72 MB
Commit: 53ebc8b

@ijjk
Copy link
Member

ijjk commented Nov 7, 2020

Failing test suites

Commit: 53ebc8b

test/unit/next-babel.test.js

  • next/babel > jsx-pragma > should transform JSX to use a local identifier in CommonJS mode
Expand output

● next/babel › jsx-pragma › should transform JSX to use a local identifier in CommonJS mode

expect(received).toMatch(expected)

Expected substring: "var _react=_interopRequireDefault(require(\\\"react\\\"));var __jsx=_react[\\\"default\\\"].createElement;var a=function a(){return __jsx(\\\"a\\\",{href:\\\"/\\\"},\\\"home\\\");};\""
Received string:    "\"use strict\";var _interopRequireDefault=require(\"/home/runner/work/next.js/next.js/packages/next/node_modules/@babel/runtime/helpers/interopRequireDefault\");var _react=_interopRequireDefault(require(\"react\"));var __jsx=_react[\"default\"].createElement;var a=function a(){return __jsx(\"a\",{href:\"/\"},\"home\");};"

  65 |       expect(output).toMatch(`__jsx("a",{href:"/"`)
  66 | 
> 67 |       expect(babel(`const a = ()=><a href="/">home</a>`)).toMatch(
     |                                                           ^
  68 |         `var _react=_interopRequireDefault(require(\\"react\\"));var __jsx=_react[\\"default\\"].createElement;var a=function a(){return __jsx(\\"a\\",{href:\\"/\\"},\\"home\\");};"`
  69 |       )
  70 |     })

  at Object.<anonymous> (unit/next-babel.test.js:67:59)

@ijjk
Copy link
Member

ijjk commented Nov 7, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
buildDuration 11.6s 11.7s ⚠️ +115ms
nodeModulesSize 84.9 MB 84.9 MB ⚠️ +76 B
Page Load Tests Overall increase ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
/ failed reqs 0 0
/ total time (seconds) 2.196 2.165 -0.03
/ avg req/sec 1138.56 1154.9 +16.34
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.223 1.176 -0.05
/error-in-render avg req/sec 2044.73 2125.45 +80.72
Client Bundles (main, webpack, commons)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-d942eb5..343f.js gzip 7.4 kB 7.4 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.4 kB 58.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-34e64ff..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_buildManifest.js gzip 322 B 321 B -1 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 651 B -1 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
index.html gzip 1 kB 999 B -2 B
link.html gzip 1.01 kB 1.01 kB -2 B
withRouter.html gzip 995 B 993 B -2 B
Overall change 3.01 kB 3 kB -6 B

Diffs

Diff for _buildManifest.js
@@ -2,12 +2,12 @@ self.__BUILD_MANIFEST = {
   __rewrites: [],
   "/": ["static\u002Fchunks\u002Fpages\u002Findex-283eed3c1520dcc26e8d.js"],
   "/_error": [
-    "static\u002Fchunks\u002Fpages\u002F_error-9b57cae5694a39479222.js"
+    "static\u002Fchunks\u002Fpages\u002F_error-760f653e71e48010adf7.js"
   ],
   "/hooks": [
-    "static\u002Fchunks\u002Fpages\u002Fhooks-bdd2cad07648acf22380.js"
+    "static\u002Fchunks\u002Fpages\u002Fhooks-880757f1d73d6b241fc3.js"
   ],
-  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-fcaf825022c62b02057c.js"],
+  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-3125d338b922d5ab1776.js"],
   "/routerDirect": [
     "static\u002Fchunks\u002Fpages\u002FrouterDirect-2e9bfd441bd88cd3382e.js"
   ],
Diff for _buildManifest.module.js
@@ -4,7 +4,7 @@ self.__BUILD_MANIFEST = {
     "static\u002Fchunks\u002Fpages\u002Findex-dc79232991b9d18c3260.module.js"
   ],
   "/_error": [
-    "static\u002Fchunks\u002Fpages\u002F_error-714d7bb4196263406c6e.module.js"
+    "static\u002Fchunks\u002Fpages\u002F_error-b59ce1d1aef722bdb502.module.js"
   ],
   "/hooks": [
     "static\u002Fchunks\u002Fpages\u002Fhooks-56fa58a6f0993d7d36d7.module.js"
Diff for index.html
@@ -85,7 +85,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-33a267df08fa8c5852a0.js"
+      src="/_next/static/chunks/main-e2ee97cbd323a481a27d.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -121,7 +121,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -133,7 +133,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
Diff for link.html
@@ -90,7 +90,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-33a267df08fa8c5852a0.js"
+      src="/_next/static/chunks/main-e2ee97cbd323a481a27d.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -126,7 +126,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -138,7 +138,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -150,7 +150,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/link-fcaf825022c62b02057c.js"
+      src="/_next/static/chunks/pages/link-3125d338b922d5ab1776.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
Diff for withRouter.html
@@ -85,7 +85,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-33a267df08fa8c5852a0.js"
+      src="/_next/static/chunks/main-e2ee97cbd323a481a27d.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -121,7 +121,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -133,7 +133,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""

Serverless Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
buildDuration 13.1s 13.4s ⚠️ +263ms
nodeModulesSize 84.9 MB 84.9 MB ⚠️ +76 B
Client Bundles (main, webpack, commons)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..7d3b.js gzip 11.3 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-d942eb5..343f.js gzip 7.4 kB N/A N/A
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..5283.js gzip N/A 11.3 kB N/A
main-ea56374..0cae.js gzip N/A 7.4 kB N/A
Overall change 58.4 kB 58.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-34e64ff..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-7231d4b..5856.js gzip 1.28 kB N/A N/A
_error-fca3d..2eb1.js gzip 3.44 kB N/A N/A
hooks-d4591d..e7c2.js gzip 887 B N/A N/A
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB N/A N/A
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
_app-3b0cf13..85f8.js gzip N/A 1.28 kB N/A
_error-6f635..c393.js gzip N/A 3.44 kB N/A
hooks-d4ffc3..9e0f.js gzip N/A 887 B N/A
link-0abe79e..7616.js gzip N/A 1.55 kB N/A
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB N/A N/A
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
_error-f2fcc..dule.js gzip N/A 2.29 kB N/A
Overall change 5.59 kB 5.59 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_buildManifest.js gzip 322 B 321 B -1 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 651 B -1 B
Serverless bundles
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_error.js 915 kB 915 kB
404.html 4.73 kB 4.73 kB
hooks.html 3.92 kB 3.92 kB
index.js 915 kB 915 kB
link.js 964 kB 964 kB
routerDirect.js 957 kB 957 kB
withRouter.js 957 kB 957 kB
Overall change 4.72 MB 4.72 MB
Commit: 8cda33a

@ijjk
Copy link
Member

ijjk commented Nov 7, 2020

Failing test suites

Commit: 8cda33a

test/unit/next-babel.test.js

  • next/babel > jsx-pragma > should transform JSX to use a local identifier in CommonJS mode
Expand output

● next/babel › jsx-pragma › should transform JSX to use a local identifier in CommonJS mode

expect(received).toMatch(expected)

Expected substring: "var _react=_interopRequireDefault(require(\"react\"));var __jsx=_react[\"default\"].createElement;var a=function a(){return __jsx(\"a\",{href:\"/\"},\"home\");};\""
Received string:    "\"use strict\";var _interopRequireDefault=require(\"/home/runner/work/next.js/next.js/packages/next/node_modules/@babel/runtime/helpers/interopRequireDefault\");var _react=_interopRequireDefault(require(\"react\"));var __jsx=_react[\"default\"].createElement;var a=function a(){return __jsx(\"a\",{href:\"/\"},\"home\");};"

  65 |       expect(output).toMatch(`__jsx("a",{href:"/"`)
  66 | 
> 67 |       expect(babel(`const a = ()=><a href="/">home</a>`)).toMatch(
     |                                                           ^
  68 |         `var _react=_interopRequireDefault(require("react"));var __jsx=_react["default"].createElement;var a=function a(){return __jsx("a",{href:"/"},"home");};"`
  69 |       )
  70 |     })

  at Object.<anonymous> (unit/next-babel.test.js:67:59)

@ijjk
Copy link
Member

ijjk commented Nov 7, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
buildDuration 11.3s 11.1s -259ms
nodeModulesSize 84.9 MB 84.9 MB ⚠️ +76 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
/ failed reqs 0 0
/ total time (seconds) 2.155 2.154 0
/ avg req/sec 1160.2 1160.84 +0.64
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.195 1.201 ⚠️ +0.01
/error-in-render avg req/sec 2092.36 2082.24 ⚠️ -10.12
Client Bundles (main, webpack, commons)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-d942eb5..343f.js gzip 7.4 kB 7.4 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.4 kB 58.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-34e64ff..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_buildManifest.js gzip 322 B 321 B -1 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 651 B -1 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
index.html gzip 1 kB 999 B -2 B
link.html gzip 1.01 kB 1.01 kB -2 B
withRouter.html gzip 995 B 993 B -2 B
Overall change 3.01 kB 3 kB -6 B

Diffs

Diff for _buildManifest.js
@@ -2,12 +2,12 @@ self.__BUILD_MANIFEST = {
   __rewrites: [],
   "/": ["static\u002Fchunks\u002Fpages\u002Findex-283eed3c1520dcc26e8d.js"],
   "/_error": [
-    "static\u002Fchunks\u002Fpages\u002F_error-9b57cae5694a39479222.js"
+    "static\u002Fchunks\u002Fpages\u002F_error-760f653e71e48010adf7.js"
   ],
   "/hooks": [
-    "static\u002Fchunks\u002Fpages\u002Fhooks-bdd2cad07648acf22380.js"
+    "static\u002Fchunks\u002Fpages\u002Fhooks-880757f1d73d6b241fc3.js"
   ],
-  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-fcaf825022c62b02057c.js"],
+  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-3125d338b922d5ab1776.js"],
   "/routerDirect": [
     "static\u002Fchunks\u002Fpages\u002FrouterDirect-2e9bfd441bd88cd3382e.js"
   ],
Diff for _buildManifest.module.js
@@ -4,7 +4,7 @@ self.__BUILD_MANIFEST = {
     "static\u002Fchunks\u002Fpages\u002Findex-dc79232991b9d18c3260.module.js"
   ],
   "/_error": [
-    "static\u002Fchunks\u002Fpages\u002F_error-714d7bb4196263406c6e.module.js"
+    "static\u002Fchunks\u002Fpages\u002F_error-b59ce1d1aef722bdb502.module.js"
   ],
   "/hooks": [
     "static\u002Fchunks\u002Fpages\u002Fhooks-56fa58a6f0993d7d36d7.module.js"
Diff for index.html
@@ -85,7 +85,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-33a267df08fa8c5852a0.js"
+      src="/_next/static/chunks/main-e2ee97cbd323a481a27d.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -121,7 +121,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -133,7 +133,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
Diff for link.html
@@ -90,7 +90,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-33a267df08fa8c5852a0.js"
+      src="/_next/static/chunks/main-e2ee97cbd323a481a27d.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -126,7 +126,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -138,7 +138,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -150,7 +150,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/link-fcaf825022c62b02057c.js"
+      src="/_next/static/chunks/pages/link-3125d338b922d5ab1776.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
Diff for withRouter.html
@@ -85,7 +85,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-33a267df08fa8c5852a0.js"
+      src="/_next/static/chunks/main-e2ee97cbd323a481a27d.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -121,7 +121,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -133,7 +133,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""

Serverless Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
buildDuration 12.6s 12.9s ⚠️ +328ms
nodeModulesSize 84.9 MB 84.9 MB ⚠️ +76 B
Client Bundles (main, webpack, commons)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..7d3b.js gzip 11.3 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-d942eb5..343f.js gzip 7.4 kB N/A N/A
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..5283.js gzip N/A 11.3 kB N/A
main-ea56374..0cae.js gzip N/A 7.4 kB N/A
Overall change 58.4 kB 58.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-34e64ff..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-7231d4b..5856.js gzip 1.28 kB N/A N/A
_error-fca3d..2eb1.js gzip 3.44 kB N/A N/A
hooks-d4591d..e7c2.js gzip 887 B N/A N/A
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB N/A N/A
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
_app-3b0cf13..85f8.js gzip N/A 1.28 kB N/A
_error-6f635..c393.js gzip N/A 3.44 kB N/A
hooks-d4ffc3..9e0f.js gzip N/A 887 B N/A
link-0abe79e..7616.js gzip N/A 1.55 kB N/A
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB N/A N/A
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
_error-f2fcc..dule.js gzip N/A 2.29 kB N/A
Overall change 5.59 kB 5.59 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_buildManifest.js gzip 322 B 321 B -1 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 651 B -1 B
Serverless bundles
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_error.js 915 kB 915 kB
404.html 4.73 kB 4.73 kB
hooks.html 3.92 kB 3.92 kB
index.js 915 kB 915 kB
link.js 964 kB 964 kB
routerDirect.js 957 kB 957 kB
withRouter.js 957 kB 957 kB
Overall change 4.72 MB 4.72 MB
Commit: 12d3d66

Copy link
Contributor

@guybedford guybedford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach may in theory be breaking since the require.resolve being called here is effectively the one in the Babel preset build which might be different to the runtime require resolve.

Are you sure Webpack is leaving this unmodified? Would it work to replace this with eval('require').resolve perhaps to ensure it is the runtime require?

Otherwise there does still seem to be some risk here that because it's a different resolve it might resolve a different runtime or not find the runtime.

I haven't fully understood the paths at play here, so if I'm wrong and missing something please let me know.

@guybedford
Copy link
Contributor

Also I was under the impression Babel runtime outputs a native import '@babel/runtime' import as well? So perhaps this is the wrong place to fix this?

@merceyz
Copy link
Contributor Author

merceyz commented Nov 7, 2020

This approach may in theory be breaking since the require.resolve being called here is effectively the one in the Babel preset build which might be different to the runtime require resolve.

The end result is the same, the path is just resolved up front instead of having @babel/plugin-transform-runtime do it from the path we give it.

Are you sure Webpack is leaving this unmodified? Would it work to replace this with eval('require').resolve perhaps to ensure it is the runtime require?

As far as I can tell this doesn't go through webpack

Also I was under the impression Babel runtime outputs a native import '@babel/runtime' import as well?

Correct, unless you specify absoluteRuntime which makes it use absolute paths https://babeljs.io/docs/en/babel-plugin-transform-runtime#absoluteruntime

@guybedford
Copy link
Contributor

The end result is the same, the path is just resolved up front instead of having @babel/plugin-transform-runtime do it from the path we give it.

The thing is aren't we doing the resolutions at different times in the workflow? Currently it is happening at the time the module is built / run / processed (to be honest I'm not quite sure when that is), while this would change the resolution time to being when the module is transformed.

As far as I can tell this doesn't go through webpack

I'm pretty sure ncc would be processing this require.resolve statement, and might even be inlining the assets?

Correct, unless you specify absoluteRuntime which makes it use absolute paths

This is my concern - resolution from the transform and resolution from the runtime are very different environments. The Babel runtime is a direct dependency of Next.js, so runtime resolution should resolve that dependency but in theory it could be overridden in the runtime environment. On the other hand transform time resolution might even be inlining the runtime through ncc right now.

Just being cautious to verify these cases - someone with more knowledge of these environments may be able to confirm more easily than myself.

@merceyz
Copy link
Contributor Author

merceyz commented Nov 9, 2020

The thing is aren't we doing the resolutions at different times in the workflow? Currently it is happening at the time the module is built / run / processed (to be honest I'm not quite sure when that is), while this would change the resolution time to being when the module is transformed.

Only slighly, it's done when the babel preset is loaded instead of when the babel plugin needs to inject the import, but the end result is the same.

I'm pretty sure ncc would be processing this require.resolve statement, and might even be inlining the assets?

It doesn't as this doesn't go through ncc

@ijjk
Copy link
Member

ijjk commented Nov 9, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
buildDuration 12.8s 12.6s -200ms
nodeModulesSize 85 MB 85 MB ⚠️ +76 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
/ failed reqs 0 0
/ total time (seconds) 2.269 2.395 ⚠️ +0.13
/ avg req/sec 1101.8 1043.7 ⚠️ -58.1
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.272 1.248 -0.02
/error-in-render avg req/sec 1965.3 2003.66 +38.36
Client Bundles (main, webpack, commons)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..7d3b.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-6a509b2..b31a.js gzip 7.4 kB 7.4 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.4 kB 58.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-0547acd..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_buildManifest.js gzip 322 B 321 B -1 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 651 B -1 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
index.html gzip 1 kB 1 kB -3 B
link.html gzip 1.01 kB 1.01 kB -2 B
withRouter.html gzip 996 B 995 B -1 B
Overall change 3.01 kB 3 kB -6 B

Diffs

Diff for _buildManifest.js
@@ -2,12 +2,12 @@ self.__BUILD_MANIFEST = {
   __rewrites: [],
   "/": ["static\u002Fchunks\u002Fpages\u002Findex-283eed3c1520dcc26e8d.js"],
   "/_error": [
-    "static\u002Fchunks\u002Fpages\u002F_error-9b57cae5694a39479222.js"
+    "static\u002Fchunks\u002Fpages\u002F_error-760f653e71e48010adf7.js"
   ],
   "/hooks": [
-    "static\u002Fchunks\u002Fpages\u002Fhooks-bdd2cad07648acf22380.js"
+    "static\u002Fchunks\u002Fpages\u002Fhooks-880757f1d73d6b241fc3.js"
   ],
-  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-fcaf825022c62b02057c.js"],
+  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-3125d338b922d5ab1776.js"],
   "/routerDirect": [
     "static\u002Fchunks\u002Fpages\u002FrouterDirect-2e9bfd441bd88cd3382e.js"
   ],
Diff for _buildManifest.module.js
@@ -4,7 +4,7 @@ self.__BUILD_MANIFEST = {
     "static\u002Fchunks\u002Fpages\u002Findex-dc79232991b9d18c3260.module.js"
   ],
   "/_error": [
-    "static\u002Fchunks\u002Fpages\u002F_error-714d7bb4196263406c6e.module.js"
+    "static\u002Fchunks\u002Fpages\u002F_error-b59ce1d1aef722bdb502.module.js"
   ],
   "/hooks": [
     "static\u002Fchunks\u002Fpages\u002Fhooks-56fa58a6f0993d7d36d7.module.js"
Diff for index.html
@@ -85,7 +85,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-40f3a40e310cc5292a89.js"
+      src="/_next/static/chunks/main-2fd5c9125e922c10e577.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -121,7 +121,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -133,7 +133,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
Diff for link.html
@@ -90,7 +90,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-40f3a40e310cc5292a89.js"
+      src="/_next/static/chunks/main-2fd5c9125e922c10e577.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -126,7 +126,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -138,7 +138,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -150,7 +150,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/link-fcaf825022c62b02057c.js"
+      src="/_next/static/chunks/pages/link-3125d338b922d5ab1776.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
Diff for withRouter.html
@@ -85,7 +85,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-40f3a40e310cc5292a89.js"
+      src="/_next/static/chunks/main-2fd5c9125e922c10e577.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -121,7 +121,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.978ffbabf17b2be9a27e.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.6434721f788a4bf67b23.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -133,7 +133,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""

Serverless Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
buildDuration 14.4s 13.3s -1.1s
nodeModulesSize 85 MB 85 MB ⚠️ +76 B
Client Bundles (main, webpack, commons)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..7d3b.js gzip 11.3 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-6a509b2..b31a.js gzip 7.4 kB N/A N/A
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..5283.js gzip N/A 11.3 kB N/A
main-6ae41db..e5f1.js gzip N/A 7.4 kB N/A
Overall change 58.4 kB 58.4 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..dule.js gzip 7.04 kB 7.04 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-0547acd..dule.js gzip 6.39 kB 6.39 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.1 kB 53.1 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-7231d4b..5856.js gzip 1.28 kB N/A N/A
_error-fca3d..2eb1.js gzip 3.44 kB N/A N/A
hooks-d4591d..e7c2.js gzip 887 B N/A N/A
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB N/A N/A
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
_app-3b0cf13..85f8.js gzip N/A 1.28 kB N/A
_error-6f635..c393.js gzip N/A 3.44 kB N/A
hooks-d4ffc3..9e0f.js gzip N/A 887 B N/A
link-0abe79e..7616.js gzip N/A 1.55 kB N/A
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB N/A N/A
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
_error-f2fcc..dule.js gzip N/A 2.29 kB N/A
Overall change 5.59 kB 5.59 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_buildManifest.js gzip 322 B 321 B -1 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 651 B -1 B
Serverless bundles
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_error.js 915 kB 915 kB
404.html 4.73 kB 4.73 kB
hooks.html 3.92 kB 3.92 kB
index.js 915 kB 915 kB
link.js 964 kB 964 kB
routerDirect.js 957 kB 957 kB
withRouter.js 957 kB 957 kB
Overall change 4.72 MB 4.72 MB
Commit: 6c6c651

@guybedford
Copy link
Contributor

Ok, if you are confident the environment isn't affected by other information then that sounds good to me, just had to check.

@Timer Timer added this to the iteration 12 milestone Nov 10, 2020
@vercel vercel bot temporarily deployed to Preview November 11, 2020 14:57 Inactive
Copy link
Member

@Timer Timer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ijjk
Copy link
Member

ijjk commented Nov 11, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
buildDuration 14.4s 14.2s -141ms
nodeModulesSize 84.8 MB 84.8 MB ⚠️ +76 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
/ failed reqs 0 0
/ total time (seconds) 2.716 2.751 ⚠️ +0.03
/ avg req/sec 920.61 908.61 ⚠️ -12
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.598 1.642 ⚠️ +0.04
/error-in-render avg req/sec 1564.91 1522.73 ⚠️ -42.18
Client Bundles (main, webpack, commons)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..3888.js gzip 11.3 kB 11.3 kB
framework.HASH.js gzip 39 kB 39 kB
main-673683e..14c7.js gzip 7.48 kB 7.48 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 58.5 kB 58.5 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..dule.js gzip 7.05 kB 7.05 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-0c7333c..dule.js gzip 6.47 kB 6.47 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.2 kB 53.2 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-fca3d..2eb1.js gzip 3.44 kB 3.44 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB 1.55 kB
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB 2.29 kB
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
Overall change 5.59 kB 5.59 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_buildManifest.js gzip 322 B 321 B -1 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 651 B -1 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
index.html gzip 969 B 970 B ⚠️ +1 B
link.html gzip 977 B 977 B
withRouter.html gzip 963 B 963 B
Overall change 2.91 kB 2.91 kB ⚠️ +1 B

Diffs

Diff for _buildManifest.js
@@ -2,12 +2,12 @@ self.__BUILD_MANIFEST = {
   __rewrites: [],
   "/": ["static\u002Fchunks\u002Fpages\u002Findex-283eed3c1520dcc26e8d.js"],
   "/_error": [
-    "static\u002Fchunks\u002Fpages\u002F_error-9b57cae5694a39479222.js"
+    "static\u002Fchunks\u002Fpages\u002F_error-760f653e71e48010adf7.js"
   ],
   "/hooks": [
-    "static\u002Fchunks\u002Fpages\u002Fhooks-bdd2cad07648acf22380.js"
+    "static\u002Fchunks\u002Fpages\u002Fhooks-880757f1d73d6b241fc3.js"
   ],
-  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-fcaf825022c62b02057c.js"],
+  "/link": ["static\u002Fchunks\u002Fpages\u002Flink-3125d338b922d5ab1776.js"],
   "/routerDirect": [
     "static\u002Fchunks\u002Fpages\u002FrouterDirect-2e9bfd441bd88cd3382e.js"
   ],
Diff for _buildManifest.module.js
@@ -4,7 +4,7 @@ self.__BUILD_MANIFEST = {
     "static\u002Fchunks\u002Fpages\u002Findex-dc79232991b9d18c3260.module.js"
   ],
   "/_error": [
-    "static\u002Fchunks\u002Fpages\u002F_error-714d7bb4196263406c6e.module.js"
+    "static\u002Fchunks\u002Fpages\u002F_error-b59ce1d1aef722bdb502.module.js"
   ],
   "/hooks": [
     "static\u002Fchunks\u002Fpages\u002Fhooks-56fa58a6f0993d7d36d7.module.js"
Diff for index.html
@@ -82,7 +82,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-c12e76ab7fd8fce0bb80.js"
+      src="/_next/static/chunks/main-4350573f106c88c1a7e0.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -118,7 +118,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c3dbd33b4fb43ac7e320.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -130,7 +130,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
Diff for link.html
@@ -87,7 +87,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-c12e76ab7fd8fce0bb80.js"
+      src="/_next/static/chunks/main-4350573f106c88c1a7e0.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -123,7 +123,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c3dbd33b4fb43ac7e320.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -135,7 +135,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -147,7 +147,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/link-fcaf825022c62b02057c.js"
+      src="/_next/static/chunks/pages/link-3125d338b922d5ab1776.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
Diff for withRouter.html
@@ -82,7 +82,7 @@
       src="/_next/static/chunks/polyfills-f73ba3fc145972ef83e9.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-c12e76ab7fd8fce0bb80.js"
+      src="/_next/static/chunks/main-4350573f106c88c1a7e0.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -118,7 +118,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.84827680b822d5d16780.js"
+      src="/_next/static/chunks/677f882d2ed86fa3467b8979053c1a4c3f8bc4df.c3dbd33b4fb43ac7e320.js"
       async=""
       crossorigin="anonymous"
       nomodule=""
@@ -130,7 +130,7 @@
       type="module"
     ></script>
     <script
-      src="/_next/static/chunks/pages/_app-265ddf2d03dbe48fa6cb.js"
+      src="/_next/static/chunks/pages/_app-a24430c6b07ae4b780ba.js"
       async=""
       crossorigin="anonymous"
       nomodule=""

Serverless Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
buildDuration 16.7s 17.2s ⚠️ +488ms
nodeModulesSize 84.8 MB 84.8 MB ⚠️ +76 B
Client Bundles (main, webpack, commons)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..3888.js gzip 11.3 kB N/A N/A
framework.HASH.js gzip 39 kB 39 kB
main-673683e..14c7.js gzip 7.48 kB N/A N/A
webpack-e067..f178.js gzip 751 B 751 B
677f882d2ed8..01e7.js gzip N/A 11.3 kB N/A
main-3e470be..d458.js gzip N/A 7.48 kB N/A
Overall change 58.5 kB 58.5 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
677f882d2ed8..dule.js gzip 7.05 kB 7.05 kB
framework.HA..dule.js gzip 39 kB 39 kB
main-0c7333c..dule.js gzip 6.47 kB 6.47 kB
webpack-07c5..dule.js gzip 751 B 751 B
Overall change 53.2 kB 53.2 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-7231d4b..5856.js gzip 1.28 kB N/A N/A
_error-fca3d..2eb1.js gzip 3.44 kB N/A N/A
hooks-d4591d..e7c2.js gzip 887 B N/A N/A
index-17468f..5d83.js gzip 227 B 227 B
link-8a9d104..0e42.js gzip 1.55 kB N/A N/A
routerDirect..924c.js gzip 284 B 284 B
withRouter-7..c13d.js gzip 284 B 284 B
_app-3b0cf13..85f8.js gzip N/A 1.28 kB N/A
_error-6f635..c393.js gzip N/A 3.44 kB N/A
hooks-d4ffc3..9e0f.js gzip N/A 887 B N/A
link-0abe79e..7616.js gzip N/A 1.55 kB N/A
Overall change 7.96 kB 7.96 kB
Client Pages Modern
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_app-75d3a82..dule.js gzip 625 B 625 B
_error-4469a..dule.js gzip 2.29 kB N/A N/A
hooks-cbf13f..dule.js gzip 387 B 387 B
index-b9a643..dule.js gzip 226 B 226 B
link-d1cfb87..dule.js gzip 1.49 kB 1.49 kB
routerDirect..dule.js gzip 284 B 284 B
withRouter-f..dule.js gzip 282 B 282 B
_error-f2fcc..dule.js gzip N/A 2.29 kB N/A
Overall change 5.59 kB 5.59 kB
Client Build Manifests Overall decrease ✓
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_buildManifest.js gzip 322 B 321 B -1 B
_buildManife..dule.js gzip 330 B 330 B
Overall change 652 B 651 B -1 B
Serverless bundles
vercel/next.js canary merceyz/next.js merceyz/babel-runtime Change
_error.js 916 kB 916 kB
404.html 4.61 kB 4.61 kB
hooks.html 3.86 kB 3.86 kB
index.js 916 kB 916 kB
link.js 965 kB 965 kB
routerDirect.js 958 kB 958 kB
withRouter.js 958 kB 958 kB
Overall change 4.72 MB 4.72 MB
Commit: 5985d60

@merceyz
Copy link
Contributor Author

merceyz commented Nov 24, 2020

They'd need to be different for each file so I don't see how that would help

@guybedford
Copy link
Contributor

I see, it seems the reverting may be the best bet then - is there another fix for Yarn that might apply?

@merceyz
Copy link
Contributor Author

merceyz commented Nov 24, 2020

Shouldn't @babel/runtime be bundled though? I don't quite get why it's explicitly made external

@merceyz
Copy link
Contributor Author

merceyz commented Nov 24, 2020

Only place I can find a absolute path in the build output is in .next\cache\next-babel-loader

@nicolo-ribaudo
Copy link

nicolo-ribaudo commented Nov 24, 2020

Maybe a solution could also be to mark resolve as external, so that yarn can still patch it?

@merceyz
Copy link
Contributor Author

merceyz commented Nov 24, 2020

I'm afraid that wont fix it, reverting this commit and making resolve external will cause it to use bare module identifiers (@babel/runtime/foo) for people not using PnP which means it depends on hoisting to bring @babel/runtime to the top level, which is not guaranteed to happen and can cause issues when making unrelated changes to the dependency tree.

https://yarnpkg.com/advanced/rulebook#packages-should-only-ever-require-what-they-formally-list-in-their-dependencies

@guybedford
Copy link
Contributor

@merceyz I guess the logic is that @babel/runtime is effectively being considered as a peer dependency here? Two things then - that's what Next.js has always done I believe? So the issue was only exposed as opposed to created right? Secondly, inlining might be an option but I'm not sure if that in turn might have knock-on effects?

I'd prefer if we could just externalize as before to be honest, the goal was to match the previous behaviour before #18768 landed.

@koshea
Copy link

koshea commented Nov 25, 2020

I'll expand on my comment in case our use case is helpful. The issue I am having is that with this change the transpiled code is no longer portable from one environment to another.

In order to keep our containers small, we do not include all of the dependencies to build our project in the docker container. So when we run CI, we build the code and copy it into the container. In the container we only install the runtime dependencies.

The issue is now that these paths are hardcoded, if the paths do not match in the runtime environment to the build environment it cannot find the babel runtime. I can work around this by just making sure these paths match, so this change is by no means a deal breaker, I just wish it were at least highlighted as a breaking change and perhaps in a 10.1.x release rather than lost in a patch level changelog.

If there is a better way we could be handling our build to avoid this pain point I appreciate your feedback.

Regards,
Kevin

@merceyz
Copy link
Contributor Author

merceyz commented Nov 25, 2020

@koshea I only see the paths in the babel loader cache which shouldn't matter and when running next dev, presumably you're not running that so I can't figure out how you're getting to this state. Are you able to provide a reproduction?

I'd prefer if we could just externalize as before to be honest, the goal was to match the previous behaviour before #18768 landed.

@guybedford That would replace one issue with another, the previous solution only applied the correct logic when using PnP, something else needs to be fixed

I guess the logic is that @babel/runtime is effectively being considered as a peer dependency here?

I'm fairly certain that is not the intent as it would require the user to add it as a dependency

@guybedford
Copy link
Contributor

@guybedford That would replace one issue with another, the previous solution only applied the correct logic when using PnP, something else needs to be fixed

@merceyz are you saying this issue did not exist before #18768? I'm still not clear on why that is.

@merceyz
Copy link
Contributor Author

merceyz commented Nov 25, 2020

It did, but only when running under PnP, this PR changed it to always be applied (which is the correct behaviour, otherwise it relies on hoisting) while also resolving it up front instead of having babel do it

@guybedford
Copy link
Contributor

Then the suggestion of externalizing resolve would be the direct fix of that regression, while not fixing the root cause. I'm just saying that might be a good first step, before then later attacking the full inlining which may have further repercussions otherwise.

@guybedford
Copy link
Contributor

I'd also be interested to know what the behaviour is in resolve that ncc wasn't able to support, it might even be something we can fix there.

@merceyz
Copy link
Contributor Author

merceyz commented Nov 25, 2020

Then the suggestion of externalizing resolve would be the direct fix of that regression, while not fixing the root cause

In that case, we can just add back the check for if it's running under PnP or not, then nothing will (effectively) have changed since before #18768. Though I would like to look at a reproduction of the issue first to see if it's fixable

I'd also be interested to know what the behaviour is in resolve that ncc wasn't able to support, it might even be something we can fix there.

Yarn patches it at install time to add PnP support, when it's inlined we can't see it

@merceyz
Copy link
Contributor Author

merceyz commented Nov 25, 2020

Actually inlining resolve from babel is breaking PnP support for adding babel plugins to a .babelrc so it needs to be external either way

@koshea
Copy link

koshea commented Nov 25, 2020

@merceyz well, now that I review the codebase, the issue is actually due to the fact that we sometimes utilize the code transpiled by the next babel preset to share code between packages, and this is not necessarily run through webpack.

@merceyz
Copy link
Contributor Author

merceyz commented Nov 25, 2020

You can pass absoluteRuntime: false to the preset to turn absolute paths off for those then

...options['transform-runtime'],

@RossMcMillan92 is this what is happening to you as well?

@koshea
Copy link

koshea commented Nov 25, 2020

That solves my problem, thank you @merceyz !

guybedford added a commit to guybedford/next.js that referenced this pull request Nov 25, 2020
kodiakhq bot pushed a commit that referenced this pull request Nov 25, 2020
…#19542)

This reverts #18921 and ensures that the Babel runtime is only inlined as an absolute path when using PnP as before, but then including the correction this resolution as implemented by @merceyz only in the PnP cases, while keeping the diff to a minimum.
@RossMcMillan92
Copy link

RossMcMillan92 commented Nov 26, 2020

Yes, I think this has fixed our deployment. Thanks for the tip.

For anyone looking for an easy answer, add this to your babelrc file:

presets: [
  ['next/babel', { 'transform-runtime': { absoluteRuntime: false } }],
],

Still, feels like we shouldn't have to do this.

@merceyz
Copy link
Contributor Author

merceyz commented Nov 26, 2020

So you're using the preset outside of the webpack build? If that is the case then #19538 is the solution

@RossMcMillan92
Copy link

I didn't notice at first, but you are correct. We're using next/babel to transpile our server.js code, which is outside of the webpack build.

Thanks for pointing that out, I would never have realised. #19538 may indeed be the solution then

@merceyz
Copy link
Contributor Author

merceyz commented Nov 26, 2020

Perfect, thanks for confirming!

kamermans pushed a commit to kamermans/next.js that referenced this pull request Dec 14, 2020
…arnPnp (vercel#19542)

This reverts vercel#18921 and ensures that the Babel runtime is only inlined as an absolute path when using PnP as before, but then including the correction this resolution as implemented by @merceyz only in the PnP cases, while keeping the diff to a minimum.
kodiakhq bot pushed a commit that referenced this pull request Jan 11, 2021
…19538)

**What's the problem this PR addresses?**

In #18921 I enabled `absoluteRuntime` for everyone (it was only enabled for PnP users) but didn't consider that people used the babel preset outside of the webpack build.

Fixes #19448 - ~~Since it doesn't contain a repro I can't be certain but based on feedback from @koshea in #18921 (comment) I'll assume @RossMcMillan92 is doing the same thing, because when next is building it doesn't leave absolute paths as external.~~
Confirmed in #18921 (comment)

**How did you fix it?**

Only enable `absoluteRuntime` when the preset is running under `babel-loader`
@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to resolve "@babel/runtime" with Yarn 2 and Next.js canary
7 participants