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

Add warning for large amount of page data #29956

Merged
merged 5 commits into from Oct 25, 2021

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Oct 16, 2021

This adds a warning when a large amount of page data is returned (an initial arbitrary amount of 128KB was used), to help users catch when they are returning more page data than they need to render a page which can impact performance.

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

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

Copy link

@reevesPAC reevesPAC left a comment

Choose a reason for hiding this comment

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

ok thank you for the edu. on-pertinent issues while also gracefully alleviating unnecessary informatics, (e.g. 'consecutive lines iterating the point in terms and colloquial - idioms and or concurrent acronyms That tend to confuse anyone. Especially someone who is "green" - respectively with such techniques and terminologies.

@ijjk

This comment has been minimized.

errors/large-page-data.md Outdated Show resolved Hide resolved
errors/large-page-data.md Outdated Show resolved Hide resolved
test/e2e/prerender.test.ts Outdated Show resolved Hide resolved
Co-authored-by: Steven <steven@ceriously.com>
@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@ijjk
Copy link
Member Author

ijjk commented Oct 24, 2021

Failing test suites

Commit: 9dea696

test/development/basic-basepath/hmr.test.ts

  • basic HMR > Error Recovery > should recover from errors in the render function
  • basic HMR > Error Recovery > should recover after exporting an invalid page
  • basic HMR > Error Recovery > should recover after a bad return from the render function
  • basic HMR > Error Recovery > should recover after an error reported via SSR
Expand output

● basic HMR › Error Recovery › should recover from errors in the render function

TIMED OUT: /This is the about page/

  437 |
  438 |   if (hardError) {
> 439 |     throw new Error('TIMED OUT: ' + regex + '\n\n' + content)
      |           ^
  440 |   }
  441 |   return false
  442 | }

  at Object.check (lib/next-test-utils.js:439:11)
  at Object.<anonymous> (development/basic-basepath/hmr.test.ts:454:9)

● basic HMR › Error Recovery › should recover after exporting an invalid page

TIMED OUT: /This is the about page/

  437 |
  438 |   if (hardError) {
> 439 |     throw new Error('TIMED OUT: ' + regex + '\n\n' + content)
      |           ^
  440 |   }
  441 |   return false
  442 | }

  at Object.check (lib/next-test-utils.js:439:11)
  at Object.<anonymous> (development/basic-basepath/hmr.test.ts:509:9)

● basic HMR › Error Recovery › should recover after a bad return from the render function

TIMED OUT: /This is the about page/

  437 |
  438 |   if (hardError) {
> 439 |     throw new Error('TIMED OUT: ' + regex + '\n\n' + content)
      |           ^
  440 |   }
  441 |   return false
  442 | }

  at Object.check (lib/next-test-utils.js:439:11)
  at Object.<anonymous> (development/basic-basepath/hmr.test.ts:557:9)

● basic HMR › Error Recovery › should recover after an error reported via SSR

TIMED OUT: /an-expected-error-in-gip/

null

  437 |
  438 |   if (hardError) {
> 439 |     throw new Error('TIMED OUT: ' + regex + '\n\n' + content)
      |           ^
  440 |   }
  441 |   return false
  442 | }

  at Object.check (lib/next-test-utils.js:439:11)
  at Object.<anonymous> (development/basic-basepath/hmr.test.ts:495:17)

@ijjk
Copy link
Member Author

ijjk commented Oct 24, 2021

Stats from current PR

