Skip to content

Commit e03795b

Browse files
authored
fix(runtime): remove forceUpdate in appendChild patch (#5437)
This commit removes a call to `forceUpdate` that was added to Stencil's patch for `appendChild` for slot emulation. The call was originally added to fix a failing test in Framework that we've now identified was the result of the patch's DOM manipulation in tandem with a mutation observer in framework. Instead, the mutation observer in framework was modified to observe changes in the element subtree, removing the need for this call. STENCIL-1192
1 parent a285d75 commit e03795b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/runtime/dom-extras.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BUILD } from '@app-data';
2-
import { forceUpdate, getHostRef, plt, supportsShadow } from '@platform';
2+
import { getHostRef, plt, supportsShadow } from '@platform';
33
import { NODE_TYPES } from '@stencil/core/mock-doc';
44
import { CMP_FLAGS, HOST_FLAGS } from '@utils';
55

@@ -88,8 +88,6 @@ export const patchSlotAppendChild = (HostElementPrototype: any) => {
8888

8989
// Check if there is fallback content that should be hidden
9090
updateFallbackSlotVisibility(this);
91-
// Force a re-render of the host element
92-
forceUpdate(this);
9391

9492
return insertedNode;
9593
}

src/runtime/vdom/vdom-render.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ render() {
10411041
// If the node we're currently planning on inserting the new node before is an element,
10421042
// we need to do some additional checks to make sure we're inserting the node in the correct order.
10431043
// The use case here would be that we have multiple nodes being relocated to the same slot. So, we want
1044-
// to make sure they get inserted into their new how in the same order they were declared in their original location.
1044+
// to make sure they get inserted into their new home in the same order they were declared in their original location.
10451045
//
10461046
// TODO(STENCIL-914): Remove `experimentalSlotFixes` check
10471047
if (

0 commit comments

Comments
 (0)