marko 5.32.12 → 5.32.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -179,7 +179,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
179
179
|
(matchingFromComponent = existingComponentLookup[component.id]) ===
|
|
180
180
|
undefined)
|
|
181
181
|
{
|
|
182
|
-
if (isHydrate
|
|
182
|
+
if (isHydrate) {
|
|
183
183
|
var rootNode = beginFragmentNode(curFromNodeChild, fromNode);
|
|
184
184
|
component._A_ = rootNode;
|
|
185
185
|
componentByDOMNode.set(rootNode, component);
|
|
@@ -321,7 +321,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
321
321
|
matchingFromEl === undefined ||
|
|
322
322
|
matchingFromEl === curFromNodeChild)
|
|
323
323
|
{
|
|
324
|
-
if (isHydrate
|
|
324
|
+
if (isHydrate && curFromNodeChild) {
|
|
325
325
|
if (
|
|
326
326
|
curFromNodeChild.nodeType === ELEMENT_NODE && (
|
|
327
327
|
curToNodeChild.aa_ ||
|
|
@@ -544,7 +544,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
544
544
|
// Both nodes being compared are Element nodes
|
|
545
545
|
curVFromNodeChild = vElementByDOMNode.get(curFromNodeChild);
|
|
546
546
|
if (curVFromNodeChild === undefined) {
|
|
547
|
-
if (isHydrate
|
|
547
|
+
if (isHydrate) {
|
|
548
548
|
curVFromNodeChild = virtualizeElement(curFromNodeChild);
|
|
549
549
|
|
|
550
550
|
if (
|
|
@@ -587,21 +587,24 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
587
587
|
{
|
|
588
588
|
// Both nodes being compared are Text or Comment nodes
|
|
589
589
|
isCompatible = true;
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
590
|
+
var curToNodeValue = curToNodeChild.cj_;
|
|
591
|
+
var curFromNodeValue = curFromNodeChild.nodeValue;
|
|
592
|
+
if (curFromNodeValue !== curToNodeValue) {
|
|
593
|
+
if (
|
|
594
|
+
isHydrate &&
|
|
595
|
+
curFromNodeType === TEXT_NODE &&
|
|
596
|
+
curFromNodeValue.startsWith(curToNodeValue))
|
|
597
|
+
{
|
|
598
|
+
// In hydrate mode we can use splitText to more efficiently handle
|
|
599
|
+
// adjacent text vdom nodes that were merged.
|
|
600
|
+
fromNextSibling = curFromNodeChild.splitText(
|
|
601
|
+
curToNodeValue.length
|
|
602
|
+
);
|
|
603
|
+
} else {
|
|
604
|
+
// Simply update nodeValue on the original node to
|
|
605
|
+
// change the text value
|
|
606
|
+
curFromNodeChild.nodeValue = curToNodeValue;
|
|
607
|
+
}
|
|
605
608
|
}
|
|
606
609
|
}
|
|
607
610
|
}
|
package/package.json
CHANGED
|
@@ -179,7 +179,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
179
179
|
(matchingFromComponent = existingComponentLookup[component.id]) ===
|
|
180
180
|
undefined
|
|
181
181
|
) {
|
|
182
|
-
if (isHydrate
|
|
182
|
+
if (isHydrate) {
|
|
183
183
|
var rootNode = beginFragmentNode(curFromNodeChild, fromNode);
|
|
184
184
|
component.___rootNode = rootNode;
|
|
185
185
|
componentByDOMNode.set(rootNode, component);
|
|
@@ -321,7 +321,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
321
321
|
matchingFromEl === undefined ||
|
|
322
322
|
matchingFromEl === curFromNodeChild
|
|
323
323
|
) {
|
|
324
|
-
if (isHydrate
|
|
324
|
+
if (isHydrate && curFromNodeChild) {
|
|
325
325
|
if (
|
|
326
326
|
curFromNodeChild.nodeType === ELEMENT_NODE &&
|
|
327
327
|
(curToNodeChild.___preserve ||
|
|
@@ -544,7 +544,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
544
544
|
// Both nodes being compared are Element nodes
|
|
545
545
|
curVFromNodeChild = vElementByDOMNode.get(curFromNodeChild);
|
|
546
546
|
if (curVFromNodeChild === undefined) {
|
|
547
|
-
if (isHydrate
|
|
547
|
+
if (isHydrate) {
|
|
548
548
|
curVFromNodeChild = virtualizeElement(curFromNodeChild);
|
|
549
549
|
|
|
550
550
|
if (
|
|
@@ -587,21 +587,24 @@ function morphdom(fromNode, toNode, host, componentsContext) {
|
|
|
587
587
|
) {
|
|
588
588
|
// Both nodes being compared are Text or Comment nodes
|
|
589
589
|
isCompatible = true;
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
590
|
+
var curToNodeValue = curToNodeChild.___nodeValue;
|
|
591
|
+
var curFromNodeValue = curFromNodeChild.nodeValue;
|
|
592
|
+
if (curFromNodeValue !== curToNodeValue) {
|
|
593
|
+
if (
|
|
594
|
+
isHydrate &&
|
|
595
|
+
curFromNodeType === TEXT_NODE &&
|
|
596
|
+
curFromNodeValue.startsWith(curToNodeValue)
|
|
597
|
+
) {
|
|
598
|
+
// In hydrate mode we can use splitText to more efficiently handle
|
|
599
|
+
// adjacent text vdom nodes that were merged.
|
|
600
|
+
fromNextSibling = curFromNodeChild.splitText(
|
|
601
|
+
curToNodeValue.length,
|
|
602
|
+
);
|
|
603
|
+
} else {
|
|
604
|
+
// Simply update nodeValue on the original node to
|
|
605
|
+
// change the text value
|
|
606
|
+
curFromNodeChild.nodeValue = curToNodeValue;
|
|
607
|
+
}
|
|
605
608
|
}
|
|
606
609
|
}
|
|
607
610
|
}
|