facebook / stylex

StyleX is the styling system for ambitious user interfaces.
https://stylexjs.com
MIT License
8.34k stars 307 forks source link

Revert "fix: Keep units for 0 values (#532)" #577

Closed nmn closed 4 months ago

nmn commented 4 months ago

Not dropping units for various 0 values leads to a significant increase in the size of the generated CSS file.

So this PR, brings back this particular strategy to drop units from 0 values while keeping the fr and % units and taking a more measured approach. If any other unit needs to be maintained, we can work on that in the future.

github-actions[bot] commented 4 months ago

compressed-size: runtime library

Size change: 0.00 kB Total size: 2.52 kB

View unchanged | Filename: gzip (minify) | kB size | kB change | % change | | :--- | :--- | :--- | :--- | | `./packages/stylex/lib/stylex.js` | **1.04** (3.22) | **0.00** (0.00) | **0.0%** (0.0%) | | `./packages/stylex/lib/StyleXSheet.js` | **1.48** (3.75) | **0.00** (0.00) | **0.0%** (0.0%) |
github-actions[bot] commented 4 months ago

compressed-size: e2e bundles

Size change: -4.19 kB Total size: 1128.74 kB

Filename: gzip (minify) kB size kB change % change
./apps/rollup-example/.build/bundle.js 1005.32 (10185.35) -1.31 (-2.91) -0.1% (-0.0%) 🟢
./apps/rollup-example/.build/stylex.css 123.42 (774.34) -2.88 (-21.83) -2.3% (-2.7%) 🟢