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 number of routes #27214

Merged
merged 8 commits into from
Jul 16, 2021

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Jul 15, 2021

This adds a warning when more than 1000 routes are added since it can have performance impacts and includes a document that we can add suggestions to reduce the number of routes being added.

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.

@ijjk ijjk marked this pull request as draft July 16, 2021 01:12
@ijjk

This comment has been minimized.

@ijjk ijjk marked this pull request as ready for review July 16, 2021 13:45
@ijjk
Copy link
Member Author

ijjk commented Jul 16, 2021

Stats from current PR

Default Build (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js add/routes-amount-warning Change
buildDuration 12.4s 12.4s ⚠️ +39ms
buildDurationCached 2.9s 2.9s -10ms
nodeModulesSize 49.4 MB 49.5 MB ⚠️ +1.73 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js add/routes-amount-warning Change
/ failed reqs 0 0
/ total time (seconds) 2.097 2.077 -0.02
/ avg req/sec 1192.39 1203.44 +11.05
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.089 1.117 ⚠️ +0.03
/error-in-render avg req/sec 2294.73 2238.9 ⚠️ -55.83
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js add/routes-amount-warning Change
359.HASH.js gzip 2.96 kB 2.96 kB
framework-HASH.js gzip 42 kB 42 kB
main-HASH.js gzip 20.9 kB 20.9 kB
webpack-HASH.js gzip 1.49 kB 1.49 kB
Overall change 67.4 kB 67.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js add/routes-amount-warning Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary ijjk/next.js add/routes-amount-warning Change
_app-HASH.js gzip 803 B 803 B
_error-HASH.js gzip 3.06 kB 3.06 kB
amp-HASH.js gzip 554 B 554 B
css-HASH.js gzip 329 B 329 B
hooks-HASH.js gzip 903 B 903 B
image-HASH.js gzip 5.6 kB 5.6 kB
index-HASH.js gzip 261 B 261 B
link-HASH.js gzip 1.66 kB 1.66 kB
routerDirect..HASH.js gzip 319 B 319 B
withRouter-HASH.js gzip 320 B 320 B
bb14e60e810b..30f.css gzip 125 B 125 B
Overall change 13.9 kB 13.9 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js add/routes-amount-warning Change
_buildManifest.js gzip 417 B 417 B
Overall change 417 B 417 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js add/routes-amount-warning Change
index.html gzip 529 B 529 B
link.html gzip 543 B 543 B
withRouter.html gzip 523 B 523 B
Overall change 1.59 kB 1.59 kB

Webpack 4 Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js add/routes-amount-warning Change
buildDuration 9.9s 9.9s -9ms
buildDurationCached 4s 3.9s -110ms
nodeModulesSize 49.4 MB 49.5 MB ⚠️ +1.73 kB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ijjk/next.js add/routes-amount-warning Change
/ failed reqs 0 0
/ total time (seconds) 2.11 2.096 -0.01
/ avg req/sec 1184.84 1192.68 +7.84
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.087 1.119 ⚠️ +0.03
/error-in-render avg req/sec 2299.98 2234.09 ⚠️ -65.89
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js add/routes-amount-warning Change
14.HASH.js gzip 2.98 kB 2.98 kB
677f882d2ed8..HASH.js gzip 13.7 kB 13.7 kB
framework.HASH.js gzip 41.8 kB 41.8 kB
main-HASH.js gzip 8.39 kB 8.39 kB
webpack-HASH.js gzip 1.19 kB 1.19 kB
Overall change 68 kB 68 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js add/routes-amount-warning Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary ijjk/next.js add/routes-amount-warning Change
_app-HASH.js gzip 791 B 791 B
_error-HASH.js gzip 3.76 kB 3.76 kB
amp-HASH.js gzip 552 B 552 B
css-HASH.js gzip 333 B 333 B
hooks-HASH.js gzip 910 B 910 B
index-HASH.js gzip 230 B 230 B
link-HASH.js gzip 1.64 kB 1.64 kB
routerDirect..HASH.js gzip 297 B 297 B
withRouter-HASH.js gzip 293 B 293 B
e025d2764813..52f.css gzip 125 B 125 B
Overall change 8.93 kB 8.93 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js add/routes-amount-warning Change
_buildManifest.js gzip 420 B 420 B
Overall change 420 B 420 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js add/routes-amount-warning Change
index.html gzip 576 B 576 B
link.html gzip 590 B 590 B
withRouter.html gzip 569 B 569 B
Overall change 1.74 kB 1.74 kB
Commit: d35b08f

@ijjk ijjk requested a review from styfle July 16, 2021 14:32
@kodiakhq kodiakhq bot merged commit 14dd7c2 into vercel:canary Jul 16, 2021
@ijjk ijjk deleted the add/routes-amount-warning branch July 16, 2021 16:21
flybayer pushed a commit to blitz-js/next.js that referenced this pull request Aug 19, 2021
This adds a warning when more than 1024 routes are added since it can have performance impacts and includes a document that we can add suggestions to reduce the number of routes being added. 

## 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
@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 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.

2 participants