Skip to content

Commit

Permalink
fix: revert "prevent prematurely cloning light dom slot vnodes"
Browse files Browse the repository at this point in the history
This reverts commit 1105823 (#4258).
  • Loading branch information
nolanlawson committed Aug 9, 2024
1 parent 7f4bc21 commit ffc5ed0
Show file tree
Hide file tree
Showing 17 changed files with 1 addition and 322 deletions.
10 changes: 1 addition & 9 deletions packages/@lwc/engine-core/src/framework/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,7 @@ function s(
// to the vnode because the current way the diffing algo works, it will replace the original reference
// to the host element with a new one. This means the new element will be mounted and immediately unmounted.
// Creating a copy of the vnode to preserve a reference to the previous host element.
if (isUndefined(vnode.elm)) {
// vnode.elm is undefined during initial render.
// We don't need to clone at this point because it doesn't need to be unmounted.
vnode.slotAssignment = data.slotAssignment;
} else {
// Clone when the vnode.elm is defined to ensure we don't lose reference to the previous element.
// This is specifically for slot forwarding.
clonedVNode = { ...vnode, slotAssignment: data.slotAssignment };
}
clonedVNode = { ...vnode, slotAssignment: data.slotAssignment };
}
// If the slot content is standard type, the content is static, no additional
// processing needed on the vnode
Expand Down
182 changes: 0 additions & 182 deletions packages/@lwc/integration-karma/test/light-dom/lifecycle/index.spec.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit ffc5ed0

Please sign in to comment.