Default Build (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js warn/large-page-data Change
buildDuration 23.9s 24.2s ⚠️ +313ms
buildDurationCached 4.6s 4.6s -10ms
nodeModulesSize 196 MB 196 MB ⚠️ +903 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js warn/large-page-data Change
/ failed reqs 0 0
/ total time (seconds) 4.123 4.168 ⚠️ +0.04
/ avg req/sec 606.28 599.87 ⚠️ -6.41
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 2.106 2.194 ⚠️ +0.09
/error-in-render avg req/sec 1187.24 1139.55 ⚠️ -47.69
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js warn/large-page-data Change
450.126dd8f7..9662.js gzip 179 B 179 B
framework-89..a097.js gzip 42.2 kB 42.2 kB
main-07be34b..25ca.js gzip 27.7 kB 27.7 kB
webpack-7ed4..c253.js gzip 1.45 kB 1.45 kB
Overall change 71.5 kB 71.5 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js warn/large-page-data Change
polyfills-a4..dd70.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js warn/large-page-data Change
_app-e2cfdd4..f20e.js gzip 1.23 kB 1.23 kB
_error-6679c..c50e.js gzip 194 B 194 B
amp-e55eb6be..a860.js gzip 312 B 312 B
css-3561b6c4..ef9e.js gzip 327 B 327 B
dynamic-3814..830e.js gzip 2.38 kB 2.38 kB
head-0b292cc..7d7c.js gzip 350 B 350 B
hooks-a534e8..efa1.js gzip 635 B 635 B
image-07bccd..d945.js gzip 4.44 kB 4.44 kB
index-d12b47..75f9.js gzip 263 B 263 B
link-a8a0a12..1f88.js gzip 1.87 kB 1.87 kB
routerDirect..6a79.js gzip 321 B 321 B
script-e1458..a8d4.js gzip 383 B 383 B
withRouter-b..6929.js gzip 318 B 318 B
9a34b27eb3f9..27d.css gzip 125 B 125 B
Overall change 13.2 kB 13.2 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js warn/large-page-data Change
_buildManifest.js gzip 459 B 459 B
Overall change 459 B 459 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js warn/large-page-data Change
index.html gzip 535 B 535 B
link.html gzip 547 B 547 B
withRouter.html gzip 528 B 528 B
Overall change 1.61 kB 1.61 kB

Default Build with SWC
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js warn/large-page-data Change
buildDuration 20.5s 20.9s ⚠️ +384ms
buildDurationCached 4.8s 4.8s -18ms
nodeModulesSize 196 MB 196 MB ⚠️ +903 B
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js warn/large-page-data Change
/ failed reqs 0 0
/ total time (seconds) 4.058 4.136 ⚠️ +0.08
/ avg req/sec 616.09 604.47 ⚠️ -11.62
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 2.174 2.144 -0.03
/error-in-render avg req/sec 1150.02 1166.18 +16.16
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js warn/large-page-data Change
450.7d068857..3d20.js gzip 179 B 179 B
framework-c4..e2ed.js gzip 42.2 kB 42.2 kB
main-68b0ef4..85b2.js gzip 27.8 kB 27.8 kB
webpack-d7a7..87cd.js gzip 1.43 kB 1.43 kB
Overall change 71.6 kB 71.6 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js warn/large-page-data Change
polyfills-a4..dd70.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ijjk/next.js warn/large-page-data Change
_app-52a967b..3462.js gzip 1.22 kB 1.22 kB
_error-75368..09c0.js gzip 180 B 180 B
amp-cf07f655..892b.js gzip 305 B 305 B
css-b6dea8ae..a0c9.js gzip 321 B 321 B
dynamic-98bc..069b.js gzip 2.38 kB 2.38 kB
head-456f7ed..1249.js gzip 342 B 342 B
hooks-ec818d..6c73.js gzip 621 B 621 B
image-ae8cfd..a954.js gzip 4.46 kB 4.46 kB
index-36aacc..d008.js gzip 256 B 256 B
link-999ddff..ddc7.js gzip 1.9 kB 1.9 kB
routerDirect..664d.js gzip 314 B 314 B
script-968af..7dfa.js gzip 375 B 375 B
withRouter-c..91a4.js gzip 309 B 309 B
9a34b27eb3f9..27d.css gzip 125 B 125 B
Overall change 13.1 kB 13.1 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js warn/large-page-data Change
_buildManifest.js gzip 459 B 459 B
Overall change 459 B 459 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js warn/large-page-data Change
index.html gzip 533 B 533 B
link.html gzip 546 B 546 B
withRouter.html gzip 527 B 527 B
Overall change 1.61 kB 1.61 kB
Commit: 9dea696

@timneutkens timneutkens merged commit a25c1dd into vercel:canary Oct 25, 2021
@timneutkens timneutkens deleted the warn/large-page-data branch October 25, 2021 19:07
@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants