marko 6.0.73 → 6.0.74

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
@@ -1004,7 +1004,7 @@ function _if_closure(valueAccessor, ownerConditionalNodeAccessor, branch, fn) {
1004
1004
  const branchAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + ownerConditionalNodeAccessor;
1005
1005
  const ownerSignal = (scope) => {
1006
1006
  const ifScope = scope[scopeAccessor];
1007
- if (ifScope && !ifScope.___creating && (scope[branchAccessor] ?? branch) === branch) {
1007
+ if (ifScope && !ifScope.___creating && (scope[branchAccessor] || 0) === branch) {
1008
1008
  queueRender(ifScope, childSignal, -1);
1009
1009
  }
1010
1010
  };
@@ -905,7 +905,7 @@ function _if_closure(valueAccessor, ownerConditionalNodeAccessor, branch, fn) {
905
905
  const branchAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + ownerConditionalNodeAccessor;
906
906
  const ownerSignal = (scope) => {
907
907
  const ifScope = scope[scopeAccessor];
908
- if (ifScope && !ifScope.___creating && (scope[branchAccessor] ?? branch) === branch) {
908
+ if (ifScope && !ifScope.___creating && (scope[branchAccessor] || 0) === branch) {
909
909
  queueRender(ifScope, childSignal, -1);
910
910
  }
911
911
  };
@@ -2014,7 +2014,11 @@ function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, serializeS
2014
2014
  const shouldWriteBranch = resumeBranch && branchIndex !== void 0;
2015
2015
  if (shouldWriteBranch) {
2016
2016
  writeScope(scopeId, {
2017
- ["ConditionalRenderer:" /* ConditionalRenderer */ + accessor]: resumeMarker ? branchIndex : void 0,
2017
+ // TODO: technically conditional renderer should only be written when either the
2018
+ // condition is stateful, or if there are direct closures.
2019
+ // It may make sense to pass in another arg for this.
2020
+ ["ConditionalRenderer:" /* ConditionalRenderer */ + accessor]: branchIndex || void 0,
2021
+ // we convert 0 to undefined since the runtime defaults branch to 0.
2018
2022
  ["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
2019
2023
  });
2020
2024
  }
@@ -1928,7 +1928,11 @@ function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, serializeS
1928
1928
  const shouldWriteBranch = resumeBranch && branchIndex !== void 0;
1929
1929
  if (shouldWriteBranch) {
1930
1930
  writeScope(scopeId, {
1931
- ["ConditionalRenderer:" /* ConditionalRenderer */ + accessor]: resumeMarker ? branchIndex : void 0,
1931
+ // TODO: technically conditional renderer should only be written when either the
1932
+ // condition is stateful, or if there are direct closures.
1933
+ // It may make sense to pass in another arg for this.
1934
+ ["ConditionalRenderer:" /* ConditionalRenderer */ + accessor]: branchIndex || void 0,
1935
+ // we convert 0 to undefined since the runtime defaults branch to 0.
1932
1936
  ["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
1933
1937
  });
1934
1938
  }
package/dist/dom.js CHANGED
@@ -643,7 +643,7 @@ function _for_closure(valueAccessor, ownerLoopNodeAccessor, fn) {
643
643
  function _if_closure(valueAccessor, ownerConditionalNodeAccessor, branch, fn) {
644
644
  let childSignal = closure(valueAccessor, fn), scopeAccessor = "d" /* ConditionalScope */ + ownerConditionalNodeAccessor, branchAccessor = "c" /* ConditionalRenderer */ + ownerConditionalNodeAccessor, ownerSignal = (scope) => {
645
645
  let ifScope = scope[scopeAccessor];
646
- ifScope && !ifScope.q && (scope[branchAccessor] ?? branch) === branch && queueRender(ifScope, childSignal, -1);
646
+ ifScope && !ifScope.q && (scope[branchAccessor] || 0) === branch && queueRender(ifScope, childSignal, -1);
647
647
  };
648
648
  return ownerSignal._ = childSignal, ownerSignal;
649
649
  }
package/dist/dom.mjs CHANGED
@@ -547,7 +547,7 @@ function _for_closure(valueAccessor, ownerLoopNodeAccessor, fn) {
547
547
  function _if_closure(valueAccessor, ownerConditionalNodeAccessor, branch, fn) {
548
548
  let childSignal = closure(valueAccessor, fn), scopeAccessor = "d" /* ConditionalScope */ + ownerConditionalNodeAccessor, branchAccessor = "c" /* ConditionalRenderer */ + ownerConditionalNodeAccessor, ownerSignal = (scope) => {
549
549
  let ifScope = scope[scopeAccessor];
550
- ifScope && !ifScope.q && (scope[branchAccessor] ?? branch) === branch && queueRender(ifScope, childSignal, -1);
550
+ ifScope && !ifScope.q && (scope[branchAccessor] || 0) === branch && queueRender(ifScope, childSignal, -1);
551
551
  };
552
552
  return ownerSignal._ = childSignal, ownerSignal;
553
553
  }
package/dist/html.js CHANGED
@@ -1306,7 +1306,11 @@ function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, serializeS
1306
1306
  resumeMarker && resumeBranch && !singleNode && $chunk.writeHTML(state.mark("[" /* BranchStart */, ""));
1307
1307
  let branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb(), shouldWriteBranch = resumeBranch && branchIndex !== void 0;
1308
1308
  shouldWriteBranch && writeScope(scopeId, {
1309
- ["c" /* ConditionalRenderer */ + accessor]: resumeMarker ? branchIndex : void 0,
1309
+ // TODO: technically conditional renderer should only be written when either the
1310
+ // condition is stateful, or if there are direct closures.
1311
+ // It may make sense to pass in another arg for this.
1312
+ ["c" /* ConditionalRenderer */ + accessor]: branchIndex || void 0,
1313
+ // we convert 0 to undefined since the runtime defaults branch to 0.
1310
1314
  ["d" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
1311
1315
  }), writeBranchEnd(
1312
1316
  scopeId,
package/dist/html.mjs CHANGED
@@ -1223,7 +1223,11 @@ function _if(cb, scopeId, accessor, serializeBranch, serializeMarker, serializeS
1223
1223
  resumeMarker && resumeBranch && !singleNode && $chunk.writeHTML(state.mark("[" /* BranchStart */, ""));
1224
1224
  let branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb(), shouldWriteBranch = resumeBranch && branchIndex !== void 0;
1225
1225
  shouldWriteBranch && writeScope(scopeId, {
1226
- ["c" /* ConditionalRenderer */ + accessor]: resumeMarker ? branchIndex : void 0,
1226
+ // TODO: technically conditional renderer should only be written when either the
1227
+ // condition is stateful, or if there are direct closures.
1228
+ // It may make sense to pass in another arg for this.
1229
+ ["c" /* ConditionalRenderer */ + accessor]: branchIndex || void 0,
1230
+ // we convert 0 to undefined since the runtime defaults branch to 0.
1227
1231
  ["d" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
1228
1232
  }), writeBranchEnd(
1229
1233
  scopeId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.0.73",
3
+ "version": "6.0.74",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",