next.js icon indicating copy to clipboard operation
next.js copied to clipboard

feat(server): isolate component modules

Open ctjlewis opened this issue 4 years ago • 7 comments

WIP to resolve issues encountered when adding global shims to an application. Because Next apps currently share context with the Next server itself, it is possible (and trivial) to write application code that breaks the server and prevents a perfectly valid component from rendering, i.e., you can run it with node .next/server/pages/_app.js and see the component render without issue, but the Next server itself will throw as a result of conflicts with application code.

This feature aims to isolate component module contexts using the Node.js vm module and prevent this possibility (and also better containerize Next applications). In general, it is safe to say we do not want application code to ever touch the Next server context, as they truly are separate processes. It is probably worth considering a review of other places where application code is naively require'd and replacing those calls with isolateRequire(...), but it seems like next/server/require.ts : requirePage() is the main concern.

See: https://github.com/Agoric/dapp-card-store/issues/37

Bug

  • [ ] Related issues linked using fixes #number
  • [ ] Integration tests added
  • [ ] Errors have helpful link attached, see contributing.md

Feature

  • [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
  • [ ] Related issues linked using fixes #number
  • [ ] Integration tests added
  • [ ] Documentation added
  • [ ] Telemetry added. In case of a feature if it's used or not.
  • [ ] Errors have helpful link attached, see contributing.md

Documentation / Examples

  • [ ] Make sure the linting passes

ctjlewis avatar Oct 02 '21 16:10 ctjlewis

Failing test suites

Commit: 5bafaa400f2c2d910b740f5da5886dde6df22a50

test/integration/auto-export-serverless/test/index.test.js

  • Auto Export Serverless > Refreshes query on mount
Expand output

● Auto Export Serverless › Refreshes query on mount

command failed with code 1

  174 |         code !== 0
  175 |       ) {
> 176 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  177 |       }
  178 |
  179 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:176:23)

test/integration/auto-export-serverless-error/test/index.test.js

  • Auto Export Error Serverless > fails to emit the page
Expand output

● Auto Export Error Serverless › fails to emit the page

expect(received).toContain(expected) // indexOf

Expected substring: "ReferenceError"
Received string:    "warn  - Compiled with warnings·
../../../packages/next/dist/server/load-components.js
Critical dependency: the request of a dependency is an expression·
../../../packages/next/dist/server/load-components.js
Critical dependency: the request of a dependency is an expression·
../../../packages/next/dist/server/load-components.js
Critical dependency: the request of a dependency is an expression·
../../../packages/next/dist/server/require.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted·
../../../packages/next/dist/server/require.js
Critical dependency: the request of a dependency is an expression·
../../../packages/next/dist/server/require.js
Critical dependency: the request of a dependency is an expression·
(node:5025) UnhandledPromiseRejectionWarning: /home/runner/work/next.js/next.js/test/integration/auto-export-serverless-error/.next/serverless/chunks/387.js:7171
        __webpack_require__(9638)
                            ^^^^·
SyntaxError: Unexpected number

  160 | /******/ 			if(!installedChunks[chunkId]) {
  161 | /******/ 				if(658 != chunkId) {
> 162 | /******/ 					installChunk(require("./chunks/" + __webpack_require__.u(chunkId)));
      |          					             ^
  163 | /******/ 				} else installedChunks[chunkId] = 1;
  164 | /******/ 			}
  165 | /******/ 		};

  at Object.__webpack_require__.f.require (integration/auto-export-serverless-error/.next/serverless/webpack-runtime.js:162:28)
  at integration/auto-export-serverless-error/.next/serverless/webpack-runtime.js:73:40
      at Array.reduce (<anonymous>)
  (Use `node --trace-warnings ...` to show where the warning was created)
  (node:5025) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
  (node:5025) UnhandledPromiseRejectionWarning: /home/runner/work/next.js/next.js/test/integration/auto-export-serverless-error/.next/serverless/chunks/387.js:7171
          __webpack_require__(9638)
                              ^^^^·
  SyntaxError: Unexpected number
  at Object.__webpack_require__.f.require (integration/auto-export-serverless-error/.next/serverless/webpack-runtime.js:162:28)
  at integration/auto-export-serverless-error/.next/serverless/webpack-runtime.js:73:40
      at Array.reduce (<anonymous>)
  (node:5025) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)·
  > Build error occurred
  /home/runner/work/next.js/next.js/test/integration/auto-export-serverless-error/.next/serverless/chunks/387.js:7171
          __webpack_require__(9638)
                              ^^^^·
  SyntaxError: Unexpected number
  at Object.__webpack_require__.f.require (integration/auto-export-serverless-error/.next/serverless/webpack-runtime.js:162:28)
  at integration/auto-export-serverless-error/.next/serverless/webpack-runtime.js:73:40
      at Array.reduce (<anonymous>) {
    type: 'SyntaxError'
  }
  "
  at Object.<anonymous> (integration/auto-export-serverless-error/test/index.test.js:18:20)

test/integration/api-catch-all/test/index.test.js

  • API routes > Serverless support > should return data when catch-all
  • API routes > Serverless support > should return redirect when catch-all with index and trailing slash
  • API routes > Serverless support > should return data when catch-all with index and trailing slash
  • API routes > Serverless support > should return data when catch-all with index and no trailing slash
Expand output

● API routes › Serverless support › should return data when catch-all

command failed with code 1

  174 |         code !== 0
  175 |       ) {
> 176 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  177 |       }
  178 |
  179 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:176:23)

● API routes › Serverless support › should return redirect when catch-all with index and trailing slash

command failed with code 1

  174 |         code !== 0
  175 |       ) {
> 176 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  177 |       }
  178 |
  179 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:176:23)

● API routes › Serverless support › should return data when catch-all with index and trailing slash

command failed with code 1

  174 |         code !== 0
  175 |       ) {
> 176 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  177 |       }
  178 |
  179 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:176:23)

● API routes › Serverless support › should return data when catch-all with index and no trailing slash

command failed with code 1

  174 |         code !== 0
  175 |       ) {
> 176 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  177 |       }
  178 |
  179 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:176:23)

test/integration/app-tree/test/index.test.js

  • AppTree > serverless mode > should provide router context in AppTree on SSR
  • AppTree > serverless mode > should provide router context in AppTree on CSR
  • AppTree > serverless mode > should pass AppTree to NextPageContext
Expand output

● AppTree › serverless mode › should provide router context in AppTree on SSR

command failed with code 1

  174 |         code !== 0
  175 |       ) {
> 176 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  177 |       }
  178 |
  179 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:176:23)

● AppTree › serverless mode › should provide router context in AppTree on CSR

command failed with code 1

  174 |         code !== 0
  175 |       ) {
> 176 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  177 |       }
  178 |
  179 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:176:23)

● AppTree › serverless mode › should pass AppTree to NextPageContext

command failed with code 1

  174 |         code !== 0
  175 |       ) {
> 176 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  177 |       }
  178 |
  179 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:176:23)

test/development/acceptance/ReactRefreshLogBox.test.ts

  • ReactRefreshLogBox > module init error not shown
Expand output

● ReactRefreshLogBox › module init error not shown

expect(received).toMatchSnapshot()

Snapshot name: `ReactRefreshLogBox module init error not shown 1`

- Snapshot  - 2
+ Received  + 2

- index.js (4:14) @ eval
+ index.js (4:8) @ <unknown>

    2 | // top offset for snapshot
    3 | import * as React from 'react';
  > 4 | throw new Error('no')
-     |      ^
+     |        ^
    5 | class ClassDefault extends React.Component {
    6 |   render() {
    7 |     return <h1>Default Export</h1>;

  742 |           (
  743 |             document
> 744 |               .querySelector('body > nextjs-portal')
      |                ^
  745 |               .shadowRoot.querySelector(
  746 |                 '#nextjs__container_errors_desc a:nth-of-type(1)'
  747 |               ) as any

  at Object.<anonymous> (development/acceptance/ReactRefreshLogBox.test.ts:744:16)

test/integration/500-page/test/index.test.js

  • 500 Page Support > serverless mode > should use pages/500
  • 500 Page Support > serverless mode > should set correct status code with pages/500
  • 500 Page Support > serverless mode > should not error when visited directly
  • 500 Page Support > serverless mode > should output 500.html during build
  • 500 Page Support > serverless mode > should add /500 to pages-manifest correctly
Expand output

● 500 Page Support › serverless mode › should use pages/500

command failed with code 1

  174 |         code !== 0
  175 |       ) {
> 176 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  177 |       }
  178 |
  179 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:176:23)

● 500 Page Support › serverless mode › should set correct status code with pages/500

command failed with code 1

  174 |         code !== 0
  175 |       ) {
> 176 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  177 |       }
  178 |
  179 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:176:23)

● 500 Page Support › serverless mode › should not error when visited directly

command failed with code 1

  174 |         code !== 0
  175 |       ) {
> 176 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  177 |       }
  178 |
  179 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:176:23)

● 500 Page Support › serverless mode › should output 500.html during build

command failed with code 1

  174 |         code !== 0
  175 |       ) {
> 176 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  177 |       }
  178 |
  179 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:176:23)

● 500 Page Support › serverless mode › should add /500 to pages-manifest correctly

