When disableSyntheticShadowSupport=true and enableStaticContentOptimization=true are enabled, and we're compiling a shadow-DOM template, then we should be able to render a <slot> as a regular static-optimizable element rather than a special VNode.
In principle, there's no reason that native shadow DOM can't just render a slot as a <slot>, so it should be safe to static-optimize.
Note that this applies to <slot>s but not the slot attribute. The slot attribute cannot be as easily optimized, because at compile time, we don't know whether it's getting slotted into a light DOM or shadow DOM component:
<x-foo>
<!-- is x-foo shadow or light? -->
<div slot="bar"></div>
</x-foo>
When
disableSyntheticShadowSupport=true
andenableStaticContentOptimization=true
are enabled, and we're compiling a shadow-DOM template, then we should be able to render a<slot>
as a regular static-optimizable element rather than a special VNode.In principle, there's no reason that native shadow DOM can't just render a slot as a
<slot>
, so it should be safe to static-optimize.Note that this applies to
<slot>
s but not theslot
attribute. Theslot
attribute cannot be as easily optimized, because at compile time, we don't know whether it's getting slotted into a light DOM or shadow DOM component: