-
Notifications
You must be signed in to change notification settings - Fork 396
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(engine-core): slotting mechanism to remove vnode.owner #2716
Conversation
4dccfc6
to
4c970df
Compare
4c970df
to
397687d
Compare
@pmdartus @nolanlawson @caridy this is ready for review. if we decide to move forward with this PR, ill update the hydration logic. |
a4a074d
to
e8a7ea7
Compare
packages/integration-karma/test/light-dom/slotting/index.spec.js
Outdated
Show resolved
Hide resolved
d6b522e
to
70de56c
Compare
I haven't get my head around this change yet, but at first glance, it seems a lot more complicated now than the actual mechanism. I will like to understand this solution better, and explore maybe something a little simpler. |
70de56c
to
07c8769
Compare
@jodarove this is to be closed isn't it? |
@jodarove ping |
refactor: completely remove owner from vnode fix: hydration wip: not re-hydrating fine wip: progress, just 3 failures wip: progress, just 2 failures wip: fix the complex tests wip: format wip: failing test for light dom fix: light dom slot refactor: reuse mountElement to render slot element refactor: aChildren in vm does not need the owner fix: generate empty text node as marker refactor: review comments wip: review suggestions refactor: store owner on VSlot instead of aChildren fix(template-compiler): remove flatten call in light dom
33f3f61
to
e63a8ef
Compare
@caridy Today we are able to assign the FYI @abdulsattar |
This seems ready to be closed. Please reopen as necessary. |
Details
The main goal of this PR is to remove the
owner
property of thevnode
. The proposed solution changes how the slotting mechanism works to provide the correctowner
while rendering.vnode.owner
is mainly used to associate an element with the proper shadow (and to set scoped styles) and is always the same as the VM being rendered, except for the slotted content, this PR mainly focuses on storing the owner only for the slot (and slotted content) and properly switching the owner when rendering.This PR creates a new type of
VSlot
vnode, to be returned from thes()
(template API) function, along with the corresponding mount/patch/unmount logic that takes care of rendering the slot and slotted content correctly while switching from "VM being rendered" while patching.Missing:
flatten
call on nodes with slots (if we flatten them for the light dom case).Does this pull request introduce a breaking change?
Does this pull request introduce an observable change?