infernojs / babel-plugin-inferno

Transforms JSX to InfernoJS vNodes
MIT License
79 stars 26 forks source link

Explore: Buble integration #36

Closed lukeed closed 6 years ago

lukeed commented 7 years ago

This plugin is the only reason I'm still using Babel. Perhaps that's a way to hook into Buble's JSX system?

Havunen commented 7 years ago

Lets create repository under infernojs organization

lukeed commented 7 years ago

@Havunen Yes, but I'm still not sure if this is even possible yet.

Havunen commented 7 years ago

we can ping rich-harris at slack regarding this. I think he will be happy to give some pointers to get started.

TrySound commented 7 years ago

@lukeed It's simple but you should use inferno-create-element instead. There's jsx option in buble which accepts a factory expression like React.createElement or just createElement.

Cons: it does not support spread props

Havunen commented 7 years ago

Sadly inferno-create-element cant achieve same performance as createVNode :(

TrySound commented 7 years ago

Is everything so bad? Then you can always fork buble as usual. :)

lukeed commented 7 years ago

Thanks, I'm aware but it's not what I'm after. Just trying to port an equivalent plugin to buble.

Havunen commented 7 years ago

Typescript plugin might be possible in next 2.3 release: https://github.com/Microsoft/TypeScript/pull/13940

chee commented 7 years ago

seems to work with inferno-hyperscript and buble --jsx h

lukeed commented 7 years ago

@chee Yes, that's supposed to work. But most Inferno users don't use the hyperscript-plugin.

Havunen commented 6 years ago

Lets close this issue. We could implement it for buble If they start supporting plugins. Also new features are coming to JSX in babel7, Fe: Fragments those should be done first.