astroturf
astroturf copied to clipboard
Inline experiment
Throwing this up for thoughts. by itself it's not really a win, but maybe it's worth adding some additional options that only enable it in the simple cases, e.g. no spreads to deal with?
I mostly wrote it so that when ppl say "MEH THERE IS ACTUALLY A RUNTIME" i can point them to this :P
i mean, it's definitely neat.
if you wanted to do something more robust, you could possibly use something like the existing JSX transform to convert all the props into a single props
object, then look at the resulting props.className
and props.style
.
like, IIFE style?
<Component {...(() => {
const __props = { ...spread, other, foo };
return { __props, style: { __props.style, ... } };
})()}```
ooo that's a cool idea.