stylex icon indicating copy to clipboard operation
stylex copied to clipboard

[babel-plugin] refactor generateCSSRules logic

Open mellyeliu opened this issue 7 months ago • 2 comments

  • just some file restructuring + renaming
  • added basic tests for generateCSSRules in prep for processing defineConsts at-rules

mellyeliu avatar May 07 '25 08:05 mellyeliu

workflow: benchmarks/perf

Comparison of performance test results, measured in operations per second. Larger is better.

[email protected] compare node ./compare.js /tmp/tmp.yt2ky96stJ /tmp/tmp.Rd0lLyKA85

Results Base Patch Ratio
babel-plugin: stylex.create
· basic create 540 549 1.02 +
· complex create 183 188 1.03 +
babel-plugin: stylex.createTheme
· basic themes 454 458 1.01 +
· complex themes 43 42 0.98 -

github-actions[bot] avatar May 07 '25 08:05 github-actions[bot]

workflow: benchmarks/size

Comparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.

[email protected] compare node ./compare.js /tmp/tmp.oKsCtzakDV /tmp/tmp.kVvYfJNBSM

Results Base Patch Ratio
@stylexjs/stylex/lib/cjs/stylex.js
· compressed 1,172 1,172 1.00
· minified 3,395 3,395 1.00
@stylexjs/stylex/lib/cjs/inject.js
· compressed 1,227 1,227 1.00
· minified 3,224 3,224 1.00
benchmarks/size/.build/bundle.js
· compressed 537,611 537,611 1.00
· minified 7,435,904 7,435,904 1.00
benchmarks/size/.build/stylex.css
· compressed 100,509 100,509 1.00
· minified 754,513 754,513 1.00

github-actions[bot] avatar May 07 '25 08:05 github-actions[bot]

I added them because I was testing this logic in https://github.com/facebook/stylex/pull/1050 but will find a way to capture it via higher level api nests

mellyeliu avatar May 07 '25 18:05 mellyeliu