lwc icon indicating copy to clipboard operation
lwc copied to clipboard

fix: remove fragment delimiters and update tests

Open jye-sf opened this issue 1 year ago • 3 comments

Details

Since the initial implementation of VFragments, we've changed the way we reference elements from the vnode (leading, trailing) and implemented VFragment-specific logic for handling slots and diffing. As a result, I'm not sure we still need the empty text nodes.

This PR explores whether it's possible to remove the text delimiters and keep everything working. Although our integration tests all pass, I'm unfortunately not 100% confident they cover all possible use cases.

Can anyone else think of any use cases we may want to verify this against? If there are, I'd like to add them to our test suite. Otherwise, our current test suite seems to be telling us we're able to remove the text nodes with no regression.

Does this pull request introduce a breaking change?

  • ✅ No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • ⚠️ Yes, it does include an observable change.

Extra text nodes from VFragments (used for slots and if-elseif-else) are removed and no longer in the DOM.

GUS work item

jye-sf avatar Nov 06 '23 21:11 jye-sf

Since the initial implementation of VFragments, we've changed the way we reference elements from the vnode (leading, trailing) and implemented VFragment-specific logic for handling slots and diffing.

Makes sense. @jye-sf can you point me to those mentioned changes so I can catch up?

jodarove avatar Nov 06 '23 22:11 jodarove

@jodarove Here are the main changes I had in mind: https://github.com/salesforce/lwc/pull/3405 is the main one I think addresses our diffing concerns. https://github.com/salesforce/lwc/pull/3140 dealt with an issue with native slotting

jye-sf avatar Nov 06 '23 22:11 jye-sf

Potential issues to verify against: https://github.com/salesforce/lwc/issues/3827 https://github.com/salesforce/lwc/issues/3843

jye-sf avatar Nov 07 '23 20:11 jye-sf