@marko/runtime-tags 6.0.148 → 6.0.150

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
@@ -1593,8 +1593,7 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
1593
1593
  }
1594
1594
  function _attr_content(scope, nodeAccessor, value) {
1595
1595
  const content = normalizeClientRender(value);
1596
- const rendererAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor;
1597
- if (scope[rendererAccessor] !== (scope[rendererAccessor] = content?.___id)) {
1596
+ if (scope["ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor] !== (scope["ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor] = content?.___id)) {
1598
1597
  setConditionalRenderer(scope, nodeAccessor, content, createAndSetupBranch);
1599
1598
  if (content?.___accessor) {
1600
1599
  subscribeToScopeSet(
@@ -1604,6 +1603,12 @@ function _attr_content(scope, nodeAccessor, value) {
1604
1603
  );
1605
1604
  }
1606
1605
  }
1606
+ for (const accessor in content?.___localClosures) {
1607
+ content.___localClosures[accessor](
1608
+ scope["BranchScopes:" /* BranchScopes */ + nodeAccessor],
1609
+ content.___localClosureValues[accessor]
1610
+ );
1611
+ }
1607
1612
  }
1608
1613
  function _attrs_script(scope, nodeAccessor) {
1609
1614
  const el = scope[nodeAccessor];
@@ -1479,8 +1479,7 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
1479
1479
  }
1480
1480
  function _attr_content(scope, nodeAccessor, value) {
1481
1481
  const content = normalizeClientRender(value);
1482
- const rendererAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor;
1483
- if (scope[rendererAccessor] !== (scope[rendererAccessor] = content?.___id)) {
1482
+ if (scope["ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor] !== (scope["ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor] = content?.___id)) {
1484
1483
  setConditionalRenderer(scope, nodeAccessor, content, createAndSetupBranch);
1485
1484
  if (content?.___accessor) {
1486
1485
  subscribeToScopeSet(
@@ -1490,6 +1489,12 @@ function _attr_content(scope, nodeAccessor, value) {
1490
1489
  );
1491
1490
  }
1492
1491
  }
1492
+ for (const accessor in content?.___localClosures) {
1493
+ content.___localClosures[accessor](
1494
+ scope["BranchScopes:" /* BranchScopes */ + nodeAccessor],
1495
+ content.___localClosureValues[accessor]
1496
+ );
1497
+ }
1493
1498
  }
1494
1499
  function _attrs_script(scope, nodeAccessor) {
1495
1500
  const el = scope[nodeAccessor];
@@ -684,6 +684,7 @@ var State = class {
684
684
  flushed = false;
685
685
  wroteUndefined = false;
686
686
  buf = [];
687
+ strs = /* @__PURE__ */ new Map();
687
688
  refs = /* @__PURE__ */ new WeakMap();
688
689
  assigned = /* @__PURE__ */ new Set();
689
690
  registered = [];
@@ -888,7 +889,7 @@ function writeAssigned(state) {
888
889
  function writeProp(state, val, parent, accessor) {
889
890
  switch (typeof val) {
890
891
  case "string":
891
- return writeString(state, val);
892
+ return writeString(state, val, parent, accessor);
892
893
  case "number":
893
894
  return writeNumber(state, val);
894
895
  case "boolean":
@@ -955,8 +956,21 @@ function writeRegistered(state, val, parent, accessor, registered) {
955
956
  }
956
957
  return true;
957
958
  }
958
- function writeString(state, val) {
959
- state.buf.push(quote(val, 0));
959
+ function writeString(state, val, parent, accessor) {
960
+ if (val.length > 30) {
961
+ const ref = state.strs.get(val);
962
+ if (ref) {
963
+ state.buf.push(ensureId(state, ref));
964
+ } else {
965
+ state.strs.set(
966
+ val,
967
+ new Reference(parent, accessor, state.flush, state.buf.length)
968
+ );
969
+ state.buf.push(quote(val, 0));
970
+ }
971
+ } else {
972
+ state.buf.push(quote(val, 0));
973
+ }
960
974
  return true;
961
975
  }
962
976
  function writeNumber(state, val) {
@@ -1814,7 +1828,9 @@ function _attr_content(nodeAccessor, scopeId, content, serializeReason) {
1814
1828
  if (rendered) {
1815
1829
  if (shouldResume) {
1816
1830
  writeScope(scopeId, {
1817
- ["BranchScopes:" /* BranchScopes */ + nodeAccessor]: writeScope(branchId, {}),
1831
+ ["BranchScopes:" /* BranchScopes */ + nodeAccessor]: referenceScope(
1832
+ writeScope(branchId, {})
1833
+ ),
1818
1834
  ["ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor]: render2?.___id
1819
1835
  });
1820
1836
  }
@@ -591,6 +591,7 @@ var State = class {
591
591
  flushed = false;
592
592
  wroteUndefined = false;
593
593
  buf = [];
594
+ strs = /* @__PURE__ */ new Map();
594
595
  refs = /* @__PURE__ */ new WeakMap();
595
596
  assigned = /* @__PURE__ */ new Set();
596
597
  registered = [];
@@ -795,7 +796,7 @@ function writeAssigned(state) {
795
796
  function writeProp(state, val, parent, accessor) {
796
797
  switch (typeof val) {
797
798
  case "string":
798
- return writeString(state, val);
799
+ return writeString(state, val, parent, accessor);
799
800
  case "number":
800
801
  return writeNumber(state, val);
801
802
  case "boolean":
@@ -862,8 +863,21 @@ function writeRegistered(state, val, parent, accessor, registered) {
862
863
  }
863
864
  return true;
864
865
  }
865
- function writeString(state, val) {
866
- state.buf.push(quote(val, 0));
866
+ function writeString(state, val, parent, accessor) {
867
+ if (val.length > 30) {
868
+ const ref = state.strs.get(val);
869
+ if (ref) {
870
+ state.buf.push(ensureId(state, ref));
871
+ } else {
872
+ state.strs.set(
873
+ val,
874
+ new Reference(parent, accessor, state.flush, state.buf.length)
875
+ );
876
+ state.buf.push(quote(val, 0));
877
+ }
878
+ } else {
879
+ state.buf.push(quote(val, 0));
880
+ }
867
881
  return true;
868
882
  }
869
883
  function writeNumber(state, val) {
@@ -1721,7 +1735,9 @@ function _attr_content(nodeAccessor, scopeId, content, serializeReason) {
1721
1735
  if (rendered) {
1722
1736
  if (shouldResume) {
1723
1737
  writeScope(scopeId, {
1724
- ["BranchScopes:" /* BranchScopes */ + nodeAccessor]: writeScope(branchId, {}),
1738
+ ["BranchScopes:" /* BranchScopes */ + nodeAccessor]: referenceScope(
1739
+ writeScope(branchId, {})
1740
+ ),
1725
1741
  ["ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor]: render2?.___id
1726
1742
  });
1727
1743
  }
package/dist/dom.js CHANGED
@@ -371,9 +371,9 @@ function subscribeToScopeSet(ownerScope, accessor, scope) {
371
371
  ));
372
372
  }
373
373
  function _closure(...closureSignals) {
374
- let [{ k: ___scopeInstancesAccessor, l: ___signalIndexAccessor }] = closureSignals;
374
+ let [{ l: ___scopeInstancesAccessor, n: ___signalIndexAccessor }] = closureSignals;
375
375
  for (let i = closureSignals.length; i--; )
376
- closureSignals[i].q = i;
376
+ closureSignals[i].t = i;
377
377
  return (scope) => {
378
378
  if (scope[___scopeInstancesAccessor])
379
379
  for (let childScope of scope[___scopeInstancesAccessor])
@@ -387,13 +387,13 @@ function _closure(...closureSignals) {
387
387
  function _closure_get(valueAccessor, fn, getOwnerScope, resumeId) {
388
388
  valueAccessor = decodeAccessor(valueAccessor);
389
389
  let closureSignal = ((scope) => {
390
- scope[closureSignal.l] = closureSignal.q, fn(scope), subscribeToScopeSet(
390
+ scope[closureSignal.n] = closureSignal.t, fn(scope), subscribeToScopeSet(
391
391
  getOwnerScope ? getOwnerScope(scope) : scope._,
392
- closureSignal.k,
392
+ closureSignal.l,
393
393
  scope
394
394
  );
395
395
  });
396
- return closureSignal.k = "B" /* ClosureScopes */ + valueAccessor, closureSignal.l = "C" /* ClosureSignalIndex */ + valueAccessor, resumeId && _resume(resumeId, closureSignal), closureSignal;
396
+ return closureSignal.l = "B" /* ClosureScopes */ + valueAccessor, closureSignal.n = "C" /* ClosureSignalIndex */ + valueAccessor, resumeId && _resume(resumeId, closureSignal), closureSignal;
397
397
  }
398
398
  function _child_setup(setup) {
399
399
  return setup._ = (scope, owner) => {
@@ -485,7 +485,7 @@ function walkInternal(currentWalkIndex, walkCodes, scope) {
485
485
  // src/dom/renderer.ts
486
486
  function createBranch($global, renderer, parentScope, parentNode) {
487
487
  let branch = createScope($global);
488
- return branch._ = renderer.e || parentScope, setParentBranch(branch, parentScope?.F), renderer.h?.(
488
+ return branch._ = renderer.e || parentScope, setParentBranch(branch, parentScope?.F), renderer.j?.(
489
489
  branch,
490
490
  parentNode.namespaceURI
491
491
  ), branch;
@@ -500,7 +500,7 @@ function createAndSetupBranch($global, renderer, parentScope, parentNode) {
500
500
  );
501
501
  }
502
502
  function setupBranch(renderer, branch) {
503
- return renderer.j && queueRender(branch, renderer.j, -1), branch;
503
+ return renderer.k && queueRender(branch, renderer.k, -1), branch;
504
504
  }
505
505
  function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
506
506
  walks = walks ? walks.replace(/[^\0-1]+$/, "") : "", setup = setup ? setup._ || setup : void 0, params ||= void 0;
@@ -518,9 +518,9 @@ function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
518
518
  };
519
519
  return (owner) => ({
520
520
  f: id,
521
- h: clone,
521
+ j: clone,
522
522
  e: owner,
523
- j: setup,
523
+ k: setup,
524
524
  b: params,
525
525
  d: dynamicScopesAccessor
526
526
  });
@@ -537,7 +537,7 @@ function _content_closures(renderer, closureFns) {
537
537
  closureSignals[key] = _const(+key, closureFns[key]);
538
538
  return (owner, closureValues) => {
539
539
  let instance = renderer(owner);
540
- return instance.n = closureSignals, instance.t = closureValues, instance;
540
+ return instance.g = closureSignals, instance.o = closureValues, instance;
541
541
  };
542
542
  }
543
543
  var cloneCache = {};
@@ -989,12 +989,17 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
989
989
  }
990
990
  }
991
991
  function _attr_content(scope, nodeAccessor, value) {
992
- let content = normalizeClientRender(value), rendererAccessor = "D" /* ConditionalRenderer */ + nodeAccessor;
993
- scope[rendererAccessor] !== (scope[rendererAccessor] = content?.f) && (setConditionalRenderer(scope, nodeAccessor, content, createAndSetupBranch), content?.d && subscribeToScopeSet(
992
+ let content = normalizeClientRender(value);
993
+ scope["D" /* ConditionalRenderer */ + nodeAccessor] !== (scope["D" /* ConditionalRenderer */ + nodeAccessor] = content?.f) && (setConditionalRenderer(scope, nodeAccessor, content, createAndSetupBranch), content?.d && subscribeToScopeSet(
994
994
  content.e,
995
995
  content.d,
996
996
  scope["A" /* BranchScopes */ + nodeAccessor]
997
997
  ));
998
+ for (let accessor in content?.g)
999
+ content.g[accessor](
1000
+ scope["A" /* BranchScopes */ + nodeAccessor],
1001
+ content.o[accessor]
1002
+ );
998
1003
  }
999
1004
  function _attrs_script(scope, nodeAccessor) {
1000
1005
  let el = scope[nodeAccessor], events = scope["I" /* EventAttributes */ + nodeAccessor];
@@ -1337,10 +1342,10 @@ var _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1337
1342
  (inputIsArgs ? args[0] : args) || {}
1338
1343
  ), (childScope["Ia"] || childScope["Ea"]) && queueEffect(childScope, dynamicTagScript);
1339
1344
  else {
1340
- for (let accessor in normalizedRenderer.n)
1341
- normalizedRenderer.n[accessor](
1345
+ for (let accessor in normalizedRenderer.g)
1346
+ normalizedRenderer.g[accessor](
1342
1347
  childScope,
1343
- normalizedRenderer.t[accessor]
1348
+ normalizedRenderer.o[accessor]
1344
1349
  );
1345
1350
  if (normalizedRenderer.b)
1346
1351
  if (inputIsArgs)
@@ -1437,12 +1442,12 @@ function byFirstArg(name) {
1437
1442
  var pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), asyncRendersLookup, caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingScopes = [], rendering, scopeKeyOffset = 1e3;
1438
1443
  function queueRender(scope, signal, signalKey, value, scopeKey = scope.L) {
1439
1444
  let key = scopeKey * scopeKeyOffset + signalKey, render = signalKey >= 0 && pendingRendersLookup.get(key);
1440
- render ? render.o = value : (queuePendingRender(
1445
+ render ? render.q = value : (queuePendingRender(
1441
1446
  render = {
1442
1447
  a: key,
1443
- g: scope,
1448
+ h: scope,
1444
1449
  u: signal,
1445
- o: value
1450
+ q: value
1446
1451
  }
1447
1452
  ), signalKey >= 0 && pendingRendersLookup.set(key, render));
1448
1453
  }
@@ -1495,13 +1500,13 @@ function runRenders() {
1495
1500
  }
1496
1501
  pendingRenders[i] = item;
1497
1502
  }
1498
- render.g.F?.I || runRender(render);
1503
+ render.h.F?.I || runRender(render);
1499
1504
  }
1500
1505
  for (let scope of pendingScopes)
1501
1506
  scope.H = 0;
1502
1507
  pendingScopes = [];
1503
1508
  }
1504
- var runRender = (render) => render.u(render.g, render.o), _enable_catch = () => {
1509
+ var runRender = (render) => render.u(render.h, render.q), _enable_catch = () => {
1505
1510
  _enable_catch = () => {
1506
1511
  }, enableBranches();
1507
1512
  let handlePendingTry = (fn, scope, branch) => {
@@ -1520,7 +1525,7 @@ var runRender = (render) => render.u(render.g, render.o), _enable_catch = () =>
1520
1525
  runEffects2(effects);
1521
1526
  })(runEffects), runRender = /* @__PURE__ */ ((runRender2) => (render) => {
1522
1527
  try {
1523
- let branch = render.g.F;
1528
+ let branch = render.h.F;
1524
1529
  for (; branch; ) {
1525
1530
  if (branch.W)
1526
1531
  return asyncRendersLookup.set(
@@ -1531,7 +1536,7 @@ var runRender = (render) => render.u(render.g, render.o), _enable_catch = () =>
1531
1536
  }
1532
1537
  runRender2(render);
1533
1538
  } catch (error) {
1534
- renderCatch(render.g, error);
1539
+ renderCatch(render.h, error);
1535
1540
  }
1536
1541
  })(runRender);
1537
1542
  };
@@ -1564,7 +1569,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1564
1569
  _resume(RENDERER_REGISTER_ID, fn);
1565
1570
  },
1566
1571
  isRenderer(renderer) {
1567
- return renderer.h;
1572
+ return renderer.j;
1568
1573
  },
1569
1574
  getStartNode(branch) {
1570
1575
  return branch.S;
@@ -1586,7 +1591,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1586
1591
  },
1587
1592
  createRenderer(params, clone) {
1588
1593
  let renderer = _content("", 0, 0, 0, params)();
1589
- return renderer.h = (branch) => {
1594
+ return renderer.j = (branch) => {
1590
1595
  let cloned = clone();
1591
1596
  branch.S = cloned.startNode, branch.K = cloned.endNode;
1592
1597
  }, renderer;
@@ -1652,7 +1657,7 @@ function mount(input = {}, reference, position) {
1652
1657
  parentNode
1653
1658
  ), branch.T = (newValue) => {
1654
1659
  curValue = newValue;
1655
- }, this.j?.(branch), args?.(branch, input);
1660
+ }, this.k?.(branch), args?.(branch, input);
1656
1661
  });
1657
1662
  return insertChildNodes(
1658
1663
  parentNode,
package/dist/dom.mjs CHANGED
@@ -260,9 +260,9 @@ function subscribeToScopeSet(ownerScope, accessor, scope) {
260
260
  ));
261
261
  }
262
262
  function _closure(...closureSignals) {
263
- let [{ k: ___scopeInstancesAccessor, l: ___signalIndexAccessor }] = closureSignals;
263
+ let [{ l: ___scopeInstancesAccessor, n: ___signalIndexAccessor }] = closureSignals;
264
264
  for (let i = closureSignals.length; i--; )
265
- closureSignals[i].q = i;
265
+ closureSignals[i].t = i;
266
266
  return (scope) => {
267
267
  if (scope[___scopeInstancesAccessor])
268
268
  for (let childScope of scope[___scopeInstancesAccessor])
@@ -276,13 +276,13 @@ function _closure(...closureSignals) {
276
276
  function _closure_get(valueAccessor, fn, getOwnerScope, resumeId) {
277
277
  valueAccessor = decodeAccessor(valueAccessor);
278
278
  let closureSignal = ((scope) => {
279
- scope[closureSignal.l] = closureSignal.q, fn(scope), subscribeToScopeSet(
279
+ scope[closureSignal.n] = closureSignal.t, fn(scope), subscribeToScopeSet(
280
280
  getOwnerScope ? getOwnerScope(scope) : scope._,
281
- closureSignal.k,
281
+ closureSignal.l,
282
282
  scope
283
283
  );
284
284
  });
285
- return closureSignal.k = "B" /* ClosureScopes */ + valueAccessor, closureSignal.l = "C" /* ClosureSignalIndex */ + valueAccessor, resumeId && _resume(resumeId, closureSignal), closureSignal;
285
+ return closureSignal.l = "B" /* ClosureScopes */ + valueAccessor, closureSignal.n = "C" /* ClosureSignalIndex */ + valueAccessor, resumeId && _resume(resumeId, closureSignal), closureSignal;
286
286
  }
287
287
  function _child_setup(setup) {
288
288
  return setup._ = (scope, owner) => {
@@ -374,7 +374,7 @@ function walkInternal(currentWalkIndex, walkCodes, scope) {
374
374
  // src/dom/renderer.ts
375
375
  function createBranch($global, renderer, parentScope, parentNode) {
376
376
  let branch = createScope($global);
377
- return branch._ = renderer.e || parentScope, setParentBranch(branch, parentScope?.F), renderer.h?.(
377
+ return branch._ = renderer.e || parentScope, setParentBranch(branch, parentScope?.F), renderer.j?.(
378
378
  branch,
379
379
  parentNode.namespaceURI
380
380
  ), branch;
@@ -389,7 +389,7 @@ function createAndSetupBranch($global, renderer, parentScope, parentNode) {
389
389
  );
390
390
  }
391
391
  function setupBranch(renderer, branch) {
392
- return renderer.j && queueRender(branch, renderer.j, -1), branch;
392
+ return renderer.k && queueRender(branch, renderer.k, -1), branch;
393
393
  }
394
394
  function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
395
395
  walks = walks ? walks.replace(/[^\0-1]+$/, "") : "", setup = setup ? setup._ || setup : void 0, params ||= void 0;
@@ -407,9 +407,9 @@ function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
407
407
  };
408
408
  return (owner) => ({
409
409
  f: id,
410
- h: clone,
410
+ j: clone,
411
411
  e: owner,
412
- j: setup,
412
+ k: setup,
413
413
  b: params,
414
414
  d: dynamicScopesAccessor
415
415
  });
@@ -426,7 +426,7 @@ function _content_closures(renderer, closureFns) {
426
426
  closureSignals[key] = _const(+key, closureFns[key]);
427
427
  return (owner, closureValues) => {
428
428
  let instance = renderer(owner);
429
- return instance.n = closureSignals, instance.t = closureValues, instance;
429
+ return instance.g = closureSignals, instance.o = closureValues, instance;
430
430
  };
431
431
  }
432
432
  var cloneCache = {};
@@ -878,12 +878,17 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
878
878
  }
879
879
  }
880
880
  function _attr_content(scope, nodeAccessor, value) {
881
- let content = normalizeClientRender(value), rendererAccessor = "D" /* ConditionalRenderer */ + nodeAccessor;
882
- scope[rendererAccessor] !== (scope[rendererAccessor] = content?.f) && (setConditionalRenderer(scope, nodeAccessor, content, createAndSetupBranch), content?.d && subscribeToScopeSet(
881
+ let content = normalizeClientRender(value);
882
+ scope["D" /* ConditionalRenderer */ + nodeAccessor] !== (scope["D" /* ConditionalRenderer */ + nodeAccessor] = content?.f) && (setConditionalRenderer(scope, nodeAccessor, content, createAndSetupBranch), content?.d && subscribeToScopeSet(
883
883
  content.e,
884
884
  content.d,
885
885
  scope["A" /* BranchScopes */ + nodeAccessor]
886
886
  ));
887
+ for (let accessor in content?.g)
888
+ content.g[accessor](
889
+ scope["A" /* BranchScopes */ + nodeAccessor],
890
+ content.o[accessor]
891
+ );
887
892
  }
888
893
  function _attrs_script(scope, nodeAccessor) {
889
894
  let el = scope[nodeAccessor], events = scope["I" /* EventAttributes */ + nodeAccessor];
@@ -1226,10 +1231,10 @@ var _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1226
1231
  (inputIsArgs ? args[0] : args) || {}
1227
1232
  ), (childScope["Ia"] || childScope["Ea"]) && queueEffect(childScope, dynamicTagScript);
1228
1233
  else {
1229
- for (let accessor in normalizedRenderer.n)
1230
- normalizedRenderer.n[accessor](
1234
+ for (let accessor in normalizedRenderer.g)
1235
+ normalizedRenderer.g[accessor](
1231
1236
  childScope,
1232
- normalizedRenderer.t[accessor]
1237
+ normalizedRenderer.o[accessor]
1233
1238
  );
1234
1239
  if (normalizedRenderer.b)
1235
1240
  if (inputIsArgs)
@@ -1326,12 +1331,12 @@ function byFirstArg(name) {
1326
1331
  var pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), asyncRendersLookup, caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingScopes = [], rendering, scopeKeyOffset = 1e3;
1327
1332
  function queueRender(scope, signal, signalKey, value, scopeKey = scope.L) {
1328
1333
  let key = scopeKey * scopeKeyOffset + signalKey, render = signalKey >= 0 && pendingRendersLookup.get(key);
1329
- render ? render.o = value : (queuePendingRender(
1334
+ render ? render.q = value : (queuePendingRender(
1330
1335
  render = {
1331
1336
  a: key,
1332
- g: scope,
1337
+ h: scope,
1333
1338
  u: signal,
1334
- o: value
1339
+ q: value
1335
1340
  }
1336
1341
  ), signalKey >= 0 && pendingRendersLookup.set(key, render));
1337
1342
  }
@@ -1384,13 +1389,13 @@ function runRenders() {
1384
1389
  }
1385
1390
  pendingRenders[i] = item;
1386
1391
  }
1387
- render.g.F?.I || runRender(render);
1392
+ render.h.F?.I || runRender(render);
1388
1393
  }
1389
1394
  for (let scope of pendingScopes)
1390
1395
  scope.H = 0;
1391
1396
  pendingScopes = [];
1392
1397
  }
1393
- var runRender = (render) => render.u(render.g, render.o), _enable_catch = () => {
1398
+ var runRender = (render) => render.u(render.h, render.q), _enable_catch = () => {
1394
1399
  _enable_catch = () => {
1395
1400
  }, enableBranches();
1396
1401
  let handlePendingTry = (fn, scope, branch) => {
@@ -1409,7 +1414,7 @@ var runRender = (render) => render.u(render.g, render.o), _enable_catch = () =>
1409
1414
  runEffects2(effects);
1410
1415
  })(runEffects), runRender = /* @__PURE__ */ ((runRender2) => (render) => {
1411
1416
  try {
1412
- let branch = render.g.F;
1417
+ let branch = render.h.F;
1413
1418
  for (; branch; ) {
1414
1419
  if (branch.W)
1415
1420
  return asyncRendersLookup.set(
@@ -1420,7 +1425,7 @@ var runRender = (render) => render.u(render.g, render.o), _enable_catch = () =>
1420
1425
  }
1421
1426
  runRender2(render);
1422
1427
  } catch (error) {
1423
- renderCatch(render.g, error);
1428
+ renderCatch(render.h, error);
1424
1429
  }
1425
1430
  })(runRender);
1426
1431
  };
@@ -1453,7 +1458,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1453
1458
  _resume(RENDERER_REGISTER_ID, fn);
1454
1459
  },
1455
1460
  isRenderer(renderer) {
1456
- return renderer.h;
1461
+ return renderer.j;
1457
1462
  },
1458
1463
  getStartNode(branch) {
1459
1464
  return branch.S;
@@ -1475,7 +1480,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1475
1480
  },
1476
1481
  createRenderer(params, clone) {
1477
1482
  let renderer = _content("", 0, 0, 0, params)();
1478
- return renderer.h = (branch) => {
1483
+ return renderer.j = (branch) => {
1479
1484
  let cloned = clone();
1480
1485
  branch.S = cloned.startNode, branch.K = cloned.endNode;
1481
1486
  }, renderer;
@@ -1541,7 +1546,7 @@ function mount(input = {}, reference, position) {
1541
1546
  parentNode
1542
1547
  ), branch.T = (newValue) => {
1543
1548
  curValue = newValue;
1544
- }, this.j?.(branch), args?.(branch, input);
1549
+ }, this.k?.(branch), args?.(branch, input);
1545
1550
  });
1546
1551
  return insertChildNodes(
1547
1552
  parentNode,
package/dist/html.js CHANGED
@@ -463,6 +463,7 @@ var REGISTRY = /* @__PURE__ */ new WeakMap(), KNOWN_SYMBOLS = (() => {
463
463
  flushed = !1;
464
464
  wroteUndefined = !1;
465
465
  buf = [];
466
+ strs = /* @__PURE__ */ new Map();
466
467
  refs = /* @__PURE__ */ new WeakMap();
467
468
  assigned = /* @__PURE__ */ new Set();
468
469
  registered = [];
@@ -601,7 +602,7 @@ function writeAssigned(state) {
601
602
  function writeProp(state, val, parent, accessor) {
602
603
  switch (typeof val) {
603
604
  case "string":
604
- return writeString(state, val);
605
+ return writeString(state, val, parent, accessor);
605
606
  case "number":
606
607
  return writeNumber(state, val);
607
608
  case "boolean":
@@ -648,8 +649,16 @@ function writeRegistered(state, val, parent, accessor, registered) {
648
649
  state.buf.push(registered.access);
649
650
  return !0;
650
651
  }
651
- function writeString(state, val) {
652
- return state.buf.push(quote(val, 0)), !0;
652
+ function writeString(state, val, parent, accessor) {
653
+ if (val.length > 30) {
654
+ let ref = state.strs.get(val);
655
+ ref ? state.buf.push(ensureId(state, ref)) : (state.strs.set(
656
+ val,
657
+ new Reference(parent, accessor, state.flush, state.buf.length)
658
+ ), state.buf.push(quote(val, 0)));
659
+ } else
660
+ state.buf.push(quote(val, 0));
661
+ return !0;
653
662
  }
654
663
  function writeNumber(state, val) {
655
664
  return state.buf.push(val + ""), !0;
@@ -1156,7 +1165,9 @@ function _script(scopeId, registryId) {
1156
1165
  function _attr_content(nodeAccessor, scopeId, content, serializeReason) {
1157
1166
  let shouldResume = serializeReason !== 0, render2 = normalizeServerRender(content), branchId = _peek_scope_id();
1158
1167
  render2 && (shouldResume ? withBranchId(branchId, render2) : render2()), _peek_scope_id() !== branchId ? shouldResume && writeScope(scopeId, {
1159
- ["A" /* BranchScopes */ + nodeAccessor]: writeScope(branchId, {}),
1168
+ ["A" /* BranchScopes */ + nodeAccessor]: referenceScope(
1169
+ writeScope(branchId, {})
1170
+ ),
1160
1171
  ["D" /* ConditionalRenderer */ + nodeAccessor]: render2?.a
1161
1172
  }) : _scope_id();
1162
1173
  }
package/dist/html.mjs CHANGED
@@ -373,6 +373,7 @@ var REGISTRY = /* @__PURE__ */ new WeakMap(), KNOWN_SYMBOLS = (() => {
373
373
  flushed = !1;
374
374
  wroteUndefined = !1;
375
375
  buf = [];
376
+ strs = /* @__PURE__ */ new Map();
376
377
  refs = /* @__PURE__ */ new WeakMap();
377
378
  assigned = /* @__PURE__ */ new Set();
378
379
  registered = [];
@@ -511,7 +512,7 @@ function writeAssigned(state) {
511
512
  function writeProp(state, val, parent, accessor) {
512
513
  switch (typeof val) {
513
514
  case "string":
514
- return writeString(state, val);
515
+ return writeString(state, val, parent, accessor);
515
516
  case "number":
516
517
  return writeNumber(state, val);
517
518
  case "boolean":
@@ -558,8 +559,16 @@ function writeRegistered(state, val, parent, accessor, registered) {
558
559
  state.buf.push(registered.access);
559
560
  return !0;
560
561
  }
561
- function writeString(state, val) {
562
- return state.buf.push(quote(val, 0)), !0;
562
+ function writeString(state, val, parent, accessor) {
563
+ if (val.length > 30) {
564
+ let ref = state.strs.get(val);
565
+ ref ? state.buf.push(ensureId(state, ref)) : (state.strs.set(
566
+ val,
567
+ new Reference(parent, accessor, state.flush, state.buf.length)
568
+ ), state.buf.push(quote(val, 0)));
569
+ } else
570
+ state.buf.push(quote(val, 0));
571
+ return !0;
563
572
  }
564
573
  function writeNumber(state, val) {
565
574
  return state.buf.push(val + ""), !0;
@@ -1066,7 +1075,9 @@ function _script(scopeId, registryId) {
1066
1075
  function _attr_content(nodeAccessor, scopeId, content, serializeReason) {
1067
1076
  let shouldResume = serializeReason !== 0, render2 = normalizeServerRender(content), branchId = _peek_scope_id();
1068
1077
  render2 && (shouldResume ? withBranchId(branchId, render2) : render2()), _peek_scope_id() !== branchId ? shouldResume && writeScope(scopeId, {
1069
- ["A" /* BranchScopes */ + nodeAccessor]: writeScope(branchId, {}),
1078
+ ["A" /* BranchScopes */ + nodeAccessor]: referenceScope(
1079
+ writeScope(branchId, {})
1080
+ ),
1070
1081
  ["D" /* ConditionalRenderer */ + nodeAccessor]: render2?.a
1071
1082
  }) : _scope_id();
1072
1083
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/runtime-tags",
3
- "version": "6.0.148",
3
+ "version": "6.0.150",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",