Commit graph

44 commits

Author SHA1 Message Date
Sebastian Silbermann
8eb701c19a
Combine necessary file for edge route in size calculation (#65053)
Closes NEXT-3228
2024-04-26 19:57:22 +02:00
JJ Kasper
49b4331e26
Reduce memory/cache overhead from over loader processing (#62005)
In `v14.0.2-canary.1` users started noticing more memory errors
especially with many edge runtime configured pages. After investigation
it seems this can be related to the additional transpiling we configured
in https://github.com/vercel/next.js/pull/59569 and
https://github.com/vercel/next.js/pull/57784

To help alleviate this we are updating the default swc loader to have an
additional check to see if no special features such as `next/font`,
`next/dynamic`, or `use server/client` directives are present and then
no-oping in the loader to avoid additional overhead for a majority of
modules.

For monitoring regressions our `stats-app` has been updated with
repeated edge-ssr routes to hopefully help us keep an eye on memory or
cache size issues.

x-ref: NEXT-2430
x-ref: NEXT-2395
x-ref: NEXT-2299
x-ref: NEXT-2324
x-ref: NEXT-2373

Closes NEXT-2479
2024-02-13 22:40:19 +00:00
Zack Tanner
54a0e05309
tweak stats action to pull in runtime sizes (#58005)
This wasn't working previously so updated the glob & script to properly track changes to our bundled next runtimes

Should now be appended to the bottom of the PR stats action, eg:
![CleanShot 2023-11-03 at 13 49 58@2x](https://github.com/vercel/next.js/assets/1939140/54319a42-5a32-4e39-90c2-6ec07442ec73)
2023-11-03 23:39:37 +00:00
Jimmy Lai
35a99232c0
misc: tweak stats github action (#56694)
This PR adds a few tweaks to our Github actions PR:
- expand by default the main section
- add some heuristics to not show hash/id changes in the diff view
- add some heuristics to not show increase/decrease size when it's too small (100 bytes is noise most often)
- add rendering runtimes to the list of tracked files


after vs before

![CleanShot 2023-10-11 at 14 56 36@2x](https://github.com/vercel/next.js/assets/11064311/548781bc-e893-45d1-aca4-de73b2b30299)

![CleanShot 2023-10-11 at 14 57 11@2x](https://github.com/vercel/next.js/assets/11064311/8e1c77e3-bed5-46ec-a756-62496df6729e)
2023-10-12 08:27:44 +00:00
Leah
542c4fc26a
chore: update to pnpm@8.6.11 (#50923)
https://github.com/pnpm/pnpm/releases/tag/v8.0.0
2023-08-04 19:40:20 +00:00
Steven
525ffb4334
chore: remove experimental appDir: true from tests (#52291)
The experimental flag is no longer needed.

https://nextjs.org/blog/next-13-4
2023-07-05 19:17:29 -07:00
Jan Kaifer
16cf9a8b83
Remove serverComponents from next.conf.js because it's unused (#43805) 2022-12-07 15:57:03 +01:00
JJ Kasper
45c36e66d8
Enable swcMinify by default (#41506)
x-ref: [slack
thread](https://vercel.slack.com/archives/CGU8HUTUH/p1666067928896099?thread_ts=1666066448.770739&cid=CGU8HUTUH)
2022-10-17 23:33:04 -07:00
JJ Kasper
c66b8f3926
Update bench options in stats-config (#41432)
x-ref:
https://github.com/vercel/next.js/actions/runs/3252514635/jobs/5338830017
x-ref:
https://github.com/vercel/next.js/actions/runs/3250842765/jobs/5335182082
2022-10-14 18:17:45 -07:00
JJ Kasper
77c8a2c4dd
Add missing release stats config for app (#40805)
Follow-up to https://github.com/vercel/next.js/pull/40780 adds the extra
config that is still needed for release stats.

x-ref:
https://github.com/vercel/next.js/actions/runs/3103134847/jobs/5026594626
2022-09-22 09:37:00 -07:00
JJ Kasper
f51e49f8d5
Update stats config for release stats (#40780)
This keeps the necessary config for release stats for app dir 

x-ref: https://github.com/vercel/next.js/pull/40776
Fixes:
https://github.com/vercel/next.js/actions/runs/3102008544/jobs/5025346767
2022-09-21 22:50:08 -07:00
Jiachi Liu
cbfab2a3b7
Strip internal pages for pagesDir in app edge ssr (#40776)
For app edge SSR, we don't need any internal pages for it since it's
handled by app-renderer. This results around reducing 20KB from app edge
SSR

# Changes
* Strip those internal pages modules when it's in app edge SSR
* Minimize edge SSR chunk to see the tree-shake result
* Add bundle analyzer with switcher in stats-app for testing. Using
`TEST_ANAYLYSE=1` to build stats-app for testing
2022-09-21 17:18:18 -07:00
Jiachi Liu
27e0b1293b
Add edge ssr to pr stats (#39621)
Monitoring edge-ssr bundle size in PR stats

change the react version in stats-app to 18
checking size of edge ssr page
2022-08-15 13:28:31 -05:00
JJ Kasper
9222ca9f3f
Add dev/start timing to PR stats (#38525)
* Add dev/start timing to PR stats

* get port for dev

* add dep

* update field names
2022-07-11 14:54:57 -05:00
Gal Schlezinger
708688dd26
[edge] enable edge compiler source maps by default (#38365)
since we no longer have a single compiler for browser & edge, we can enable
source map generation by default for all edge functions. This would make it
much easier to debug and understand what's happening when deploying to prod
as the log statements will show us the actual code location instead of post
bundling and minified location.

This also removes the experimental flag as it's not needed anymore.
2022-07-06 18:17:57 +00:00
JJ Kasper
5d0c3edda3
Add middleware size stats (#37519)
This will allow us to track base middleware size in our PR stats.
2022-06-07 17:05:48 +00:00
Tobias Koppers
94ad03385b
remove commons chunk config (#34445)
This removes the config for the `commons` chunk.

I think the idea was that modules are that in all pages are put into a `commons` chunk, but that breaks when next/dynamic comes into play, which also creates chunks. So the `totalPages` condition is broken and could lead to too many modules placed into the commons chunk.

Example: 2 pages, each has one next/dynamic. Both on demand chunks include module A. page 1 includes module B and next/dynamic on page 2 includes module B. A and B are placed into commons. commonjs chunk is loaded in page 1 and both next/dynamic. Page 1 would load module A even while it doesn't need it.

## 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 by running `yarn lint`
2022-02-19 22:26:54 +00:00
JJ Kasper
390e7bd07e
Remove extra config for PR stats (#30478) 2021-10-27 14:30:39 -05:00
Tim Neutkens
bc3ab3ce94
Move swcMinify out of experimental (#29810) 2021-10-25 13:49:11 +02:00
JJ Kasper
61409dd615
Update stats-config for release stats (#29654) 2021-10-05 17:49:24 -05:00
Tim Neutkens
7d664d5b36
Add stats config for SWC (#28883)
* Add stats config for SWC

* Remove stats for deprecated mode

* Include native binaries in local linking

* Expose minify in next-swc

* Build next-swc binaries

* Only upload changed binary artifact

* Build next-swc binaries

* Expose minify in js binding

* Use new minify function in terser plugin

* Build next-swc binaries

* Build next-swc binaries

* Build next-swc binaries

* Pass pagesDir option to SWC for next/dynamic

* Build next-swc binaries

* Add spans for next-trace-entrypoints-plugin

* Fix linting

Co-authored-by: Maia Teegarden <dev@padmaia.rocks>
Co-authored-by: padmaia <padmaia@users.noreply.github.com>
Co-authored-by: timneutkens <timneutkens@users.noreply.github.com>
2021-09-14 18:13:11 +02:00
JJ Kasper
556216b1ad
Add page with next/image to stats-app (#26973)
* Add page with next/image to stats-app

* Update stats-config

* Update globs

* Only run prettier on js outputs

* only add image page for non-webpack 4 mode

* update config

* Re-add moving page chunks
2021-07-07 09:50:24 -05:00
Tim Neutkens
f5958fdc4f
Simplify stats action (#26751) 2021-06-30 11:41:55 +02:00
Tim Neutkens
e1502bc9a5
Enable webpack5 for all apps (#25639)
* Enable webpack 5 by default for all apps

Still provides a way to opt-out using `webpack5: false` in next.config.js. Also throws an error for `future.webpack5`.

* Update tests

* Update test to run on webpack 4 instead of webpack 5

* disable webpack5 for legacy tests

* Fix stats-config for webpack4

* update tests

* update size for webpack4 test

* move basic suite first

* update basic test

* Add logs

* remove outdated testFutureDependencies job

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-06-07 15:48:29 -05:00
Tobias Koppers
cc246cdc41
add css to the stats-app (#24228)
add a page with CSS to the stats app

We should compare stats for CSS too
2021-04-19 17:42:40 +00:00
Tobias Koppers
1c2ee7c6b8
improve pr stats action (#24086)
* add cache build duration tracking
* default = webpack 5
* better hash handling
* allow to opt-out of webpack5 via `future.webpack5: false`
2021-04-15 11:46:56 +00:00
Tobias Koppers
11900431fa
upgrade webpack 5 for empty entrypoint fix (#21353)
fixes a problem where entrypoints are nearly empty.
2021-01-19 19:15:45 +00:00
Tobias Koppers
b02df3f487
improve splitChunks config for webpack 5 (#21208) 2021-01-17 20:05:47 +01:00
Joe Haddad
30c2dfdc47
Remove old modern mode experiment (#19275)
This PR removes the modern mode experiment because:

- It does not yield meaningful bundle size wins when compared to other initiatives we've taken
- It's not compatible with webpack 5 (which we're upgrading to)
- It's currently broken and causes most apps to malfunction
- There's no champion currently owning the experiment

We can re-introduce this in the future when we'd like to make it a default for all Next.js apps.

Note: **Next.js still supports Differential Loading (`nomodule`) and does it by default.** This PR strictly removes the experimental modern _syntax_, and does not disable our existing modern/legacy polyfilling.

---

Fixes #19200
Fixes #18960
Fixes #14707
Fixes #14465
2020-11-18 18:30:00 +00:00
JJ Kasper
059741ea00
Update stats-config for new polyfills location (#15584)
This makes sure to not group the polyfills chunk in with the client bundles group now that it is output under chunks instead of runtime
2020-07-28 15:58:13 +00:00
Joe Haddad
a92e976231
Remove remaining granular chunks references (#13672)
This removes remaining references to `granularChunks` in configs, error messages, and comments.

Also removed the `process.env.__NEXT_GRANULAR_CHUNKS` value.

---

Follow up to: https://github.com/vercel/next.js/pull/13663
2020-06-02 14:45:07 +00:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
JJ Kasper
0b51b2340a
Add stats config for load tests (#11868) 2020-04-13 22:00:12 -04:00
Joe Haddad
18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00
Joe Haddad
0022633d37
Track framework bundle separately (#9322) 2019-11-05 16:30:03 -05:00
Joe Haddad
42fca6fd15
Track polyfill file changes (#9321) 2019-11-05 16:15:42 -05:00
Joe Haddad
d031cf64df
Ensure requests are resolved as directories (#8742)
* Ensure requests are resolved as directories
`resolveRequest` will strip down to baseDir if there's no trailing slash as it assumes you passed a file.

* Disable telemetry for PR Stats
2019-09-14 17:41:05 -04:00
JJ Kasper
8444c1ffba
Update stats-config to be more deterministic (#8679) 2019-09-09 16:06:13 -05:00
JJ Kasper
110c83fa44 Update commons glob for granular chunks (#8622) 2019-09-05 00:48:09 +02:00
JJ Kasper
12c211bdbe Add config for diffing fetched pages (#8492) 2019-08-23 19:36:44 -04:00
Joe Haddad
df4f600291
🗜 Optimize client-side routing manifest (#8429)
* Optimize client-side routing manifest

* Turn on granularChunks for tests

* Add row for build manifest

* Hack it
2019-08-20 02:28:09 -04:00
JJ Kasper
e539af46fa
Update to use dynamic port for stats-app (#8336)
* Update to use dynamic port for stats-app

* Update main.workflow
2019-08-12 13:53:11 -05:00
JJ Kasper
fc7e235f2c Followup optimizations for new experimentalPrerender (#8287)
* Add checking for hybrid AMP during static check

* Update to always hit server for prerender data

* Add removing of SPR code when not used

* Add checking for hybrid AMP during static check

* Update to always hit server for prerender data

* Add removing of SPR code when not used

* Update dead code elimination
2019-08-11 21:56:57 -04:00
JJ Kasper
f01af7cefb Add config/test app for new PR stats set-up (#8317)
* Add config/test app for new PR stats set-up

* Move config/test app to test folder
2019-08-12 00:28:41 +02:00