lantiga / react.hiccup

React 0% JSX, 100% hiccup
MIT License
81 stars 0 forks source link

hiccup to jsx? #8

Open hth2 opened 10 years ago

hth2 commented 10 years ago

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.

lantiga commented 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.

kristianmandrup commented 9 years ago

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.