Skip to content

Conversation

@nmn
Copy link
Collaborator

@nmn nmn commented Dec 4, 2025

What changed / motivation ?

The old legacy function stylex() was replaced by legacyMerge in the @stylexjs/stylex package a while ago, but the Babel transform continues to compile the old default export and does not compile legacyMerge.

This PR, will pre-compile legacyMerge when possible, improving performance for those using this deprecated API.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 4, 2025
@nmn nmn marked this pull request as draft December 4, 2025 20:49
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

workflow: benchmarks/perf

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

[email protected] compare
node ./compare.js /tmp/tmp.upYhAjGsNs /tmp/tmp.Zdp5JA8KiX

Results Base Patch Ratio
babel-plugin: stylex.create
· basic create 531 520 0.98 -
· complex create 64 63 0.98 -
babel-plugin: stylex.createTheme
· basic themes 437 427 0.98 -
· complex themes 33 33 1.00

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

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.Y0Bz4YfRzF /tmp/tmp.zQ0QPFfQwm

Results Base Patch Ratio
@stylexjs/stylex/lib/cjs/stylex.js
· compressed 1,311 1,311 1.00
· minified 4,150 4,150 1.00
@stylexjs/stylex/lib/cjs/inject.js
· compressed 1,762 1,762 1.00
· minified 4,873 4,873 1.00
benchmarks/size/.build/bundle.js
· compressed 496,650 496,650 1.00
· minified 4,847,840 4,847,840 1.00
benchmarks/size/.build/stylex.css
· compressed 99,853 99,853 1.00
· minified 747,541 747,541 1.00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants