-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Pigment CSS is 16.2KB gzipped JavaScript in MUI’s example app #44113
Comments
In general, we are talking about two different things here, runtime performance vs bundle size. In general, we made a decision to make the theme available in the runtime too for some use-cases, like having access to it in the rendering logic etc. So, I would say that part of the bundle size increase is expected. In terms of how much code is being executed during runtime, from my understanding all of it is related to:
So zero-runtime namely means that there is no logic in generating stylesheet during runtime - this is the thing that is different than Emotion. @brijeshb42 can correct me or expand further. Now, we may need to document these things so we don't set false expectations. A question - have you compared a plain app using Emotion vs Pigment CSS? Is this related to adding Material UI too in the bundle? We can likely move this issue to the Pigment CSS repository |
Current bundle size for |
Idk whether this issue can be improved by rethinking how you use the PigmentCSS’ API (styled vs css), or by optimizing runtime implications of the
|
@brijeshb42 Do you see any potential opportunity to improve the bundle size? otherwise, I think we should close this issue. |
No opportunity if we want to keep the runtime theme generation logic from Material UI. |
Steps to reproduce
Link to live example
Steps:
rollup-plugin-visualizer
so you could visualize the resulting bundlenpm run build
rollup-plugin-visualizer
(see example below)Current behavior
zero-runtime-theme.js
is 7.16KB gzipped@pigment-css/react/build
is 6.74KB gzippedTotal: 16.22KB gzipped
Expected behavior
Smaller JavaScript footprint
Context
We should evaluate the runtime implications of some PigmentCSS' API usage, such as:
styled
that results in extra JS outputYour environment
npx @mui/envinfo
Search keywords: pigmentcss, pigment, bundling, final, emotion, zero runtime
The text was updated successfully, but these errors were encountered: