htm icon indicating copy to clipboard operation
htm copied to clipboard

Feature request: add online tool (or babel REPL setup) to convert from JSX to htm

Open blikblum opened this issue 6 years ago • 5 comments
trafficstars

While converting a project from JSX to htm i missed a online tool (or a codepen/fiddlejs or babel repl setup) to run babel with babel-plugin-transform-jsx-to-htm

I tried to configure Babel REPL adding @babel/plugin-syntax-jsx and babel-plugin-transform-jsx-to-htm plugins with no luck (a bug in Babel REPL?)

blikblum avatar Mar 29 '19 13:03 blikblum

This is a fantastic idea and I will absolutely try to find an hour to throw something together!

developit avatar Apr 07 '19 01:04 developit

I've got some time today and create a simple one: https://github.com/blikblum/to-htm

Edit: it come also with a CLI and can convert from Handlebars

blikblum avatar Apr 20 '19 02:04 blikblum

nice @blikblum!!

developit avatar May 22 '19 15:05 developit

wanted to leave this link here for the Handlebars fans 👨🏻‍🦱 https://github.com/luwes/hyperstache

luwes avatar May 22 '20 01:05 luwes

This works now in the official babel REPL:

https://babeljs.io/repl#?code_lz=DwEwlgbgfAhgBAMhgWwA4G44CNgHpzToBQQA&externalPlugins=babel-plugin-transform-jsx-to-htm%402.0.0

developit avatar Feb 05 '21 03:02 developit