command failed with code 1

  174 |         code !== 0
  175 |       ) {
> 176 |         return reject(new Error(`command failed with code ${code}`))
      |                       ^
  177 |       }
  178 |
  179 |       resolve({

  at ChildProcess.<anonymous> (lib/next-test-utils.js:176:23)

ijjk avatar Oct 02 '21 17:10 ijjk

Stats from current PR

Default Build (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
buildDuration 12.4s 12.5s ⚠️ +187ms
buildDurationCached 3.6s 3.3s -279ms
nodeModulesSize 183 MB 183 MB ⚠️ +1.17 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
/ failed reqs 0 0
/ total time (seconds) 2.725 8.247 ⚠️ +5.52
/ avg req/sec 917.37 303.14 ⚠️ -614.23
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.322 9.147 ⚠️ +7.83
/error-in-render avg req/sec 1890.42 273.33 ⚠️ -1617.09
Client Bundles (main, webpack, commons)
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
779.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42.2 kB 42.2 kB
main-HASH.js gzip 26.9 kB 26.9 kB
webpack-HASH.js gzip 1.45 kB 1.45 kB
Overall change 70.8 kB 70.8 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
polyfills-a4..dd70.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
_app-HASH.js gzip 977 B 977 B
_error-HASH.js gzip 194 B 194 B
amp-HASH.js gzip 311 B 311 B
css-HASH.js gzip 328 B 328 B
dynamic-HASH.js gzip 2.67 kB 2.67 kB
head-HASH.js gzip 351 B 351 B
hooks-HASH.js gzip 918 B 918 B
image-HASH.js gzip 4.15 kB 4.15 kB
index-HASH.js gzip 260 B 260 B
link-HASH.js gzip 1.66 kB 1.66 kB
routerDirect..HASH.js gzip 320 B 320 B
script-HASH.js gzip 386 B 386 B
withRouter-HASH.js gzip 319 B 319 B
bb14e60e810b..30f.css gzip 125 B 125 B
Overall change 13 kB 13 kB
Client Build Manifests
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
_buildManifest.js gzip 494 B 494 B
Overall change 494 B 494 B
Rendered Page Sizes
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
index.html gzip 539 B 539 B
link.html gzip 551 B 551 B
withRouter.html gzip 533 B 533 B
Overall change 1.62 kB 1.62 kB

Default Build with SWC (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
buildDuration 6.5s 6.5s ⚠️ +46ms
buildDurationCached 3.3s 3.2s -87ms
nodeModulesSize 183 MB 183 MB ⚠️ +1.17 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
/ failed reqs 0 0
/ total time (seconds) 2.714 8.23 ⚠️ +5.52
/ avg req/sec 921.11 303.77 ⚠️ -617.34
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.317 9.082 ⚠️ +7.77
/error-in-render avg req/sec 1898.78 275.26 ⚠️ -1623.52
Client Bundles (main, webpack, commons)
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
675-HASH.js gzip 13.8 kB 13.8 kB
770.HASH.js gzip 178 B 178 B
framework-HASH.js gzip 50.7 kB 50.7 kB
main-HASH.js gzip 34.9 kB 34.9 kB
webpack-HASH.js gzip 1.64 kB 1.64 kB
Overall change 101 kB 101 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
polyfills-a4..dd70.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
_app-HASH.js gzip 1.33 kB 1.33 kB
_error-HASH.js gzip 180 B 180 B
amp-HASH.js gzip 315 B 315 B
css-HASH.js gzip 331 B 331 B
dynamic-HASH.js gzip 2.79 kB 2.79 kB
head-HASH.js gzip 356 B 356 B
hooks-HASH.js gzip 637 B 637 B
image-HASH.js gzip 573 B 573 B
index-HASH.js gzip 262 B 262 B
link-HASH.js gzip 2.2 kB 2.2 kB
routerDirect..HASH.js gzip 326 B 326 B
script-HASH.js gzip 393 B 393 B
withRouter-HASH.js gzip 322 B 322 B
bb14e60e810b..30f.css gzip 125 B 125 B
Overall change 10.1 kB 10.1 kB
Client Build Manifests
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
_buildManifest.js gzip 511 B 511 B
Overall change 511 B 511 B
Rendered Page Sizes
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
index.html gzip 539 B 539 B
link.html gzip 551 B 551 B
withRouter.html gzip 532 B 532 B
Overall change 1.62 kB 1.62 kB
Commit: 5bafaa400f2c2d910b740f5da5886dde6df22a50

ijjk avatar Oct 02 '21 17:10 ijjk

Some tricky conflicts going on. I just got a comment from @sokra in another thread, but many of the failing test errors seem to be Webpack-related, would appreciate a first-glance review for sure.

ctjlewis avatar Oct 02 '21 17:10 ctjlewis

Failing test suites

Commit: e2ff1d0b83dfc393f208d4b0b54ff5053a0505a3

test/development/acceptance/ReactRefreshLogBox.test.ts

  • ReactRefreshLogBox > module init error not shown
Expand output

● ReactRefreshLogBox › module init error not shown

expect(received).toMatchSnapshot()

Snapshot name: `ReactRefreshLogBox module init error not shown 1`

- Snapshot  - 2
+ Received  + 2

- index.js (4:14) @ eval
+ index.js (4:8) @ <unknown>

    2 | // top offset for snapshot
    3 | import * as React from 'react';
  > 4 | throw new Error('no')
-     |      ^
+     |        ^
    5 | class ClassDefault extends React.Component {
    6 |   render() {
    7 |     return <h1>Default Export</h1>;

  242 |             return <h1>Default Export</h1>;
  243 |           }
> 244 |         }
      |          ^
  245 |
  246 |         export default ClassDefault;
  247 |       `

  at Object.<anonymous> (development/acceptance/ReactRefreshLogBox.test.ts:244:53)

ijjk avatar Jan 14 '22 07:01 ijjk

Stats from current PR

Default Build (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
buildDuration 14.8s 15s ⚠️ +223ms
buildDurationCached 3.3s 3.3s ⚠️ +12ms
nodeModulesSize 354 MB 354 MB ⚠️ +1.18 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
/ failed reqs 0 0
/ total time (seconds) 2.969 8.567 ⚠️ +5.6
/ avg req/sec 842.03 291.83 ⚠️ -550.2
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.375 8.183 ⚠️ +6.81
/error-in-render avg req/sec 1818.41 305.5 ⚠️ -1512.91
Client Bundles (main, webpack, commons)
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
450.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42.2 kB 42.2 kB
main-HASH.js gzip 27.2 kB 27.2 kB
webpack-HASH.js gzip 1.44 kB 1.44 kB
Overall change 71 kB 71 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
_app-HASH.js gzip 1.37 kB 1.37 kB
_error-HASH.js gzip 194 B 194 B
amp-HASH.js gzip 312 B 312 B
css-HASH.js gzip 326 B 326 B
dynamic-HASH.js gzip 2.37 kB 2.37 kB
head-HASH.js gzip 350 B 350 B
hooks-HASH.js gzip 919 B 919 B
image-HASH.js gzip 4.7 kB 4.7 kB
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 2.13 kB 2.13 kB
routerDirect..HASH.js gzip 321 B 321 B
script-HASH.js gzip 383 B 383 B
withRouter-HASH.js gzip 318 B 318 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 14.1 kB 14.1 kB
Client Build Manifests
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
_buildManifest.js gzip 459 B 459 B
Overall change 459 B 459 B
Rendered Page Sizes
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
index.html gzip 530 B 530 B
link.html gzip 544 B 544 B
withRouter.html gzip 525 B 525 B
Overall change 1.6 kB 1.6 kB

Default Build with SWC (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
buildDuration 16.2s 16.6s ⚠️ +367ms
buildDurationCached 3.3s 3.4s ⚠️ +40ms
nodeModulesSize 354 MB 354 MB ⚠️ +1.18 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
/ failed reqs 0 0
/ total time (seconds) 3.031 10.276 ⚠️ +7.24
/ avg req/sec 824.88 243.29 ⚠️ -581.59
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.372 8.391 ⚠️ +7.02
/error-in-render avg req/sec 1822.06 297.93 ⚠️ -1524.13
Client Bundles (main, webpack, commons)
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
450.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42.3 kB 42.3 kB
main-HASH.js gzip 27.3 kB 27.3 kB
webpack-HASH.js gzip 1.44 kB 1.44 kB
Overall change 71.2 kB 71.2 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
_app-HASH.js gzip 1.35 kB 1.35 kB
_error-HASH.js gzip 180 B 180 B
amp-HASH.js gzip 305 B 305 B
css-HASH.js gzip 321 B 321 B
dynamic-HASH.js gzip 2.36 kB 2.36 kB
head-HASH.js gzip 342 B 342 B
hooks-HASH.js gzip 906 B 906 B
image-HASH.js gzip 4.72 kB 4.72 kB
index-HASH.js gzip 256 B 256 B
link-HASH.js gzip 2.19 kB 2.19 kB
routerDirect..HASH.js gzip 314 B 314 B
script-HASH.js gzip 375 B 375 B
withRouter-HASH.js gzip 309 B 309 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 14 kB 14 kB
Client Build Manifests
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
_buildManifest.js gzip 458 B 458 B
Overall change 458 B 458 B
Rendered Page Sizes
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
index.html gzip 531 B 531 B
link.html gzip 544 B 544 B
withRouter.html gzip 526 B 526 B
Overall change 1.6 kB 1.6 kB
Commit: e2ff1d0b83dfc393f208d4b0b54ff5053a0505a3

ijjk avatar Jan 14 '22 07:01 ijjk

Stats from current PR

Default Build (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
buildDuration 13.9s 14.1s ⚠️ +157ms
buildDurationCached 3.1s 3.2s ⚠️ +31ms
nodeModulesSize 354 MB 354 MB ⚠️ +1.18 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
/ failed reqs 0 0
/ total time (seconds) 2.872 7.934 ⚠️ +5.06
/ avg req/sec 870.34 315.12 ⚠️ -555.22
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.325 8.527 ⚠️ +7.2
/error-in-render avg req/sec 1886.33 293.2 ⚠️ -1593.13
Client Bundles (main, webpack, commons)
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
450.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42.2 kB 42.2 kB
main-HASH.js gzip 27.2 kB 27.2 kB
webpack-HASH.js gzip 1.44 kB 1.44 kB
Overall change 71 kB 71 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
_app-HASH.js gzip 1.37 kB 1.37 kB
_error-HASH.js gzip 194 B 194 B
amp-HASH.js gzip 312 B 312 B
css-HASH.js gzip 326 B 326 B
dynamic-HASH.js gzip 2.37 kB 2.37 kB
head-HASH.js gzip 350 B 350 B
hooks-HASH.js gzip 919 B 919 B
image-HASH.js gzip 4.7 kB 4.7 kB
index-HASH.js gzip 263 B 263 B
link-HASH.js gzip 2.13 kB 2.13 kB
routerDirect..HASH.js gzip 321 B 321 B
script-HASH.js gzip 383 B 383 B
withRouter-HASH.js gzip 318 B 318 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 14.1 kB 14.1 kB
Client Build Manifests
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
_buildManifest.js gzip 459 B 459 B
Overall change 459 B 459 B
Rendered Page Sizes
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
index.html gzip 530 B 530 B
link.html gzip 544 B 544 B
withRouter.html gzip 525 B 525 B
Overall change 1.6 kB 1.6 kB

Default Build with SWC (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
buildDuration 15.7s 15.9s ⚠️ +240ms
buildDurationCached 3.1s 3.2s ⚠️ +33ms
nodeModulesSize 354 MB 354 MB ⚠️ +1.18 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
/ failed reqs 0 0
/ total time (seconds) 2.903 8.468 ⚠️ +5.57
/ avg req/sec 861.1 295.24 ⚠️ -565.86
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.281 7.904 ⚠️ +6.62
/error-in-render avg req/sec 1952.07 316.29 ⚠️ -1635.78
Client Bundles (main, webpack, commons)
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
450.HASH.js gzip 179 B 179 B
framework-HASH.js gzip 42.3 kB 42.3 kB
main-HASH.js gzip 27.3 kB 27.3 kB
webpack-HASH.js gzip 1.44 kB 1.44 kB
Overall change 71.2 kB 71.2 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
polyfills-HASH.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
_app-HASH.js gzip 1.35 kB 1.35 kB
_error-HASH.js gzip 180 B 180 B
amp-HASH.js gzip 305 B 305 B
css-HASH.js gzip 321 B 321 B
dynamic-HASH.js gzip 2.36 kB 2.36 kB
head-HASH.js gzip 342 B 342 B
hooks-HASH.js gzip 906 B 906 B
image-HASH.js gzip 4.72 kB 4.72 kB
index-HASH.js gzip 256 B 256 B
link-HASH.js gzip 2.19 kB 2.19 kB
routerDirect..HASH.js gzip 314 B 314 B
script-HASH.js gzip 375 B 375 B
withRouter-HASH.js gzip 309 B 309 B
85e02e95b279..7e3.css gzip 107 B 107 B
Overall change 14 kB 14 kB
Client Build Manifests
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
_buildManifest.js gzip 458 B 458 B
Overall change 458 B 458 B
Rendered Page Sizes
vercel/next.js canary ctjlewis/next.js isolate-component-requires Change
index.html gzip 531 B 531 B
link.html gzip 544 B 544 B
withRouter.html gzip 526 B 526 B
Overall change 1.6 kB 1.6 kB
Commit: 5351f694b0ec5fa385477a3390fb1130583c9568

ijjk avatar Jan 14 '22 08:01 ijjk

Stats from current PR

Default Build (Decrease detected ✓)

General Overall increase vercel/next.js canary ctjlewis/next.js isolate-component-requires Change buildDuration 13.9s 14.1s +157ms buildDurationCached 3.1s 3.2s +31ms nodeModulesSize 354 MB 354 MB +1.18 kB Page Load Tests Overall decrease vercel/next.js canary ctjlewis/next.js isolate-component-requires Change / failed reqs 0 0 ✓ / total time (seconds) 2.872 7.934 +5.06 / avg req/sec 870.34 315.12 -555.22 /error-in-render failed reqs 0 0 ✓ /error-in-render total time (seconds) 1.325 8.527 +7.2 /error-in-render avg req/sec 1886.33 293.2 -1593.13 Client Bundles (main, webpack, commons) Legacy Client Bundles (polyfills) Client Pages Client Build Manifests Rendered Page Sizes Default Build with SWC (Decrease detected ✓) Commit: 5351f69

Pretty tough hit to render speed.

ctjlewis avatar Jan 14 '22 08:01 ctjlewis