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

refactor(next): client/index.tsx #20806

Merged
merged 9 commits into from Jan 7, 2021

Conversation

tarunama
Copy link
Contributor

@tarunama tarunama commented Jan 6, 2021

summary

@ijjk
Copy link
Member

ijjk commented Jan 6, 2021

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
buildDuration 10.7s 11.7s ⚠️ +1s
nodeModulesSize 80.6 MB 80.6 MB ⚠️ +81 B
Page Load Tests Overall increase ✓
vercel/next.js canary tarunama/next.js refactor/client-index Change
/ failed reqs 0 0
/ total time (seconds) 2.179 2.061 -0.12
/ avg req/sec 1147.06 1213.01 +65.95
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.284 1.29 ⚠️ +0.01
/error-in-render avg req/sec 1946.7 1938.52 ⚠️ -8.18
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
677f882d2ed8..89aa.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-1f258db..b7d8.js gzip 6.63 kB N/A N/A
webpack-50be..df5b.js gzip 751 B 751 B
main-bd74f8e..b249.js gzip N/A 41 kB N/A
Overall change 59.4 kB 93.8 kB ⚠️ +34.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary tarunama/next.js refactor/client-index Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary tarunama/next.js refactor/client-index Change
_app-b6fc6bc..222c.js gzip 1.28 kB 1.28 kB
_error-e2ffa..0f3f.js gzip 3.46 kB 3.46 kB
hooks-010c20..8411.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-705099c..c35d.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary tarunama/next.js refactor/client-index Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
index.html gzip 613 B 614 B ⚠️ +1 B
link.html gzip 620 B 621 B ⚠️ +1 B
withRouter.html gzip 607 B 607 B
Overall change 1.84 kB 1.84 kB ⚠️ +2 B

Diffs

Diff for main-0573c44..82ff96878.js
failed to diff
Diff for main-0ae841d..26d092b3c.js
deleted
Diff for index.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      href="/_next/static/chunks/main-0573c44621582ff96878.js"
       as="script"
     />
     <link
@@ -53,7 +53,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      src="/_next/static/chunks/main-0573c44621582ff96878.js"
       async=""
     ></script>
     <script
Diff for link.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      href="/_next/static/chunks/main-0573c44621582ff96878.js"
       as="script"
     />
     <link
@@ -58,7 +58,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      src="/_next/static/chunks/main-0573c44621582ff96878.js"
       async=""
     ></script>
     <script
Diff for withRouter.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      href="/_next/static/chunks/main-0573c44621582ff96878.js"
       as="script"
     />
     <link
@@ -53,7 +53,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      src="/_next/static/chunks/main-0573c44621582ff96878.js"
       async=""
     ></script>
     <script

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
buildDuration 12.5s 14s ⚠️ +1.5s
nodeModulesSize 80.6 MB 80.6 MB ⚠️ +81 B
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
677f882d2ed8..89aa.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-1f258db..b7d8.js gzip 6.63 kB N/A N/A
webpack-50be..df5b.js gzip 751 B 751 B
main-bd74f8e..b249.js gzip N/A 41 kB N/A
Overall change 59.4 kB 93.8 kB ⚠️ +34.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary tarunama/next.js refactor/client-index Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary tarunama/next.js refactor/client-index Change
_app-b6fc6bc..222c.js gzip 1.28 kB 1.28 kB
_error-e2ffa..0f3f.js gzip 3.46 kB 3.46 kB
hooks-010c20..8411.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-705099c..c35d.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary tarunama/next.js refactor/client-index Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Serverless bundles
vercel/next.js canary tarunama/next.js refactor/client-index Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.18 MB 5.18 MB
Commit: 71096a6

@ijjk
Copy link
Member

ijjk commented Jan 6, 2021

Failing test suites

Commit: 71096a6

test/integration/build-output/test/index.test.js

  • Build Output > Basic Application Output > should not deviate from snapshot
  • Build Output > Crypto Application > should not include crypto
Expand output

● Build Output › Basic Application Output › should not deviate from snapshot

expect(received).toBeCloseTo(expected, precision)

Expected: 62.4
Received: 96.4

