marko 4.28.3 → 4.28.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -437,7 +437,7 @@ function morphdom(fromNode, toNode, host, componentsContext) {
437
437
  var curToNodeValue = curToNodeChild.bW_;
438
438
  var curFromNodeValue = curFromNodeChild.nodeValue;
439
439
  if (curFromNodeValue !== curToNodeValue) {
440
- if (isHydrate && curFromNodeType === TEXT_NODE && curFromNodeValue.startsWith(curToNodeValue)) {
440
+ if (isHydrate && toNextSibling && curFromNodeType === TEXT_NODE && toNextSibling.bX_ === TEXT_NODE && curFromNodeValue.startsWith(curToNodeValue) && toNextSibling.bW_.startsWith(curFromNodeValue.slice(curToNodeValue.length))) {
441
441
  // In hydrate mode we can use splitText to more efficiently handle
442
442
  // adjacent text vdom nodes that were merged.
443
443
  fromNextSibling = curFromNodeChild.splitText(curToNodeValue.length);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "4.28.3",
3
+ "version": "4.28.4",
4
4
  "license": "MIT",
5
5
  "description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
6
6
  "dependencies": {
@@ -292,13 +292,13 @@ function morphdom(fromNode, toNode, host, componentsContext) {
292
292
  curFromNodeChild,
293
293
  curVFromNodeChild,
294
294
  curToNodeChild,
295
- parentComponent,
295
+ parentComponent
296
296
  );
297
297
  } else {
298
298
  morphChildren(
299
299
  curFromNodeChild,
300
300
  curToNodeChild,
301
- parentComponent,
301
+ parentComponent
302
302
  );
303
303
  }
304
304
  } else {
@@ -484,10 +484,9 @@ function morphdom(fromNode, toNode, host, componentsContext) {
484
484
  morphChildren(
485
485
  matchingFromEl,
486
486
  curToNodeChild,
487
- parentComponent,
487
+ parentComponent
488
488
  );
489
489
  }
490
-
491
490
  } else {
492
491
  insertVirtualNodeBefore(
493
492
  curToNodeChild,
@@ -594,13 +593,18 @@ function morphdom(fromNode, toNode, host, componentsContext) {
594
593
  if (curFromNodeValue !== curToNodeValue) {
595
594
  if (
596
595
  isHydrate &&
596
+ toNextSibling &&
597
597
  curFromNodeType === TEXT_NODE &&
598
- curFromNodeValue.startsWith(curToNodeValue)
598
+ toNextSibling.___nodeType === TEXT_NODE &&
599
+ curFromNodeValue.startsWith(curToNodeValue) &&
600
+ toNextSibling.___nodeValue.startsWith(
601
+ curFromNodeValue.slice(curToNodeValue.length)
602
+ )
599
603
  ) {
600
604
  // In hydrate mode we can use splitText to more efficiently handle
601
605
  // adjacent text vdom nodes that were merged.
602
606
  fromNextSibling = curFromNodeChild.splitText(
603
- curToNodeValue.length,
607
+ curToNodeValue.length
604
608
  );
605
609
  } else {
606
610
  // Simply update nodeValue on the original node to