Hacker News new | ask | show | jobs
by andrezsanchez 3886 days 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.
3 comments

Emphasis 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.
You can use babel. Look at the custom example here: http://babeljs.io/docs/advanced/transformers/other/react/
Well, you could fork it:

https://github.com/insin/msx

There are alternatives though, like JSX implemented in sweet.js: http://jlongster.com/Compiling-JSX-with-Sweet.js-using-Readt...
There are babel transforms for it: https://github.com/openjsx In fact I've seen a user use JSX-to-HTML for his Vue templates.