From: daiwei Date: Mon, 4 Aug 2025 02:11:41 +0000 (+0800) Subject: chore: cache parent sibling X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a0eb71796c0998209688eeade85ca0d9486ce163;p=thirdparty%2Fvuejs%2Fcore.git chore: cache parent sibling --- diff --git a/packages/runtime-vapor/src/dom/hydration.ts b/packages/runtime-vapor/src/dom/hydration.ts index 855829fddb..b070158d3c 100644 --- a/packages/runtime-vapor/src/dom/hydration.ts +++ b/packages/runtime-vapor/src/dom/hydration.ts @@ -26,9 +26,10 @@ function findParentSibling(n: Node): Node | null { return next ? next : findParentSibling(n.parentNode) } -export function advanceHydrationNode(node: Node): void { +export function advanceHydrationNode(node: Node & { $ps?: Node | null }): void { // if no next sibling, find the next node in the parent chain - const next = node.nextSibling || findParentSibling(node) + const next = + node.nextSibling || node.$ps || (node.$ps = findParentSibling(node)) if (next) setCurrentHydrationNode(next) }