lwc icon indicating copy to clipboard operation
lwc copied to clipboard

Expand static content optimization

Open nolanlawson opened this issue 1 year ago • 1 comments

Currently there are some HTML features that de-optimize a node and disqualify it for the static content optimization. We should fix these so that more HTML templates get the performance benefits of this optimization.

  • [ ] id
  • [ ] IDref attributes (for, aria-labelledby, aria-activedescendant, etc.)
  • [ ] href
  • [ ] xlink:href
  • [ ] lwc:dom="manual"
  • [x] spellcheck (#4317)

nolanlawson avatar Jun 11 '24 16:06 nolanlawson

This issue has been linked to a new work item: W-15983509

git2gus[bot] avatar Jun 11 '24 19:06 git2gus[bot]

Not sure we'll end up doing lwc:dom="manual" – it's tricky because it affects synthetic shadow and how "portals" are rendered (i.e. bits of DOM that need MutationObservers to add the synthetic shadow scope token attributes). It also overlaps some with lwc:inner-html due to that directive requiring a portal as well.

nolanlawson avatar Jul 02 '24 23:07 nolanlawson

I'm going to say this is good enough for now. lwc:dom="manual" can be optimized another way – by disabling it in disableSyntheticShadowSupport. For lwc:inner-html, it is rare enough that it may not be worth optimizing.

nolanlawson avatar Aug 05 '24 17:08 nolanlawson