-
Notifications
You must be signed in to change notification settings - Fork 26.6k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Option to write "First Load Size" data to file #10383
Comments
Hey! We probably won't a file dedicated to file sizes as it's too specialized. You can self-compute this using |
I'd like to keep this open, it's an interesting idea. |
Is this something you'd take a PR for, if I was able to get approval from my company? The addition actually looks pretty straightforward in Thinking about it more, seems like the best approach could actually be writing out that entire data structure such that people can programmatically interact with the data in it, since people might want to assert static renderability or other things as well. |
We’d have to figure out the exact semantics, we’re currently focusing on other things (SSG, rewrites/redirects) but eventually we’ll add this when we know the right semantics needed to build these kind of tools. |
Heh, just saw #11066 and the comment there, nevermind then! |
This should be now possible with nextjs 9.5. See: https://nextjs.org/blog/next-9-5#persistent-caching-for-page-bundles Fixed by #13937 |
Stable hashes doesn't address the issue of trying to reason about the size of a page, since we'd still have to add up the bundle parts included in each page. Something like I know bundle size isn't everything when it comes to speed of delivery, but it's a pretty useful first line of defense against someone accidentally including something like |
Hey all, I wrote a tiny script that computes "first load sizes" of your next.js pages, and store them in a json file. https://github.com/izi-p/next-compute-first-load Feel free to use it 🥰 Thank you |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Feature request
Is your feature request related to a problem? Please describe.
We'd previously used the bundlesize package in CI in order to monitor the growth of our application and prevent accidental imports of test libs, etc. With the switch to the new chunking strategy, the hash-based names of the new chunks breaks this approach (we previously just watched
chunks/commons.*.js
). But the new "First Load Size" data could easily replace this functionality, if it were easily accessible (I'm not super keen on redirecting and parsing stdout).Describe the solution you'd like
Would it be possible to add a configuration option to next.config that enabled also writing the size data to a json file such that it could be then analyzed by other tools?
Describe alternatives you've considered
Capturing and parsing the stdout of a yarn build command.
The text was updated successfully, but these errors were encountered: