From 7e943e3ba582a969359585935eb8648ff62f1e2e Mon Sep 17 00:00:00 2001 From: John Jenkins Date: Tue, 15 Jul 2025 12:24:47 +0100 Subject: [PATCH 1/2] fix(runtime): do not remove first comment - can break frameworks --- src/runtime/connected-callback.ts | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/runtime/connected-callback.ts b/src/runtime/connected-callback.ts index 5d0801e3831..6f02800a09c 100644 --- a/src/runtime/connected-callback.ts +++ b/src/runtime/connected-callback.ts @@ -61,19 +61,7 @@ export const connectedCallback = (elm: d.HostElement) => { cmpMeta.$flags$ & (CMP_FLAGS.hasSlotRelocation | CMP_FLAGS.needsShadowDomShim)) ) { setContentReference(elm); - } else if (BUILD.hydrateClientSide && !(cmpMeta.$flags$ & CMP_FLAGS.hasSlotRelocation)) { - const commendPlaceholder = elm.firstChild as d.RenderNode; - if ( - commendPlaceholder?.nodeType === NODE_TYPE.CommentNode && - !commendPlaceholder['s-cn'] && - !commendPlaceholder.nodeValue - ) { - // if the first child is a comment node that was created by the - // setContentReference() function during SSR, remove it now as - // this component does not need slot relocation and can cause hydration issues - elm.removeChild(commendPlaceholder); - } - } + } } if (BUILD.asyncLoading) { From 83fb8b0dfde2a204172c8e067d81a10d637ccd43 Mon Sep 17 00:00:00 2001 From: John Jenkins Date: Tue, 15 Jul 2025 12:35:11 +0100 Subject: [PATCH 2/2] chore: prettier --- src/runtime/connected-callback.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/connected-callback.ts b/src/runtime/connected-callback.ts index 6f02800a09c..b358e3d88be 100644 --- a/src/runtime/connected-callback.ts +++ b/src/runtime/connected-callback.ts @@ -61,7 +61,7 @@ export const connectedCallback = (elm: d.HostElement) => { cmpMeta.$flags$ & (CMP_FLAGS.hasSlotRelocation | CMP_FLAGS.needsShadowDomShim)) ) { setContentReference(elm); - } + } } if (BUILD.asyncLoading) {