Skip to content

[feat] Bring back stylex.attrs#1462

Merged
nmn merged 2 commits intomainfrom
feat/stylex-attrs
Mar 22, 2026
Merged

[feat] Bring back stylex.attrs#1462
nmn merged 2 commits intomainfrom
feat/stylex-attrs

Conversation

@nmn
Copy link
Copy Markdown
Collaborator

@nmn nmn commented Jan 25, 2026

What changed / motivation ?

Brings back stylex.attrs which works like stylex.props but instead of returning an object with className string and a style object, it returns an object with class and style strings.

This API makes it simpler and easier to use StyleX with UI libraries such as Solid.js, Qwik.js, Svelte, Vue and others.


TODO:

  • Looking for ways to further refactor the code to simplify and improve types.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stylex Ready Ready Preview, Comment Mar 22, 2026 2:30am

Request Review

@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 Jan 25, 2026
@nmn nmn removed the request for review from necolas January 25, 2026 09:04
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 25, 2026

workflow: benchmarks/perf

Comparison of performance test results, measured in operations per second. Larger is better.
yarn workspace v1.22.22
yarn run v1.22.22
$ node ./compare.js /tmp/tmp.7uEtO7WD9a /tmp/tmp.v5uhlYL5sK

Results Base Patch Ratio
babel-plugin: stylex.create
· basic create 526 534 1.02 +
· complex create 65 65 1.00
babel-plugin: stylex.createTheme
· basic themes 435 431 0.99 -
· complex themes 33 33 1.00
Done in 0.09s.
Done in 0.33s.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 25, 2026

workflow: benchmarks/size

Comparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
yarn workspace v1.22.22
yarn run v1.22.22
$ node ./compare.js /tmp/tmp.PIaSf3V3Pz /tmp/tmp.oYrtx4p1Sj

Results Base Patch Ratio
@stylexjs/stylex/lib/cjs/stylex.js
· compressed 1,331 1,447 1.09 !!
· minified 4,209 4,558 1.08 !!
@stylexjs/stylex/lib/cjs/inject.js
· compressed 1,793 1,793 1.00
· minified 4,915 4,915 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,653 99,867 1.00 +
· minified 747,850 747,613 1.00 -
Done in 0.08s.
Done in 0.31s.

@nmn nmn merged commit d69cb6f into main Mar 22, 2026
13 checks passed
@nmn nmn deleted the feat/stylex-attrs branch March 22, 2026 03:28
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