marko 6.0.19 → 6.0.20

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
@@ -390,7 +390,9 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
390
390
  lastEffect = serialized;
391
391
  } else if (typeof serialized === "number") {
392
392
  registeredValues[lastEffect](
393
- scopeLookup[serialized],
393
+ scopeLookup[serialized] ||= {
394
+ ___id: scopeId
395
+ },
394
396
  scopeLookup[serialized]
395
397
  );
396
398
  } else {
@@ -297,7 +297,9 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
297
297
  lastEffect = serialized;
298
298
  } else if (typeof serialized === "number") {
299
299
  registeredValues[lastEffect](
300
- scopeLookup[serialized],
300
+ scopeLookup[serialized] ||= {
301
+ ___id: scopeId
302
+ },
301
303
  scopeLookup[serialized]
302
304
  );
303
305
  } else {
package/dist/dom.js CHANGED
@@ -258,19 +258,21 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
258
258
  commentPrefixLen + 1,
259
259
  visitDataIndex ? visitDataIndex - 1 : visitText.length
260
260
  ), visitData = visitDataIndex ? visitText.slice(visitDataIndex) : "", visitToken = visitText[commentPrefixLen], visitScope = scopeLookup[scopeId] ||= {
261
- m: scopeId
261
+ l: scopeId
262
262
  }, visitToken === "*" /* Node */ ? visitScope["j" /* Getter */ + visitData] = /* @__PURE__ */ ((node) => () => node)(visitScope[visitData] = visit.previousSibling) : branches && branches.J();
263
263
  for (let serialized of resumes = render.r || [])
264
264
  if (typeof serialized == "string")
265
265
  lastEffect = serialized;
266
266
  else if (typeof serialized == "number")
267
267
  registeredValues[lastEffect](
268
- scopeLookup[serialized],
268
+ scopeLookup[serialized] ||= {
269
+ l: scopeId
270
+ },
269
271
  scopeLookup[serialized]
270
272
  );
271
273
  else
272
274
  for (let scope of serialized(serializeContext))
