From e03795b38e93dfc024425c11d08792a6f4b02bcb Mon Sep 17 00:00:00 2001 From: Tanner Reits <47483144+tanner-reits@users.noreply.github.com> Date: Mon, 11 Mar 2024 11:47:52 -0400 Subject: [PATCH] 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 --- src/runtime/dom-extras.ts | 4 +--- src/runtime/vdom/vdom-render.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/runtime/dom-extras.ts b/src/runtime/dom-extras.ts index 588b8fc9199..b36f14b2f3d 100644 --- a/src/runtime/dom-extras.ts +++ b/src/runtime/dom-extras.ts @@ -1,5 +1,5 @@ import { BUILD } from '@app-data'; -import { forceUpdate, getHostRef, plt, supportsShadow } from '@platform'; +import { getHostRef, plt, supportsShadow } from '@platform'; import { NODE_TYPES } from '@stencil/core/mock-doc'; import { CMP_FLAGS, HOST_FLAGS } from '@utils'; @@ -88,8 +88,6 @@ export const patchSlotAppendChild = (HostElementPrototype: any) => { // Check if there is fallback content that should be hidden updateFallbackSlotVisibility(this); - // Force a re-render of the host element - forceUpdate(this); return insertedNode; } diff --git a/src/runtime/vdom/vdom-render.ts b/src/runtime/vdom/vdom-render.ts index e465e4b37dd..427bd5a1646 100644 --- a/src/runtime/vdom/vdom-render.ts +++ b/src/runtime/vdom/vdom-render.ts @@ -1041,7 +1041,7 @@ render() { // If the node we're currently planning on inserting the new node before is an element, // we need to do some additional checks to make sure we're inserting the node in the correct order. // The use case here would be that we have multiple nodes being relocated to the same slot. So, we want - // to make sure they get inserted into their new how in the same order they were declared in their original location. + // to make sure they get inserted into their new home in the same order they were declared in their original location. // // TODO(STENCIL-914): Remove `experimentalSlotFixes` check if (