3 ms·
It would be neat if Facebook had implemented JSX as a framework-independent transform rather than a React-only one, that way other frameworks could use the pret
by andrezsanchez 11y ago
It would be neat if Facebook had implemented JSX as a framework-independent transform rather than a React-only one, that way other frameworks could use the pretty XMLish syntax rather than strings or JS objects.
- tiles 11y agoThere are alternatives though, like JSX implemented in sweet.js: http://jlongster.com/Compiling-JSX-with-Sweet.js-using-Readtables http://jlongster.com/Compiling-JSX-with-Sweet.js-using-Readt...
- rvikmanis 11y agoIt has: https://facebook.github.io/jsx/ https://facebook.github.io/jsx/
- andrezsanchez 11y agoEmphasis on "implemented" haha. At least this makes it more open since someone can come in and make their own implementation. As it currently stands I don't think you can use Facebook's implementation to transform JSX to a framework-agnostic object.
- EvanYou 11y agoThere are babel transforms for it: https://github.com/openjsx https://github.com/openjsx In fact I've seen a user use JSX-to-HTML for his Vue templates.