273
- $global ? typeof scope == "number" ? lastScopeId += scope : (scopeId = ++lastScopeId, scope.$global = $global, scope.m = scopeId, scopeLookup[scopeId] !== scope && (scopeLookup[scopeId] = Object.assign(
275
+ $global ? typeof scope == "number" ? lastScopeId += scope : (scopeId = ++lastScopeId, scope.$global = $global, scope.l = scopeId, scopeLookup[scopeId] !== scope && (scopeLookup[scopeId] = Object.assign(
274
276
  scope,
275
277
  scopeLookup[scopeId]
276
278
  )), branches && branches.o(scope)) : ($global = scope || {}, $global.runtimeId = runtimeId, $global.renderId = renderId, $global.p = 1e6);
@@ -706,7 +708,7 @@ function toInsertNode(startNode, endNode) {
706
708
  // src/dom/scope.ts
707
709
  function createScope($global, closestBranch) {
708
710
  let scope = {
709
- m: $global.p++,
711
+ l: $global.p++,
710
712
  q: 1,
711
713
  k: closestBranch,
712
714
  $global
@@ -856,7 +858,7 @@ function value(valueAccessor, fn = () => {
856
858
  (!(valueAccessor in scope) || scope[valueAccessor] !== value2) && (scope[valueAccessor] = value2, fn(scope, value2));
857
859
  };
858
860
  }
859
- function intersection(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__ */ "m") {
861
+ function intersection(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__ */ "l") {
860
862
  return (scope) => {
861
863
  scope.q ? scope[id] === void 0 ? scope[id] = defaultPending : --scope[id] || fn(scope) : queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
862
864
  };
@@ -872,7 +874,7 @@ function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
872
874
  },
873
875
  -1,
874
876
  0,
875
- firstScope.m
877
+ firstScope.l
876
878
  );
877
879
  };
878
880
  return ownerSignal._ = childSignal, ownerSignal;
@@ -1025,11 +1027,11 @@ function createContent(id, template, walks, setup, params, dynamicScopesAccessor
1025
1027
  );
1026
1028
  };
1027
1029
  return (owner) => ({
1028
- m: id,
1030
+ l: id,
1029
1031
  C: clone,
1030
1032
  y: owner,
1031
1033
  D: setup,
1032
- l: params,
1034
+ m: params,
1033
1035
  z: dynamicScopesAccessor
1034
1036
  });
1035
1037
  }
@@ -1115,7 +1117,7 @@ function awaitTag(nodeAccessor, renderer) {
1115
1117
  ),
1116
1118
  referenceNode.parentNode,
1117
1119
  referenceNode
1118
- ), referenceNode.remove()), renderer.l?.(awaitBranch, [data2]), tryWithPlaceholder && (placeholderShown.add(pendingEffects), !--tryWithPlaceholder.n)) {
1120
+ ), referenceNode.remove()), renderer.m?.(awaitBranch, [data2]), tryWithPlaceholder && (placeholderShown.add(pendingEffects), !--tryWithPlaceholder.n)) {
1119
1121
  let placeholderBranch = tryWithPlaceholder.c;
1120
1122
  tryWithPlaceholder.c = 0, placeholderBranch && (placeholderBranch.h.parentNode.insertBefore(
1121
1123
  tryWithPlaceholder.h.parentNode,
@@ -1156,7 +1158,7 @@ function renderCatch(scope, error) {
1156
1158
  tryWithCatch.a,
1157
1159
  tryWithCatch.b,
1158
1160
  createAndSetupBranch
1159
- ), tryWithCatch.b.l?.(
1161
+ ), tryWithCatch.b.m?.(
1160
1162
  owner["d" /* ConditionalScope */ + tryWithCatch.a],
1161
1163
  [error]
1162
1164
  );
@@ -1181,7 +1183,7 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1181
1183
  let childScopeAccessor = "d" /* ConditionalScope */ + nodeAccessor, rendererAccessor = "c" /* ConditionalRenderer */ + nodeAccessor;
1182
1184
  return enableBranches(), (scope, newRenderer, getInput) => {
1183
1185
  let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
1184
- if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.m || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor]))
1186
+ if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.l || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor]))
1185
1187
  if (setConditionalRenderer(
1186
1188
  scope,
1187
1189
  nodeAccessor,
@@ -1220,15 +1222,15 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1220
1222
  childScope,
1221
1223
  normalizedRenderer.M[accessor]
1222
1224
  );
1223
- if (normalizedRenderer.l)
1225
+ if (normalizedRenderer.m)
1224
1226
  if (inputIsArgs)
1225
- normalizedRenderer.l(
1227
+ normalizedRenderer.m(
1226
1228
  childScope,
1227
1229
  normalizedRenderer._ ? args[0] : args
1228
1230
  );
1229
1231
  else {
1230
1232
  let inputWithContent = getContent ? { ...args, content: getContent(scope) } : args || {};
1231
- normalizedRenderer.l(
1233
+ normalizedRenderer.m(
1232
1234
  childScope,
1233
1235
  normalizedRenderer._ ? inputWithContent : [inputWithContent]
1234
1236
  );
@@ -1268,7 +1270,7 @@ function loopTo(nodeAccessor, renderer) {
1268
1270
  );
1269
1271
  }
1270
1272
  function loop(nodeAccessor, renderer, forEach) {
1271
- let params = renderer.l;
1273
+ let params = renderer.m;
1272
1274
  return enableBranches(), (scope, value2) => {
1273
1275
  let referenceNode = scope[nodeAccessor], oldMap = scope["m" /* LoopScopeMap */ + nodeAccessor], oldArray = oldMap ? scope["l" /* LoopScopeArray */ + nodeAccessor] || [
1274
1276
  ...oldMap.values()
@@ -1302,7 +1304,7 @@ function byFirstArg(name) {
1302
1304
 
1303
1305
  // src/dom/queue.ts
1304
1306
  var pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingScopes = [], rendering, scopeKeyOffset = 1e3;
1305
- function queueRender(scope, signal, signalKey, value2, scopeKey = scope.m) {
1307
+ function queueRender(scope, signal, signalKey, value2, scopeKey = scope.l) {
1306
1308
  let key = scopeKey * scopeKeyOffset + signalKey, existingRender = signalKey >= 0 && pendingRendersLookup.get(key);
1307
1309
  if (existingRender)
1308
1310
  existingRender.I = value2;
@@ -1468,7 +1470,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1468
1470
  renderer,
1469
1471
  renderer.y,
1470
1472
  document.body
1471
- )), renderer.l?.(branch, renderer._ ? args[0] : args);
1473
+ )), renderer.m?.(branch, renderer._ ? args[0] : args);
1472
1474
  }), !existing)
1473
1475
  return toInsertNode(branch.h, branch.j);
1474
1476
  }
@@ -1507,7 +1509,7 @@ function mount(input = {}, reference, position) {
1507
1509
  parentNode = reference.parentNode, nextSibling = reference.nextSibling;
1508
1510
  break;
1509
1511
  }
1510
- let args = this.l, effects = prepareEffects(() => {
1512
+ let args = this.m, effects = prepareEffects(() => {
1511
1513
  branch = createBranch(
1512
1514
  $global,
1513
1515
  this,
package/dist/dom.mjs CHANGED
@@ -168,19 +168,21 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
168
168
  commentPrefixLen + 1,
169
169
  visitDataIndex ? visitDataIndex - 1 : visitText.length
170
170
  ), visitData = visitDataIndex ? visitText.slice(visitDataIndex) : "", visitToken = visitText[commentPrefixLen], visitScope = scopeLookup[scopeId] ||= {
171
- m: scopeId
171
+ l: scopeId
172
172
  }, visitToken === "*" /* Node */ ? visitScope["j" /* Getter */ + visitData] = /* @__PURE__ */ ((node) => () => node)(visitScope[visitData] = visit.previousSibling) : branches && branches.J();
173
173
  for (let serialized of resumes = render.r || [])
174
174
  if (typeof serialized == "string")
175
175
  lastEffect = serialized;
176
176
  else if (typeof serialized == "number")
177
177
  registeredValues[lastEffect](
178
- scopeLookup[serialized],
178
+ scopeLookup[serialized] ||= {
179
+ l: scopeId
180
+ },
179
181
  scopeLookup[serialized]
180
182
  );
181
183
  else
182
184
  for (let scope of serialized(serializeContext))
183
- $global ? typeof scope == "number" ? lastScopeId += scope : (scopeId = ++lastScopeId, scope.$global = $global, scope.m = scopeId, scopeLookup[scopeId] !== scope && (scopeLookup[scopeId] = Object.assign(
185
+ $global ? typeof scope == "number" ? lastScopeId += scope : (scopeId = ++lastScopeId, scope.$global = $global, scope.l = scopeId, scopeLookup[scopeId] !== scope && (scopeLookup[scopeId] = Object.assign(
184
186
  scope,
185
187
  scopeLookup[scopeId]
186
188
  )), branches && branches.o(scope)) : ($global = scope || {}, $global.runtimeId = runtimeId, $global.renderId = renderId, $global.p = 1e6);
@@ -616,7 +618,7 @@ function toInsertNode(startNode, endNode) {
616
618
  // src/dom/scope.ts
617
619
  function createScope($global, closestBranch) {
618
620
  let scope = {
619
- m: $global.p++,
621
+ l: $global.p++,
620
622
  q: 1,
621
623
  k: closestBranch,
622
624
  $global
@@ -766,7 +768,7 @@ function value(valueAccessor, fn = () => {
766
768
  (!(valueAccessor in scope) || scope[valueAccessor] !== value2) && (scope[valueAccessor] = value2, fn(scope, value2));
767
769
  };
768
770
  }
769
- function intersection(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__ */ "m") {
771
+ function intersection(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__ */ "l") {
770
772
  return (scope) => {
771
773
  scope.q ? scope[id] === void 0 ? scope[id] = defaultPending : --scope[id] || fn(scope) : queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
772
774
  };
@@ -782,7 +784,7 @@ function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
782
784
  },
783
785
  -1,
784
786
  0,
785
- firstScope.m
787
+ firstScope.l
786
788
  );
787
789
  };
788
790
  return ownerSignal._ = childSignal, ownerSignal;
@@ -935,11 +937,11 @@ function createContent(id, template, walks, setup, params, dynamicScopesAccessor
935
937
  );
936
938
  };
937
939
  return (owner) => ({
938
- m: id,
940
+ l: id,
939
941
  C: clone,
940
942
  y: owner,
941
943
  D: setup,
942
- l: params,
944
+ m: params,
943
945
  z: dynamicScopesAccessor
944
946
  });
945
947
  }
@@ -1025,7 +1027,7 @@ function awaitTag(nodeAccessor, renderer) {
1025
1027
  ),
1026
1028
  referenceNode.parentNode,
1027
1029
  referenceNode
1028
- ), referenceNode.remove()), renderer.l?.(awaitBranch, [data2]), tryWithPlaceholder && (placeholderShown.add(pendingEffects), !--tryWithPlaceholder.n)) {
1030
+ ), referenceNode.remove()), renderer.m?.(awaitBranch, [data2]), tryWithPlaceholder && (placeholderShown.add(pendingEffects), !--tryWithPlaceholder.n)) {
1029
1031
  let placeholderBranch = tryWithPlaceholder.c;
1030
1032
  tryWithPlaceholder.c = 0, placeholderBranch && (placeholderBranch.h.parentNode.insertBefore(
1031
1033
  tryWithPlaceholder.h.parentNode,
@@ -1066,7 +1068,7 @@ function renderCatch(scope, error) {
1066
1068
  tryWithCatch.a,
1067
1069
  tryWithCatch.b,
1068
1070
  createAndSetupBranch
1069
- ), tryWithCatch.b.l?.(
1071
+ ), tryWithCatch.b.m?.(
1070
1072
  owner["d" /* ConditionalScope */ + tryWithCatch.a],
1071
1073
  [error]
1072
1074
  );
@@ -1091,7 +1093,7 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1091
1093
  let childScopeAccessor = "d" /* ConditionalScope */ + nodeAccessor, rendererAccessor = "c" /* ConditionalRenderer */ + nodeAccessor;
1092
1094
  return enableBranches(), (scope, newRenderer, getInput) => {
1093
1095
  let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
1094
- if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.m || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor]))
1096
+ if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.l || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor]))
1095
1097
  if (setConditionalRenderer(
1096
1098
  scope,
1097
1099
  nodeAccessor,
@@ -1130,15 +1132,15 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1130
1132
  childScope,
1131
1133
  normalizedRenderer.M[accessor]
1132
1134
  );
1133
- if (normalizedRenderer.l)
1135
+ if (normalizedRenderer.m)
1134
1136
  if (inputIsArgs)
1135
- normalizedRenderer.l(
1137
+ normalizedRenderer.m(
1136
1138
  childScope,
1137
1139
  normalizedRenderer._ ? args[0] : args
1138
1140
  );
1139
1141
  else {
1140
1142
  let inputWithContent = getContent ? { ...args, content: getContent(scope) } : args || {};
1141
- normalizedRenderer.l(
1143
+ normalizedRenderer.m(
1142
1144
  childScope,
1143
1145
  normalizedRenderer._ ? inputWithContent : [inputWithContent]
1144
1146
  );
@@ -1178,7 +1180,7 @@ function loopTo(nodeAccessor, renderer) {
1178
1180
  );
1179
1181
  }
1180
1182
  function loop(nodeAccessor, renderer, forEach) {
1181
- let params = renderer.l;
1183
+ let params = renderer.m;
1182
1184
  return enableBranches(), (scope, value2) => {
1183
1185
  let referenceNode = scope[nodeAccessor], oldMap = scope["m" /* LoopScopeMap */ + nodeAccessor], oldArray = oldMap ? scope["l" /* LoopScopeArray */ + nodeAccessor] || [
1184
1186
  ...oldMap.values()
@@ -1212,7 +1214,7 @@ function byFirstArg(name) {
1212
1214
 
1213
1215
  // src/dom/queue.ts
1214
1216
  var pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingScopes = [], rendering, scopeKeyOffset = 1e3;
1215
- function queueRender(scope, signal, signalKey, value2, scopeKey = scope.m) {
1217
+ function queueRender(scope, signal, signalKey, value2, scopeKey = scope.l) {
1216
1218
  let key = scopeKey * scopeKeyOffset + signalKey, existingRender = signalKey >= 0 && pendingRendersLookup.get(key);
1217
1219
  if (existingRender)
1218
1220
  existingRender.I = value2;
@@ -1378,7 +1380,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1378
1380
  renderer,
1379
1381
  renderer.y,
1380
1382
  document.body
1381
- )), renderer.l?.(branch, renderer._ ? args[0] : args);
1383
+ )), renderer.m?.(branch, renderer._ ? args[0] : args);
1382
1384
  }), !existing)
1383
1385
  return toInsertNode(branch.h, branch.j);
1384
1386
  }
@@ -1417,7 +1419,7 @@ function mount(input = {}, reference, position) {
1417
1419
  parentNode = reference.parentNode, nextSibling = reference.nextSibling;
1418
1420
  break;
1419
1421
  }
1420
- let args = this.l, effects = prepareEffects(() => {
1422
+ let args = this.m, effects = prepareEffects(() => {
1421
1423
  branch = createBranch(
1422
1424
  $global,
1423
1425
  this,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.0.19",
3
+ "version": "6.0.20",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",
@@ -48,7 +48,7 @@
48
48
  "build": "node -r ~ts ./scripts/bundle.ts"
49
49
  },
50
50
  "dependencies": {
51
- "@marko/compiler": "^5.39.19",
51
+ "@marko/compiler": "^5.39.20",
52
52
  "csstype": "^3.1.3",
53
53
  "magic-string": "^0.30.17"
54
54
  },