marko 5.32.11 → 5.32.13
Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "marko",
|
3
|
-
"version": "5.32.
|
3
|
+
"version": "5.32.13",
|
4
4
|
"description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
|
5
5
|
"keywords": [
|
6
6
|
"front-end",
|
@@ -65,7 +65,7 @@
|
|
65
65
|
},
|
66
66
|
"dependencies": {
|
67
67
|
"@marko/compiler": "^5.34.7",
|
68
|
-
"@marko/translator-default": "^5.31.
|
68
|
+
"@marko/translator-default": "^5.31.17",
|
69
69
|
"app-module-path": "^2.2.0",
|
70
70
|
"argly": "^1.2.0",
|
71
71
|
"browser-refresh-client": "1.1.4",
|
@@ -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
|
}
|