ryansolid / dom-expressions

A Fine-Grained Runtime for Performant DOM Rendering
MIT License
858 stars 125 forks source link

Is it possible to optimize `style.text` to be like `style_text`? #251

Open mokeyish opened 1 year ago

mokeyish commented 1 year ago

When using tailwindcss/unocss, there are places where styles are duplicated, so this way is needed to reference duplicated styles.

Is it possible to optimize style.text to be like style_text?

The reproduce code:

https://playground.solidjs.com/anonymous/4d3dfcf1-136f-4a7c-ba38-1cdfa8418e9f

ryansolid commented 1 year ago

Not easily.. or rather it would require resolution. I suppose we could try but keep in mind . heuristics matter for possible reactive wrapping since getters/proxies. Even if we could optimize this case where everything is inlined like that it would drop back as soon as it was in another file.

mokeyish commented 1 year ago

Thanks for your explaination. Maybe it needs something like /*@once*/ to mark it non-reactive.🤣

intrnl commented 10 months ago

Still not inline-able in the template, but #283 should at least address not having to wrap namespace imports under effects, the only tradeoff being that you'd have to author these classes in a separate file.