mlmorg / react-hyperscript

Hyperscript syntax for React.js markup
MIT License
710 stars 45 forks source link

Template pre-compilation #8

Closed rtsao closed 7 years ago

rtsao commented 9 years ago

It might be nice to have a way to pre-compile templates, perhaps a sweet.js macro like Mithril uses: http://lhorie.github.io/mithril/optimizing-performance.html#compiling-templates

roman01la commented 7 years ago

Babel plugin would work fine here. Also since nearly every React project is using Babel it would be trivial to include a plugin into build config.

roman01la commented 7 years ago

FYI, I've put together Babel plugin which pre-compiles HyperScript into plain React.createElement calls https://github.com/roman01la/babel-plugin-react-hyperscript

rtsao commented 7 years ago

Wow, nice! Marking this as resolved then.