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

refactor: Fragment VNode #3034

Merged
merged 8 commits into from
Sep 16, 2022
Merged

refactor: Fragment VNode #3034

merged 8 commits into from
Sep 16, 2022

Conversation

jodarove
Copy link
Contributor

@jodarove jodarove commented Sep 8, 2022

Details

This PR is the beginning of splitting #2957.

It introduces the VFragment vnode type, and the required routines to mount, patch, and hydrate a vnode; as well of how to generate a fragment in the compiler

For a general explanation, please read the one in the original PR

Does this pull request introduce a breaking change?

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

Does this pull request introduce an observable change?

  • ✅ No, it does not introduce an observable change.

But notice that the new VFragment VNode requires two new empty text nodes which serve anchor points in the DOM. Those empty text nodes are observable from userland via Node.prototype.children, Element.prototype.firstChild, Element.prototype.lastChild, Node.prototype.previousSibling and Node.prototype.nextSibling. As a side effect, Jest's snapshot tests would fail because those empty text nodes would generate empty lines surrounding the fragment.

GUS work item

@jodarove jodarove requested review from nolanlawson, pmdartus and ravijayaramappa and removed request for nolanlawson September 8, 2022 16:01
Copy link
Contributor

@jye-sf jye-sf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question about doc.

packages/@lwc/engine-core/src/framework/vnodes.ts Outdated Show resolved Hide resolved
@jodarove jodarove merged commit 11d6de3 into master Sep 16, 2022
@jodarove jodarove deleted the jodarove/vfragment branch September 16, 2022 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants