Open hth2 opened 10 years ago
I haven't thought about it, it could be worthwhile. The tricky part is that sweet.js emits javascript and JSX is not javascript. However it should be possible to just emit JSX as a string. I'll look into it, thanks for the suggestion.
Would be awesome if we could allow for an alternative indentation based syntax as well:
div#foo.bar.baz(some: "property", another: {{props.anothervalue}})
p "A child element"
"Child text"
And yes, we should be able to control/configure what kind of API calls are generated, such as JSX Dom calls on MSX (Mithril "JSX" API) etc. I will likely give it a shot one of these days...
See also Compiling-JSX-with-Sweet.js
JSX "compiler" with sweet.js macros
MSX reader with Sweet.js macros to improve on basic Mithril JSX reader/compiler.
Is it possible to have the possibility to translate hiccup to jsx? Since jsx is more popular and is officially supported by FB, posting an example/question/bug report in jsx would increase the chance for react.hiccup users to get an answer to their question.