-
-
Notifications
You must be signed in to change notification settings - Fork 176
[code-infra] Add bundle size monitor #1791
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
Conversation
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Bundle size report🚫 No bundle size snapshot found for base commit 4285f43. Total Size Change: +1.45MB(0.00%) - Total Gzip Change: +491KB(0.00%) @base-ui-components/react parsed: Show 31 more bundle changes@base-ui-components/react/number-field parsed: |
commit: |
return { | ||
id: entrypoint, | ||
import: entrypoint, | ||
externals, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessary if @base-ui-components/react
adds an export condition for ./package.json
. Then we can just return entrypoint
from this function and the bundle size monitor will infer the externals from the peer dependencies. Right now it has no real way to find the package.json location reliably for a module. (besides using a custom resolver)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind exporting package.json. Can you do it in this PR or prefer me to open a new one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had it before in this PR, will bring it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen that many packages adopted this convention, it will become obsolete though once findPackageJSON
becomes more stable
I checked https://bundlephobia.com/package/@base-ui-components/[email protected] and it shows drastically different values. Do you have any idea where this difference might come from? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All right, let's see it in action.
Also working on an experimental vite version of the bundle size monitor, it shows similar results to the webpack one within a tolerance of ~1KB. bundlephobia is built with |
Porting the bundle size monitor from core. This establishes a baseline. This bundles each entrypoint with its dependencies. Bundles are stored in S3 for comparison. Peer dependencies are ignored. To inspect the created bundles run
examples: