salesforce / lwc

⚡️ LWC - A Blazing Fast, Enterprise-Grade Web Components Foundation
https://lwc.dev
Other
1.63k stars 393 forks source link

Improve test coverage for vdom diffing after static vnode optimization #2817

Open nolanlawson opened 2 years ago

nolanlawson commented 2 years ago

As noted in https://github.com/salesforce/lwc/pull/2781#discussion_r851122249, our test coverage will decrease due to the static vnode optimization. Ideally we should add new tests to cover those vdom diffing cases that are no longer covered.

uip-robot-zz commented 2 years ago

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

nolanlawson commented 2 years ago

One source of the drop in coverage is validateClassAttr and validateStyleAttr. Because the styleDecls and classMap are based on static content, there are many fewer of these now.

nolanlawson commented 2 years ago

We could probably get rid of styleDecls and classMap entirely, but it is still used in the ACT compiler, so there's that to consider.

Other places it shows up are in nodes that aren't supported for static fragments, such as <custom-element>.