-
Notifications
You must be signed in to change notification settings - Fork 350
[feat] Simple sx={} syntax as an alternative to stylex.props
#1218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
workflow: benchmarks/perfComparison of performance test results, measured in operations per second. Larger is better.
|
workflow: benchmarks/sizeComparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
|
xrzhuang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
omg i need this now !!!!
ship it 🚀
|
not sure if we could use this internally with Flow etc, but will try to collect feedback on naming regardless |
|
This would be amazing, if you could get it working on flow especially. We're migrating to stylex at the moment and this is one of my personal pet peeves. We're also on flow (and relay), could you get the flow team to add a custom config like relay has |
|
This would be a big help. Would love to see this so I don't have to alternate between |
|
Will sync with the Flow team on support for this |
|
@mellyeliu did you hear from the flow team. Super interested as we’re starting a large styled components to stylex conversion on a flow code base. This was one of the major sticking points internally and it would be great to know the direction you guys are thinking about. |
<div stylex={[styles.foo, styles.bar]} />It's a naming problem, but in the case of Just wanted to share this perspective. |
|
@matclayton will prioritize this soon! hoping to get some broader Flow integration help from the team |
What changed / motivation ?
This adds a small syntactic sugar to allow using a
sx=prop on lower-case html JSX elements as an alternative to{...stylex.props}So you can write:
instead of
if you want.
This addresses a very common complaint.
Additional Context
A single test has been added.
This PR is not quite ready to merge yet. The transformation is currently hardcoded.
Pre-flight checklist
Contribution Guidelines