Expected precision:    1
Expected difference: < 0.05
Received difference:   34.00000000000001

   96 | 
   97 |       // should be no bigger than 62.2 kb
>  98 |       expect(parseFloat(indexFirstLoad)).toBeCloseTo(62.4, 1)
      |                                          ^
   99 |       expect(indexFirstLoad.endsWith('kB')).toBe(true)
  100 | 
  101 |       expect(parseFloat(err404Size) - 3.7).toBeLessThanOrEqual(0)

  at Object.<anonymous> (integration/build-output/test/index.test.js:98:42)

● Build Output › Crypto Application › should not include crypto

expect(received).toBeLessThanOrEqual(expected)

Expected: <= 65
Received:    99

  169 |       expect(indexSize.endsWith('kB')).toBe(true)
  170 | 
> 171 |       expect(parseFloat(indexFirstLoad)).toBeLessThanOrEqual(65)
      |                                          ^
  172 |       expect(parseFloat(indexFirstLoad)).toBeGreaterThanOrEqual(60)
  173 |       expect(indexFirstLoad.endsWith('kB')).toBe(true)
  174 |     })

  at Object.<anonymous> (integration/build-output/test/index.test.js:171:42)

test/integration/size-limit/test/index.test.js

  • Production response size > should not increase the overall response size of default build
Expand output

● Production response size › should not increase the overall response size of default build

expect(received).toBeCloseTo(expected, precision)

Expected: 282.6
Received: 419.4541015625

Expected precision:    0
Expected difference: < 0.5
Received difference:   136.85410156249998

  82 | 
  83 |     // Expected difference: < 0.5
> 84 |     expect(delta).toBeCloseTo(282.6, 0)
     |                   ^
  85 |   })
  86 | })
  87 | 

  at Object.<anonymous> (integration/size-limit/test/index.test.js:84:19)

@ijjk
Copy link
Member

ijjk commented Jan 6, 2021

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
buildDuration 10s 11.3s ⚠️ +1.3s
nodeModulesSize 80.6 MB 80.6 MB ⚠️ +79 B
Page Load Tests Overall increase ✓
vercel/next.js canary tarunama/next.js refactor/client-index Change
/ failed reqs 0 0
/ total time (seconds) 2.028 2.002 -0.03
/ avg req/sec 1232.44 1248.53 +16.09
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.303 1.256 -0.05
/error-in-render avg req/sec 1918.19 1990.64 +72.45
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
677f882d2ed8..89aa.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-1f258db..b7d8.js gzip 6.63 kB N/A N/A
webpack-50be..df5b.js gzip 751 B 751 B
main-09c319a..9264.js gzip N/A 41 kB N/A
Overall change 59.4 kB 93.8 kB ⚠️ +34.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary tarunama/next.js refactor/client-index Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary tarunama/next.js refactor/client-index Change
_app-b6fc6bc..222c.js gzip 1.28 kB 1.28 kB
_error-e2ffa..0f3f.js gzip 3.46 kB 3.46 kB
hooks-010c20..8411.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-705099c..c35d.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary tarunama/next.js refactor/client-index Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
index.html gzip 613 B 613 B
link.html gzip 620 B 621 B ⚠️ +1 B
withRouter.html gzip 607 B 607 B
Overall change 1.84 kB 1.84 kB ⚠️ +1 B

Diffs

Diff for main-0ae841d..26d092b3c.js
deleted
Diff for main-a86664a..5ae2ed541.js
failed to diff
Diff for index.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      href="/_next/static/chunks/main-a86664aae4c5ae2ed541.js"
       as="script"
     />
     <link
@@ -53,7 +53,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      src="/_next/static/chunks/main-a86664aae4c5ae2ed541.js"
       async=""
     ></script>
     <script
Diff for link.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      href="/_next/static/chunks/main-a86664aae4c5ae2ed541.js"
       as="script"
     />
     <link
@@ -58,7 +58,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      src="/_next/static/chunks/main-a86664aae4c5ae2ed541.js"
       async=""
     ></script>
     <script
Diff for withRouter.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      href="/_next/static/chunks/main-a86664aae4c5ae2ed541.js"
       as="script"
     />
     <link
@@ -53,7 +53,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      src="/_next/static/chunks/main-a86664aae4c5ae2ed541.js"
       async=""
     ></script>
     <script

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
buildDuration 13s 13.1s ⚠️ +93ms
nodeModulesSize 80.6 MB 80.6 MB ⚠️ +79 B
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
677f882d2ed8..89aa.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-1f258db..b7d8.js gzip 6.63 kB N/A N/A
webpack-50be..df5b.js gzip 751 B 751 B
main-09c319a..9264.js gzip N/A 41 kB N/A
Overall change 59.4 kB 93.8 kB ⚠️ +34.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary tarunama/next.js refactor/client-index Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary tarunama/next.js refactor/client-index Change
_app-b6fc6bc..222c.js gzip 1.28 kB 1.28 kB
_error-e2ffa..0f3f.js gzip 3.46 kB 3.46 kB
hooks-010c20..8411.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-705099c..c35d.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary tarunama/next.js refactor/client-index Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Serverless bundles
vercel/next.js canary tarunama/next.js refactor/client-index Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.18 MB 5.18 MB
Commit: 3f1f037

@ijjk
Copy link
Member

ijjk commented Jan 6, 2021

Failing test suites

Commit: 3f1f037

test/integration/build-output/test/index.test.js

  • Build Output > Basic Application Output > should not deviate from snapshot
  • Build Output > Crypto Application > should not include crypto
Expand output

● Build Output › Basic Application Output › should not deviate from snapshot

expect(received).toBeCloseTo(expected, precision)

Expected: 62.4
Received: 96.4

Expected precision:    1
Expected difference: < 0.05
Received difference:   34.00000000000001

   96 | 
   97 |       // should be no bigger than 62.2 kb
>  98 |       expect(parseFloat(indexFirstLoad)).toBeCloseTo(62.4, 1)
      |                                          ^
   99 |       expect(indexFirstLoad.endsWith('kB')).toBe(true)
  100 | 
  101 |       expect(parseFloat(err404Size) - 3.7).toBeLessThanOrEqual(0)

  at Object.<anonymous> (integration/build-output/test/index.test.js:98:42)

● Build Output › Crypto Application › should not include crypto

expect(received).toBeLessThanOrEqual(expected)

Expected: <= 65
Received:    99

  169 |       expect(indexSize.endsWith('kB')).toBe(true)
  170 | 
> 171 |       expect(parseFloat(indexFirstLoad)).toBeLessThanOrEqual(65)
      |                                          ^
  172 |       expect(parseFloat(indexFirstLoad)).toBeGreaterThanOrEqual(60)
  173 |       expect(indexFirstLoad.endsWith('kB')).toBe(true)
  174 |     })

  at Object.<anonymous> (integration/build-output/test/index.test.js:171:42)

test/integration/size-limit/test/index.test.js

  • Production response size > should not increase the overall response size of default build
Expand output

● Production response size › should not increase the overall response size of default build

expect(received).toBeCloseTo(expected, precision)

Expected: 282.6
Received: 419.453125

Expected precision:    0
Expected difference: < 0.5
Received difference:   136.85312499999998

  82 | 
  83 |     // Expected difference: < 0.5
> 84 |     expect(delta).toBeCloseTo(282.6, 0)
     |                   ^
  85 |   })
  86 | })
  87 | 

  at Object.<anonymous> (integration/size-limit/test/index.test.js:84:19)

@ijjk
Copy link
Member

