From 6d295a42b15d3a44b1452f46a015068b4bb2b0fd Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Tue, 13 Aug 2024 13:53:38 -0700 Subject: [PATCH] shortcut done hydration --- packages/dom-expressions/src/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dom-expressions/src/client.js b/packages/dom-expressions/src/client.js index 08dbd46c..457add6b 100644 --- a/packages/dom-expressions/src/client.js +++ b/packages/dom-expressions/src/client.js @@ -229,11 +229,11 @@ export function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef // Hydrate export function hydrate(code, element, options = {}) { + if (globalThis._$HY.done) return render(code, element, [...element.childNodes], options); sharedConfig.completed = globalThis._$HY.completed; sharedConfig.events = globalThis._$HY.events; sharedConfig.load = id => globalThis._$HY.r[id]; sharedConfig.has = id => id in globalThis._$HY.r; - sharedConfig.done = globalThis._$HY.done; sharedConfig.gather = root => gatherHydratable(element, root); sharedConfig.registry = new Map(); sharedConfig.context = {