Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disableSyntheticShadowSupport should allow <slot>s to be static-optimized #4351

Open
Tracked by #3228
nolanlawson opened this issue Jul 2, 2024 · 0 comments
Open
Tracked by #3228

Comments

@nolanlawson
Copy link
Collaborator

nolanlawson commented Jul 2, 2024

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant