-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Optimization: Generate inline ReactElements #139
Comments
@rauhs I thought about this as well. I think it's also possible in React versions before 0.14, provided the object literals have a key called |
So I've actually been wanting a "sablono light" that does not come with a runtime interpreter. You may have seen my hacks here: https://gist.github.com/rauhs/38b8598c6549f2fe09ad4d257382ec32 (yeah I know, they're ugly :) ) This prompted me to basically rewrite/fork sablono that removes the interpreter and is way less powerful. I don't actually want to publish a fork of sablono so my question now is basically: Would you be interested in a "sablono.light" namespace living in this repository for users that want this functionality? It still uses much of your code. I'm away now for 2 weeks but let me dump a gist here: |
@rauhs I'm not sure about this "light" namespace. I think supporting a 3rd way to build React nodes is a bit too much. However, I'm still interested in the object literal approach. |
Starting with React 0.14, we can feed React object literals instead of calls to
React.createElement
:This would allow some possible speedup. A gotcha is when the ref is set to a string or a potential string. Then they need to go through
createElement
. Though this method is discouraged nowadays and callbacks should be used instead.Also see React issue #3228
The text was updated successfully, but these errors were encountered: