marko 6.0.0-next.3.70 → 6.0.0-next.3.71

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.
package/dist/debug/dom.js CHANGED
@@ -1628,12 +1628,9 @@ function awaitTag(nodeAccessor, renderer) {
1628
1628
  const referenceNode = scope[nodeAccessor];
1629
1629
  const namespaceNode = (awaitBranch?.___startNode ?? referenceNode).parentNode;
1630
1630
  const thisPromise = scope[promiseAccessor] = promise.then((data2) => {
1631
- if (scope.___closestBranch?.___destroyed || scope[promiseAccessor] !== thisPromise) {
1632
- return;
1633
- }
1634
- scope[promiseAccessor] = void 0;
1635
- runEffects(
1636
- prepareEffects(() => {
1631
+ if (thisPromise === scope[promiseAccessor] && !scope.___closestBranch?.___destroyed) {
1632
+ scope[promiseAccessor] = 0;
1633
+ renderImmediate(() => {
1637
1634
  if (tryWithPlaceholder) {
1638
1635
  placeholderShown.add(pendingEffects);
1639
1636
  }
@@ -1651,12 +1648,10 @@ function awaitTag(nodeAccessor, renderer) {
1651
1648
  referenceNode.remove();
1652
1649
  }
1653
1650
  renderer.___params?.(awaitBranch, [data2]);
1654
- })
1655
- );
1656
- if (tryWithPlaceholder) {
1657
- if (!--tryWithPlaceholder.___pendingAsyncCount) {
1651
+ });
1652
+ if (tryWithPlaceholder && !--tryWithPlaceholder.___pendingAsyncCount) {
1658
1653
  const placeholderBranch = tryWithPlaceholder["#PlaceholderBranch" /* PlaceholderBranch */];
1659
- tryWithPlaceholder["#PlaceholderBranch" /* PlaceholderBranch */] = void 0;
1654
+ tryWithPlaceholder["#PlaceholderBranch" /* PlaceholderBranch */] = 0;
1660
1655
  if (placeholderBranch) {
1661
1656
  insertBranchBefore(
1662
1657
  tryWithPlaceholder,
@@ -1670,29 +1665,31 @@ function awaitTag(nodeAccessor, renderer) {
1670
1665
  }
1671
1666
  }
1672
1667
  }
1673
- }).catch((error) => {
1674
- renderCatch(scope, error, true);
1675
- });
1668
+ }).catch(
1669
+ (error) => renderImmediate(() => renderCatch(scope, error, true))
1670
+ );
1676
1671
  if (tryWithPlaceholder) {
1677
1672
  placeholderShown.add(pendingEffects);
1678
1673
  if (!tryWithPlaceholder.___pendingAsyncCount) {
1679
1674
  tryWithPlaceholder.___pendingAsyncCount = 0;
1680
- requestAnimationFrame(() => {
1681
- if (tryWithPlaceholder.___pendingAsyncCount && !tryWithPlaceholder.___destroyed) {
1682
- const placeholderBranch = tryWithPlaceholder["#PlaceholderBranch" /* PlaceholderBranch */] = createAndSetupBranch(
1683
- scope.$global,
1684
- tryWithPlaceholder["#PlaceholderContent" /* PlaceholderContent */],
1685
- tryWithPlaceholder._,
1686
- tryWithPlaceholder.___startNode.parentNode
1687
- );
1688
- insertBranchBefore(
1689
- placeholderBranch,
1690
- tryWithPlaceholder.___startNode.parentNode,
1691
- tryWithPlaceholder.___startNode
1692
- );
1693
- tempDetatchBranch(tryWithPlaceholder);
1694
- }
1695
- });
1675
+ requestAnimationFrame(
1676
+ () => renderImmediate(() => {
1677
+ if (tryWithPlaceholder.___pendingAsyncCount && !tryWithPlaceholder.___destroyed) {
1678
+ const placeholderBranch = tryWithPlaceholder["#PlaceholderBranch" /* PlaceholderBranch */] = createAndSetupBranch(
1679
+ scope.$global,
1680
+ tryWithPlaceholder["#PlaceholderContent" /* PlaceholderContent */],
1681
+ tryWithPlaceholder._,
1682
+ tryWithPlaceholder.___startNode.parentNode
1683
+ );
1684
+ insertBranchBefore(
1685
+ placeholderBranch,
1686
+ tryWithPlaceholder.___startNode.parentNode,
1687
+ tryWithPlaceholder.___startNode
1688
+ );
1689
+ tempDetatchBranch(tryWithPlaceholder);
1690
+ }
1691
+ })
1692
+ );
1696
1693
  }
1697
1694
  tryWithPlaceholder.___pendingAsyncCount++;
1698
1695
  } else if (awaitBranch) {
@@ -1704,6 +1701,9 @@ function awaitTag(nodeAccessor, renderer) {
1704
1701
  }
1705
1702
  };
1706
1703
  }
1704
+ function renderImmediate(cb) {
1705
+ return runEffects(prepareEffects(cb));
1706
+ }
1707
1707
  function createTry(nodeAccessor, tryContent) {
1708
1708
  const branchAccessor = "ConditionalScope:" /* ConditionalScope */ + nodeAccessor;
1709
1709
  return (scope, input) => {
@@ -1825,10 +1825,7 @@ var dynamicTag = function dynamicTag2(nodeAccessor, getContent, getTagVar, input
1825
1825
  normalizedRenderer._ ? args[0] : args
1826
1826
  );
1827
1827
  } else {
1828
- const inputWithContent = getContent ? {
1829
- ...args,
1830
- content: getContent(scope)
1831
- } : args || {};
1828
+ const inputWithContent = getContent ? { ...args, content: getContent(scope) } : args || {};
1832
1829
  normalizedRenderer.___params(
1833
1830
  scope[childScopeAccessor],
1834
1831
  normalizedRenderer._ ? inputWithContent : [inputWithContent]
@@ -1540,12 +1540,9 @@ function awaitTag(nodeAccessor, renderer) {
1540
1540
  const referenceNode = scope[nodeAccessor];
1541
1541
  const namespaceNode = (awaitBranch?.___startNode ?? referenceNode).parentNode;
1542
1542
  const thisPromise = scope[promiseAccessor] = promise.then((data2) => {
1543
- if (scope.___closestBranch?.___destroyed || scope[promiseAccessor] !== thisPromise) {
1544
- return;
1545
- }
1546
- scope[promiseAccessor] = void 0;
1547
- runEffects(
1548
- prepareEffects(() => {
1543
+ if (thisPromise === scope[promiseAccessor] && !scope.___closestBranch?.___destroyed) {
1544
+ scope[promiseAccessor] = 0;
1545
+ renderImmediate(() => {
1549
1546
  if (tryWithPlaceholder) {
1550
1547
  placeholderShown.add(pendingEffects);
1551
1548
  }
@@ -1563,12 +1560,10 @@ function awaitTag(nodeAccessor, renderer) {
1563
1560
  referenceNode.remove();
1564
1561
  }
1565
1562
  renderer.___params?.(awaitBranch, [data2]);
1566
- })
1567
- );
1568
- if (tryWithPlaceholder) {
1569
- if (!--tryWithPlaceholder.___pendingAsyncCount) {
1563
+ });
1564
+ if (tryWithPlaceholder && !--tryWithPlaceholder.___pendingAsyncCount) {
1570
1565
  const placeholderBranch = tryWithPlaceholder["#PlaceholderBranch" /* PlaceholderBranch */];
1571
- tryWithPlaceholder["#PlaceholderBranch" /* PlaceholderBranch */] = void 0;
1566
+ tryWithPlaceholder["#PlaceholderBranch" /* PlaceholderBranch */] = 0;
1572
1567
  if (placeholderBranch) {
1573
1568
  insertBranchBefore(
1574
1569
  tryWithPlaceholder,
@@ -1582,29 +1577,31 @@ function awaitTag(nodeAccessor, renderer) {
1582
1577
  }
1583
1578
  }
1584
1579
  }
1585
- }).catch((error) => {
1586
- renderCatch(scope, error, true);
1587
- });
1580
+ }).catch(
1581
+ (error) => renderImmediate(() => renderCatch(scope, error, true))
1582
+ );
1588
1583
  if (tryWithPlaceholder) {
1589
1584
  placeholderShown.add(pendingEffects);
1590
1585
  if (!tryWithPlaceholder.___pendingAsyncCount) {
1591
1586
  tryWithPlaceholder.___pendingAsyncCount = 0;
1592
- requestAnimationFrame(() => {
1593
- if (tryWithPlaceholder.___pendingAsyncCount && !tryWithPlaceholder.___destroyed) {
1594
- const placeholderBranch = tryWithPlaceholder["#PlaceholderBranch" /* PlaceholderBranch */] = createAndSetupBranch(
1595
- scope.$global,
1596
- tryWithPlaceholder["#PlaceholderContent" /* PlaceholderContent */],
1597
- tryWithPlaceholder._,
1598
- tryWithPlaceholder.___startNode.parentNode
1599
- );
1600
- insertBranchBefore(
1601
- placeholderBranch,
1602
- tryWithPlaceholder.___startNode.parentNode,
1603
- tryWithPlaceholder.___startNode
1604
- );
1605
- tempDetatchBranch(tryWithPlaceholder);
1606
- }
1607
- });
1587
+ requestAnimationFrame(
1588
+ () => renderImmediate(() => {
1589
+ if (tryWithPlaceholder.___pendingAsyncCount && !tryWithPlaceholder.___destroyed) {
1590
+ const placeholderBranch = tryWithPlaceholder["#PlaceholderBranch" /* PlaceholderBranch */] = createAndSetupBranch(
1591
+ scope.$global,
1592
+ tryWithPlaceholder["#PlaceholderContent" /* PlaceholderContent */],
1593
+ tryWithPlaceholder._,
1594
+ tryWithPlaceholder.___startNode.parentNode
1595
+ );
1596
+ insertBranchBefore(
1597
+ placeholderBranch,
1598
+ tryWithPlaceholder.___startNode.parentNode,
1599
+ tryWithPlaceholder.___startNode
1600
+ );
1601
+ tempDetatchBranch(tryWithPlaceholder);
1602
+ }
1603
+ })
1604
+ );
1608
1605
  }
1609
1606
  tryWithPlaceholder.___pendingAsyncCount++;
1610
1607
  } else if (awaitBranch) {
@@ -1616,6 +1613,9 @@ function awaitTag(nodeAccessor, renderer) {
1616
1613
  }
1617
1614
  };
1618
1615
  }
1616
+ function renderImmediate(cb) {
1617
+ return runEffects(prepareEffects(cb));
1618
+ }
1619
1619
  function createTry(nodeAccessor, tryContent) {
1620
1620
  const branchAccessor = "ConditionalScope:" /* ConditionalScope */ + nodeAccessor;
1621
1621
  return (scope, input) => {
@@ -1737,10 +1737,7 @@ var dynamicTag = function dynamicTag2(nodeAccessor, getContent, getTagVar, input
1737
1737
  normalizedRenderer._ ? args[0] : args
1738
1738
  );
1739
1739
  } else {
1740
- const inputWithContent = getContent ? {
1741
- ...args,
1742
- content: getContent(scope)
1743
- } : args || {};
1740
+ const inputWithContent = getContent ? { ...args, content: getContent(scope) } : args || {};
1744
1741
  normalizedRenderer.___params(
1745
1742
  scope[childScopeAccessor],
1746
1743
  normalizedRenderer._ ? inputWithContent : [inputWithContent]
package/dist/dom.js CHANGED
@@ -1097,50 +1097,53 @@ function awaitTag(nodeAccessor, renderer) {
1097
1097
  scope,
1098
1098
  "d" /* PlaceholderContent */
1099
1099
  ), awaitBranch = scope[branchAccessor], referenceNode = scope[nodeAccessor], namespaceNode = (awaitBranch?.h ?? referenceNode).parentNode, thisPromise = scope[promiseAccessor] = promise.then((data2) => {
1100
- if (!(scope.k?.p || scope[promiseAccessor] !== thisPromise) && (scope[promiseAccessor] = void 0, runEffects(
1101
- prepareEffects(() => {
1102
- tryWithPlaceholder && placeholderShown.add(pendingEffects), (!awaitBranch || !tryWithPlaceholder) && (insertBranchBefore(
1103
- awaitBranch ??= scope[branchAccessor] = createAndSetupBranch(
1104
- scope.$global,
1105
- renderer,
1106
- scope,
1107
- namespaceNode
1108
- ),
1109
- referenceNode.parentNode,
1110
- referenceNode
1111
- ), referenceNode.remove()), renderer.l?.(awaitBranch, [data2]);
1112
- })
1113
- ), tryWithPlaceholder && !--tryWithPlaceholder.q)) {
1100
+ if (thisPromise === scope[promiseAccessor] && !scope.k?.p && (scope[promiseAccessor] = 0, renderImmediate(() => {
1101
+ tryWithPlaceholder && placeholderShown.add(pendingEffects), (!awaitBranch || !tryWithPlaceholder) && (insertBranchBefore(
1102
+ awaitBranch ??= scope[branchAccessor] = createAndSetupBranch(
1103
+ scope.$global,
1104
+ renderer,
1105
+ scope,
1106
+ namespaceNode
1107
+ ),
1108
+ referenceNode.parentNode,
1109
+ referenceNode
1110
+ ), referenceNode.remove()), renderer.l?.(awaitBranch, [data2]);
1111
+ }), tryWithPlaceholder && !--tryWithPlaceholder.q)) {
1114
1112
  let placeholderBranch = tryWithPlaceholder.c;
1115
- tryWithPlaceholder.c = void 0, placeholderBranch && (insertBranchBefore(
1113
+ tryWithPlaceholder.c = 0, placeholderBranch && (insertBranchBefore(
1116
1114
  tryWithPlaceholder,
1117
1115
  placeholderBranch.h.parentNode,
1118
1116
  placeholderBranch.h
1119
1117
  ), removeAndDestroyBranch(placeholderBranch)), tryWithPlaceholder.H && runEffects(tryWithPlaceholder.H, !0);
1120
1118
  }
1121
- }).catch((error) => {
1122
- renderCatch(scope, error, !0);
1123
- });
1124
- tryWithPlaceholder ? (placeholderShown.add(pendingEffects), tryWithPlaceholder.q || (tryWithPlaceholder.q = 0, requestAnimationFrame(() => {
1125
- if (tryWithPlaceholder.q && !tryWithPlaceholder.p) {
1126
- let placeholderBranch = tryWithPlaceholder.c = createAndSetupBranch(
1127
- scope.$global,
1128
- tryWithPlaceholder.d,
1129
- tryWithPlaceholder._,
1130
- tryWithPlaceholder.h.parentNode
1131
- );
1132
- insertBranchBefore(
1133
- placeholderBranch,
1134
- tryWithPlaceholder.h.parentNode,
1135
- tryWithPlaceholder.h
1136
- ), tempDetatchBranch(tryWithPlaceholder);
1137
- }
1138
- })), tryWithPlaceholder.q++) : awaitBranch && (awaitBranch.h.parentNode.insertBefore(
1119
+ }).catch(
1120
+ (error) => renderImmediate(() => renderCatch(scope, error, !0))
1121
+ );
1122
+ tryWithPlaceholder ? (placeholderShown.add(pendingEffects), tryWithPlaceholder.q || (tryWithPlaceholder.q = 0, requestAnimationFrame(
1123
+ () => renderImmediate(() => {
1124
+ if (tryWithPlaceholder.q && !tryWithPlaceholder.p) {
1125
+ let placeholderBranch = tryWithPlaceholder.c = createAndSetupBranch(
1126
+ scope.$global,
1127
+ tryWithPlaceholder.d,
1128
+ tryWithPlaceholder._,
1129
+ tryWithPlaceholder.h.parentNode
1130
+ );
1131
+ insertBranchBefore(
1132
+ placeholderBranch,
1133
+ tryWithPlaceholder.h.parentNode,
1134
+ tryWithPlaceholder.h
1135
+ ), tempDetatchBranch(tryWithPlaceholder);
1136
+ }
1137
+ })
1138
+ )), tryWithPlaceholder.q++) : awaitBranch && (awaitBranch.h.parentNode.insertBefore(
1139
1139
  referenceNode,
1140
1140
  awaitBranch.h
1141
1141
  ), tempDetatchBranch(awaitBranch));
1142
1142
  };
1143
1143
  }
1144
+ function renderImmediate(cb) {
1145
+ return runEffects(prepareEffects(cb));
1146
+ }
1144
1147
  function createTry(nodeAccessor, tryContent) {
1145
1148
  let branchAccessor = "d" /* ConditionalScope */ + nodeAccessor;
1146
1149
  return (scope, input) => {
@@ -1234,10 +1237,7 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1234
1237
  normalizedRenderer._ ? args[0] : args
1235
1238
  );
1236
1239
  else {
1237
- let inputWithContent = getContent ? {
1238
- ...args,
1239
- content: getContent(scope)
1240
- } : args || {};
1240
+ let inputWithContent = getContent ? { ...args, content: getContent(scope) } : args || {};
1241
1241
  normalizedRenderer.l(
1242
1242
  scope[childScopeAccessor],
1243
1243
  normalizedRenderer._ ? inputWithContent : [inputWithContent]
package/dist/dom.mjs CHANGED
@@ -1012,50 +1012,53 @@ function awaitTag(nodeAccessor, renderer) {
1012
1012
  scope,
1013
1013
  "d" /* PlaceholderContent */
1014
1014
  ), awaitBranch = scope[branchAccessor], referenceNode = scope[nodeAccessor], namespaceNode = (awaitBranch?.h ?? referenceNode).parentNode, thisPromise = scope[promiseAccessor] = promise.then((data2) => {
1015
- if (!(scope.k?.p || scope[promiseAccessor] !== thisPromise) && (scope[promiseAccessor] = void 0, runEffects(
1016
- prepareEffects(() => {
1017
- tryWithPlaceholder && placeholderShown.add(pendingEffects), (!awaitBranch || !tryWithPlaceholder) && (insertBranchBefore(
1018
- awaitBranch ??= scope[branchAccessor] = createAndSetupBranch(
1019
- scope.$global,
1020
- renderer,
1021
- scope,
1022
- namespaceNode
1023
- ),
1024
- referenceNode.parentNode,
1025
- referenceNode
1026
- ), referenceNode.remove()), renderer.l?.(awaitBranch, [data2]);
1027
- })
1028
- ), tryWithPlaceholder && !--tryWithPlaceholder.q)) {
1015
+ if (thisPromise === scope[promiseAccessor] && !scope.k?.p && (scope[promiseAccessor] = 0, renderImmediate(() => {
1016
+ tryWithPlaceholder && placeholderShown.add(pendingEffects), (!awaitBranch || !tryWithPlaceholder) && (insertBranchBefore(
1017
+ awaitBranch ??= scope[branchAccessor] = createAndSetupBranch(
1018
+ scope.$global,
1019
+ renderer,
1020
+ scope,
1021
+ namespaceNode
1022
+ ),
1023
+ referenceNode.parentNode,
1024
+ referenceNode
1025
+ ), referenceNode.remove()), renderer.l?.(awaitBranch, [data2]);
1026
+ }), tryWithPlaceholder && !--tryWithPlaceholder.q)) {
1029
1027
  let placeholderBranch = tryWithPlaceholder.c;
1030
- tryWithPlaceholder.c = void 0, placeholderBranch && (insertBranchBefore(
1028
+ tryWithPlaceholder.c = 0, placeholderBranch && (insertBranchBefore(
1031
1029
  tryWithPlaceholder,
1032
1030
  placeholderBranch.h.parentNode,
1033
1031
  placeholderBranch.h
1034
1032
  ), removeAndDestroyBranch(placeholderBranch)), tryWithPlaceholder.H && runEffects(tryWithPlaceholder.H, !0);
1035
1033
  }
1036
- }).catch((error) => {
1037
- renderCatch(scope, error, !0);
1038
- });
1039
- tryWithPlaceholder ? (placeholderShown.add(pendingEffects), tryWithPlaceholder.q || (tryWithPlaceholder.q = 0, requestAnimationFrame(() => {
1040
- if (tryWithPlaceholder.q && !tryWithPlaceholder.p) {
1041
- let placeholderBranch = tryWithPlaceholder.c = createAndSetupBranch(
1042
- scope.$global,
1043
- tryWithPlaceholder.d,
1044
- tryWithPlaceholder._,
1045
- tryWithPlaceholder.h.parentNode
1046
- );
1047
- insertBranchBefore(
1048
- placeholderBranch,
1049
- tryWithPlaceholder.h.parentNode,
1050
- tryWithPlaceholder.h
1051
- ), tempDetatchBranch(tryWithPlaceholder);
1052
- }
1053
- })), tryWithPlaceholder.q++) : awaitBranch && (awaitBranch.h.parentNode.insertBefore(
1034
+ }).catch(
1035
+ (error) => renderImmediate(() => renderCatch(scope, error, !0))
1036
+ );
1037
+ tryWithPlaceholder ? (placeholderShown.add(pendingEffects), tryWithPlaceholder.q || (tryWithPlaceholder.q = 0, requestAnimationFrame(
1038
+ () => renderImmediate(() => {
1039
+ if (tryWithPlaceholder.q && !tryWithPlaceholder.p) {
1040
+ let placeholderBranch = tryWithPlaceholder.c = createAndSetupBranch(
1041
+ scope.$global,
1042
+ tryWithPlaceholder.d,
1043
+ tryWithPlaceholder._,
1044
+ tryWithPlaceholder.h.parentNode
1045
+ );
1046
+ insertBranchBefore(
1047
+ placeholderBranch,
1048
+ tryWithPlaceholder.h.parentNode,
1049
+ tryWithPlaceholder.h
1050
+ ), tempDetatchBranch(tryWithPlaceholder);
1051
+ }
1052
+ })
1053
+ )), tryWithPlaceholder.q++) : awaitBranch && (awaitBranch.h.parentNode.insertBefore(
1054
1054
  referenceNode,
1055
1055
  awaitBranch.h
1056
1056
  ), tempDetatchBranch(awaitBranch));
1057
1057
  };
1058
1058
  }
1059
+ function renderImmediate(cb) {
1060
+ return runEffects(prepareEffects(cb));
1061
+ }
1059
1062
  function createTry(nodeAccessor, tryContent) {
1060
1063
  let branchAccessor = "d" /* ConditionalScope */ + nodeAccessor;
1061
1064
  return (scope, input) => {
@@ -1149,10 +1152,7 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1149
1152
  normalizedRenderer._ ? args[0] : args
1150
1153
  );
1151
1154
  else {
1152
- let inputWithContent = getContent ? {
1153
- ...args,
1154
- content: getContent(scope)
1155
- } : args || {};
1155
+ let inputWithContent = getContent ? { ...args, content: getContent(scope) } : args || {};
1156
1156
  normalizedRenderer.l(
1157
1157
  scope[childScopeAccessor],
1158
1158
  normalizedRenderer._ ? inputWithContent : [inputWithContent]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.0.0-next.3.70",
3
+ "version": "6.0.0-next.3.71",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",