ijjk commented Jan 6, 2021

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
buildDuration 9.9s 9.7s -206ms
nodeModulesSize 80.6 MB 80.6 MB ⚠️ +601 B
Page Load Tests Overall increase ✓
vercel/next.js canary tarunama/next.js refactor/client-index Change
/ failed reqs 0 0
/ total time (seconds) 1.986 1.942 -0.04
/ avg req/sec 1258.67 1287.28 +28.61
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.237 1.223 -0.01
/error-in-render avg req/sec 2020.85 2044.48 +23.63
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
677f882d2ed8..89aa.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-1f258db..b7d8.js gzip 6.63 kB 6.63 kB ⚠️ +2 B
webpack-50be..df5b.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB ⚠️ +2 B
Legacy Client Bundles (polyfills)
vercel/next.js canary tarunama/next.js refactor/client-index Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary tarunama/next.js refactor/client-index Change
_app-b6fc6bc..222c.js gzip 1.28 kB 1.28 kB
_error-e2ffa..0f3f.js gzip 3.46 kB 3.46 kB
hooks-010c20..8411.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-705099c..c35d.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary tarunama/next.js refactor/client-index Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary tarunama/next.js refactor/client-index Change
index.html gzip 613 B 613 B
link.html gzip 620 B 620 B
withRouter.html gzip 607 B 606 B -1 B
Overall change 1.84 kB 1.84 kB -1 B

Diffs

Diff for main-0ae841d..26d092b3c.js
@@ -371,10 +371,10 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
         runtimeConfig = data.runtimeConfig,
         dynamicIds = data.dynamicIds,
         isFallback = data.isFallback,
+        locale = data.locale,
         locales = data.locales,
         domainLocales = data.domainLocales;
-      var locale = data.locale,
-        defaultLocale = data.defaultLocale;
+      var defaultLocale = data.defaultLocale;
       var prefix = assetPrefix || ""; // With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time
       // So, this is how we do it in the client side at runtime
 
@@ -429,14 +429,12 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
       window.__NEXT_P.push = register;
       var headManager = (0, _headManager["default"])();
       var appElement = document.getElementById("__next");
-      var lastAppProps;
 
       var _lastRenderReject;
 
       var webpackHMR;
       var router;
       exports.router = router;
-      var CachedComponent;
       var CachedApp, onPerfEntry;
 
       var Container = /*#__PURE__*/ (function(_react$default$Compon) {
@@ -539,6 +537,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
 
       var emitter = (0, _mitt["default"])();
       exports.emitter = emitter;
+      var CachedComponent;
 
       var _default = /*#__PURE__*/ (function() {
         var _ref3 = _asyncToGenerator(
@@ -955,11 +954,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
           "routeChange",
           "mark"
         );
-
-        if (!navStartEntries.length) {
-          return;
-        }
-
+        if (!navStartEntries.length) return;
         performance.measure(
           "Next.js-route-change-to-render",
           navStartEntries[0].name,
@@ -1000,7 +995,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
                 App: CachedApp,
                 err: error
               })["catch"](function(err) {
-                return console.error("Error rendering page: ", err);
+                return console.error("Error rendering page: ".concat(err));
               });
             }
           },
@@ -1035,6 +1030,8 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
         };
       };
 
