kripod / glaze

CSS-in-JS microlibrary for making design systems approachable with React
https://glaze.js.org/
MIT License
414 stars 10 forks source link

Analyze runtime bundle size and track its changes over time #13

Open kripod opened 4 years ago

kripod commented 4 years ago

Motivation

A significant amount of code gets compiled by treat, which will not be part of the runtime. Also, only the OptimizedStyleInjector may get instantiated (besides NullStyleInjector) on the client side.

In addition to above, OptimizedStyleInjector and OptimizedRuleManager can be tree-shaken when no <StyleInjectorProvider> is used.

Is there a tool for analyzing production bundle sizes accurately, given the constraints above?

kripod commented 4 years ago

Using bundlesize is partly sufficient. Fuzzy matching may help ignoring files which are not included in the final bundle.

tatchi commented 4 years ago

An idea might be to have a sample app which uses glaze and build it with each PR so we can track the impact of the changes on a final app. Similar to what nextjs does with https://github.com/zeit/next-stats-action