Re:Vue.js 1.0.0
by andrezsanchez on Tuesday October 27, 2015 @12:25AM
(#10456312)
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.
[ Parent
| on HN ]
It has: https://facebook.github.io/jsx/
Re:Vue.js 1.0.0
by andrezsanchez on Tuesday October 27, 2015 @02:12AM
(#10456553)
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:
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.