-
Notifications
You must be signed in to change notification settings - Fork 27
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
[Feature Request] Transpile away style9
runtime call
#63
Comments
For styles defined in the same file this should be fairly easy. It may also be more intuitive, since it removes the magic(i.e. lie) of Let me know how it goes and what your opinion on the |
Personally, I'd prefer the new way (without With And personally, I rarely create the style and export for other files. If I need to re-use a style, I will do composition at the component level (as I mentioned in #59) |
I wonder if the newly released StyleQ could be of any relevance to this discussion |
Chiming in to share my preference for the new style. My reasoning is the same as @SukkaW i.e. so the type checker can verify that the style exists |
Although Facebook stylex is not officially open-sourced, it does publish an alpha version on npm: https://unpkg.com/browse/@stylexjs/babel-plugin@0.2.0-beta.8/lib/index.js And we might be able to learn something from it. |
Facebook's stylex has evolved a lot since it is being first introduced in React Conf 2019. At the time, stylex uses a syntax like this:
Nowadays, stylex seems to prefer the syntax with directly
stylex()
call, see React Finland 2021 - Introducing StyleX:And according to React Finland 2021, they are able to strip most of
stylex
runtime call through static analysis.Currently, style9 doesn't support stripping away the
style9()
runtime at all. I am about to experiment with it a little bit to see if it is doable.The text was updated successfully, but these errors were encountered: