lwc
lwc copied to clipboard
Expand static content optimization
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)
This issue has been linked to a new work item: W-15983509
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.
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.