+      var lastAppProps;
+
       function doRender(input) {
         var App = input.App,
           Component = input.Component,
Diff for index.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      href="/_next/static/chunks/main-49ce2c46242b8f22d6d2.js"
       as="script"
     />
     <link
@@ -53,7 +53,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      src="/_next/static/chunks/main-49ce2c46242b8f22d6d2.js"
       async=""
     ></script>
     <script
Diff for link.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      href="/_next/static/chunks/main-49ce2c46242b8f22d6d2.js"
       as="script"
     />
     <link
@@ -58,7 +58,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      src="/_next/static/chunks/main-49ce2c46242b8f22d6d2.js"
       async=""
     ></script>
     <script
Diff for withRouter.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      href="/_next/static/chunks/main-49ce2c46242b8f22d6d2.js"
       as="script"
     />
     <link
@@ -53,7 +53,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-0ae841d5a7826d092b3c.js"
+      src="/_next/static/chunks/main-49ce2c46242b8f22d6d2.js"
       async=""
     ></script>
     <script

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
buildDuration 11.7s 11.3s -448ms
nodeModulesSize 80.6 MB 80.6 MB ⚠️ +601 B
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
677f882d2ed8..89aa.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-1f258db..b7d8.js gzip 6.63 kB N/A N/A
webpack-50be..df5b.js gzip 751 B 751 B
main-273bbf3..e6af.js gzip N/A 6.63 kB N/A
Overall change 59.4 kB 59.4 kB ⚠️ +2 B
Legacy Client Bundles (polyfills)
vercel/next.js canary tarunama/next.js refactor/client-index Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary tarunama/next.js refactor/client-index Change
_app-b6fc6bc..222c.js gzip 1.28 kB 1.28 kB
_error-e2ffa..0f3f.js gzip 3.46 kB 3.46 kB
hooks-010c20..8411.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-705099c..c35d.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary tarunama/next.js refactor/client-index Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Serverless bundles
vercel/next.js canary tarunama/next.js refactor/client-index Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.18 MB 5.18 MB
Commit: 4e672b7

@ijjk
Copy link
Member

ijjk commented Jan 7, 2021

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
buildDuration 9.2s 9.2s -70ms
nodeModulesSize 80.8 MB 80.8 MB ⚠️ +601 B
Page Load Tests Overall increase ✓
vercel/next.js canary tarunama/next.js refactor/client-index Change
/ failed reqs 0 0
/ total time (seconds) 1.874 1.927 ⚠️ +0.05
/ avg req/sec 1333.93 1297.69 ⚠️ -36.24
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.407 1.355 -0.05
/error-in-render avg req/sec 1776.73 1845.1 +68.37
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
677f882d2ed8..89aa.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-1fee81a..2bb3.js gzip 6.62 kB 6.63 kB ⚠️ +2 B
webpack-50be..df5b.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB ⚠️ +2 B
Legacy Client Bundles (polyfills)
vercel/next.js canary tarunama/next.js refactor/client-index Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary tarunama/next.js refactor/client-index Change
_app-b6fc6bc..222c.js gzip 1.28 kB 1.28 kB
_error-e2ffa..0f3f.js gzip 3.46 kB 3.46 kB
hooks-010c20..8411.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-d979103..c5ff.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary tarunama/next.js refactor/client-index Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
index.html gzip 613 B 615 B ⚠️ +2 B
link.html gzip 618 B 619 B ⚠️ +1 B
withRouter.html gzip 605 B 606 B ⚠️ +1 B
Overall change 1.84 kB 1.84 kB ⚠️ +4 B

Diffs

Diff for main-2b75875..9851c6cd8.js
@@ -371,10 +371,10 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
         runtimeConfig = data.runtimeConfig,
         dynamicIds = data.dynamicIds,
         isFallback = data.isFallback,
+        locale = data.locale,
         locales = data.locales,
         domainLocales = data.domainLocales;
-      var locale = data.locale,
-        defaultLocale = data.defaultLocale;
+      var defaultLocale = data.defaultLocale;
       var prefix = assetPrefix || ""; // With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time
       // So, this is how we do it in the client side at runtime
 
@@ -429,14 +429,12 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
       window.__NEXT_P.push = register;
       var headManager = (0, _headManager["default"])();
       var appElement = document.getElementById("__next");
-      var lastAppProps;
 
       var _lastRenderReject;
 
       var webpackHMR;
       var router;
       exports.router = router;
-      var CachedComponent;
       var CachedApp, onPerfEntry;
 
       var Container = /*#__PURE__*/ (function(_react$default$Compon) {
@@ -539,6 +537,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
 
       var emitter = (0, _mitt["default"])();
       exports.emitter = emitter;
+      var CachedComponent;
 
       var _default = /*#__PURE__*/ (function() {
         var _ref3 = _asyncToGenerator(
@@ -955,11 +954,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
           "routeChange",
           "mark"
         );
-
-        if (!navStartEntries.length) {
-          return;
-        }
-
+        if (!navStartEntries.length) return;
         performance.measure(
           "Next.js-route-change-to-render",
           navStartEntries[0].name,
@@ -1000,7 +995,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
                 App: CachedApp,
                 err: error
               })["catch"](function(err) {
-                return console.error("Error rendering page: ", err);
+                return console.error("Error rendering page: ".concat(err));
               });
             }
           },
@@ -1035,6 +1030,8 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
         };
       };
 
+      var lastAppProps;
+
       function doRender(input) {
         var App = input.App,
           Component = input.Component,
Diff for index.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-2b758757f019851c6cd8.js"
+      href="/_next/static/chunks/main-7e21faea7507050847e5.js"
       as="script"
     />
     <link
@@ -53,7 +53,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-2b758757f019851c6cd8.js"
+      src="/_next/static/chunks/main-7e21faea7507050847e5.js"
       async=""
     ></script>
     <script
Diff for link.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-2b758757f019851c6cd8.js"
+      href="/_next/static/chunks/main-7e21faea7507050847e5.js"
       as="script"
     />
     <link
@@ -58,7 +58,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-2b758757f019851c6cd8.js"
+      src="/_next/static/chunks/main-7e21faea7507050847e5.js"
       async=""
     ></script>
     <script
Diff for withRouter.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-2b758757f019851c6cd8.js"
+      href="/_next/static/chunks/main-7e21faea7507050847e5.js"
       as="script"
     />
     <link
@@ -53,7 +53,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-2b758757f019851c6cd8.js"
+      src="/_next/static/chunks/main-7e21faea7507050847e5.js"
       async=""
     ></script>
     <script

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
buildDuration 10.9s 10.8s -42ms
nodeModulesSize 80.8 MB 80.8 MB ⚠️ +601 B
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
677f882d2ed8..89aa.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-1fee81a..2bb3.js gzip 6.62 kB N/A N/A
webpack-50be..df5b.js gzip 751 B 751 B
main-6a4056d..67a5.js gzip N/A 6.63 kB N/A
Overall change 59.4 kB 59.4 kB ⚠️ +2 B
Legacy Client Bundles (polyfills)
vercel/next.js canary tarunama/next.js refactor/client-index Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary tarunama/next.js refactor/client-index Change
_app-b6fc6bc..222c.js gzip 1.28 kB 1.28 kB
_error-e2ffa..0f3f.js gzip 3.46 kB 3.46 kB
hooks-010c20..8411.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-d979103..c5ff.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary tarunama/next.js refactor/client-index Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Serverless bundles
vercel/next.js canary tarunama/next.js refactor/client-index Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.18 MB 5.18 MB
Commit: 95ab21e

packages/next/client/index.tsx Outdated Show resolved Hide resolved
@ijjk
Copy link
Member

ijjk commented Jan 7, 2021

Stats from current PR

Default Server Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
buildDuration 11.4s 11.4s -4ms
nodeModulesSize 80.8 MB 80.8 MB ⚠️ +598 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
/ failed reqs 0 0
/ total time (seconds) 2.324 2.384 ⚠️ +0.06
/ avg req/sec 1075.78 1048.85 ⚠️ -26.93
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.725 1.73 0
/error-in-render avg req/sec 1449.09 1444.7 ⚠️ -4.39
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
677f882d2ed8..89aa.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-1fee81a..2bb3.js gzip 6.62 kB 6.63 kB ⚠️ +2 B
webpack-50be..df5b.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB ⚠️ +2 B
Legacy Client Bundles (polyfills)
vercel/next.js canary tarunama/next.js refactor/client-index Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary tarunama/next.js refactor/client-index Change
_app-b6fc6bc..222c.js gzip 1.28 kB 1.28 kB
_error-e2ffa..0f3f.js gzip 3.46 kB 3.46 kB
hooks-010c20..8411.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-d979103..c5ff.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary tarunama/next.js refactor/client-index Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Rendered Page Sizes Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
index.html gzip 613 B 614 B ⚠️ +1 B
link.html gzip 618 B 619 B ⚠️ +1 B
withRouter.html gzip 605 B 606 B ⚠️ +1 B
Overall change 1.84 kB 1.84 kB ⚠️ +3 B

Diffs

Diff for main-2b75875..9851c6cd8.js
@@ -371,10 +371,10 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
         runtimeConfig = data.runtimeConfig,
         dynamicIds = data.dynamicIds,
         isFallback = data.isFallback,
+        locale = data.locale,
         locales = data.locales,
         domainLocales = data.domainLocales;
-      var locale = data.locale,
-        defaultLocale = data.defaultLocale;
+      var defaultLocale = data.defaultLocale;
       var prefix = assetPrefix || ""; // With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time
       // So, this is how we do it in the client side at runtime
 
@@ -429,14 +429,12 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
       window.__NEXT_P.push = register;
       var headManager = (0, _headManager["default"])();
       var appElement = document.getElementById("__next");
-      var lastAppProps;
 
       var _lastRenderReject;
 
       var webpackHMR;
       var router;
       exports.router = router;
-      var CachedComponent;
       var CachedApp, onPerfEntry;
 
       var Container = /*#__PURE__*/ (function(_react$default$Compon) {
@@ -539,6 +537,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
 
       var emitter = (0, _mitt["default"])();
       exports.emitter = emitter;
+      var CachedComponent;
 
       var _default = /*#__PURE__*/ (function() {
         var _ref3 = _asyncToGenerator(
@@ -955,11 +954,7 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
           "routeChange",
           "mark"
         );
-
-        if (!navStartEntries.length) {
-          return;
-        }
-
+        if (!navStartEntries.length) return;
         performance.measure(
           "Next.js-route-change-to-render",
           navStartEntries[0].name,
@@ -1035,6 +1030,8 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
         };
       };
 
+      var lastAppProps;
+
       function doRender(input) {
         var App = input.App,
           Component = input.Component,
Diff for index.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-2b758757f019851c6cd8.js"
+      href="/_next/static/chunks/main-6b66615487b2bff789df.js"
       as="script"
     />
     <link
@@ -53,7 +53,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-2b758757f019851c6cd8.js"
+      src="/_next/static/chunks/main-6b66615487b2bff789df.js"
       async=""
     ></script>
     <script
Diff for link.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-2b758757f019851c6cd8.js"
+      href="/_next/static/chunks/main-6b66615487b2bff789df.js"
       as="script"
     />
     <link
@@ -58,7 +58,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-2b758757f019851c6cd8.js"
+      src="/_next/static/chunks/main-6b66615487b2bff789df.js"
       async=""
     ></script>
     <script
Diff for withRouter.html
@@ -7,7 +7,7 @@
     <noscript data-n-css=""></noscript>
     <link
       rel="preload"
-      href="/_next/static/chunks/main-2b758757f019851c6cd8.js"
+      href="/_next/static/chunks/main-6b66615487b2bff789df.js"
       as="script"
     />
     <link
@@ -53,7 +53,7 @@
       src="/_next/static/chunks/polyfills-ae47a1f95297af5f55f8.js"
     ></script>
     <script
-      src="/_next/static/chunks/main-2b758757f019851c6cd8.js"
+      src="/_next/static/chunks/main-6b66615487b2bff789df.js"
       async=""
     ></script>
     <script

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
buildDuration 13.7s 13.7s ⚠️ +31ms
nodeModulesSize 80.8 MB 80.8 MB ⚠️ +598 B
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary tarunama/next.js refactor/client-index Change
677f882d2ed8..89aa.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-1fee81a..2bb3.js gzip 6.62 kB N/A N/A
webpack-50be..df5b.js gzip 751 B 751 B
main-dba4ec1..27c0.js gzip N/A 6.63 kB N/A
Overall change 59.4 kB 59.4 kB ⚠️ +2 B
Legacy Client Bundles (polyfills)
vercel/next.js canary tarunama/next.js refactor/client-index Change
polyfills-81..14d7.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary tarunama/next.js refactor/client-index Change
_app-b6fc6bc..222c.js gzip 1.28 kB 1.28 kB
_error-e2ffa..0f3f.js gzip 3.46 kB 3.46 kB
hooks-010c20..8411.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-d979103..c5ff.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary tarunama/next.js refactor/client-index Change
_buildManifest.js gzip 323 B 323 B
Overall change 323 B 323 B
Serverless bundles
vercel/next.js canary tarunama/next.js refactor/client-index Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.18 MB 5.18 MB
Commit: 6573420

@tarunama tarunama requested a review from Timer Jan 7, 2021
Timer
Timer approved these changes Jan 7, 2021
Copy link
Member

@Timer Timer left a comment

Thanks!

@kodiakhq kodiakhq bot merged commit 629a7e8 into vercel:canary Jan 7, 2021
28 of 30 checks passed
@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.

None yet

3 participants