anthonyshort / deku

Render interfaces using pure functions and virtual DOM
https://github.com/anthonyshort/deku/tree/master/docs
3.41k stars 130 forks source link

support babel's `optimisation.react.inlineElements` #244

Closed aeosynth closed 4 years ago

aeosynth commented 9 years ago

http://babeljs.io/blog/2015/03/31/5.0.0/#inline-elements

basically, change virtual elements attributes to props

alternatively, i suppose we could ask babel to support other virtual element signatures

anthonyshort commented 9 years ago

Seems kind of odd that they have React optimisations like that in there. You can get the same thing by just pulling virtual elements out of the render function and reusing them. Deku will skip over nodes if they're the same as the previous node.

It could possibly be worth changing the property name if it means free optimisations, but I'll look into it.

aeosynth commented 9 years ago

that's constant elements :D

anthonyshort commented 9 years ago

Derp, my bad. Yeah of course. I'm guessing we could support that with a Babel transform too.