marko 6.0.0-next.3.27 → 6.0.0-next.3.28

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.
@@ -1,2 +1,3 @@
1
1
  export declare const RENDERER_REGISTER_ID: string;
2
2
  export declare const SET_SCOPE_REGISTER_ID: string;
3
+ export declare const RENDER_BODY_ID: string;
package/dist/debug/dom.js CHANGED
@@ -1943,16 +1943,18 @@ function abort(ctrl) {
1943
1943
  var prefix = true ? "$compat_" : "$C_";
1944
1944
  var RENDERER_REGISTER_ID = prefix + (true ? "renderer" : "r");
1945
1945
  var SET_SCOPE_REGISTER_ID = prefix + (true ? "setScope" : "s");
1946
+ var RENDER_BODY_ID = prefix + (true ? "renderBody" : "b");
1946
1947
 
1947
1948
  // src/dom/compat.ts
1948
1949
  var classIdToBranch = /* @__PURE__ */ new Map();
1949
1950
  var compat = {
1950
1951
  patchConditionals,
1951
1952
  queueEffect,
1952
- init() {
1953
+ init(warp10Noop) {
1953
1954
  register(SET_SCOPE_REGISTER_ID, (branch) => {
1954
1955
  classIdToBranch.set(branch.m5c, branch);
1955
1956
  });
1957
+ register(RENDER_BODY_ID, warp10Noop);
1956
1958
  },
1957
1959
  registerRenderer(fn) {
1958
1960
  register(RENDERER_REGISTER_ID, fn);
@@ -1856,16 +1856,18 @@ function abort(ctrl) {
1856
1856
  var prefix = true ? "$compat_" : "$C_";
1857
1857
  var RENDERER_REGISTER_ID = prefix + (true ? "renderer" : "r");
1858
1858
  var SET_SCOPE_REGISTER_ID = prefix + (true ? "setScope" : "s");
1859
+ var RENDER_BODY_ID = prefix + (true ? "renderBody" : "b");
1859
1860
 
1860
1861
  // src/dom/compat.ts
1861
1862
  var classIdToBranch = /* @__PURE__ */ new Map();
1862
1863
  var compat = {
1863
1864
  patchConditionals,
1864
1865
  queueEffect,
1865
- init() {
1866
+ init(warp10Noop) {
1866
1867
  register(SET_SCOPE_REGISTER_ID, (branch) => {
1867
1868
  classIdToBranch.set(branch.m5c, branch);
1868
1869
  });
1870
+ register(RENDER_BODY_ID, warp10Noop);
1869
1871
  },
1870
1872
  registerRenderer(fn) {
1871
1873
  register(RENDERER_REGISTER_ID, fn);
@@ -35,6 +35,7 @@ __export(html_exports, {
35
35
  controllable_textarea_value: () => controllable_textarea_value,
36
36
  createRenderer: () => createRenderer,
37
37
  createTemplate: () => createTemplate,
38
+ debug: () => debug,
38
39
  dynamicTagArgs: () => dynamicTagArgs,
39
40
  dynamicTagInput: () => dynamicTagInput,
40
41
  ensureScopeWithId: () => ensureScopeWithId,
@@ -582,6 +583,17 @@ var Reference = class {
582
583
  init = "";
583
584
  assigns = "";
584
585
  };
586
+ var DEBUG = /* @__PURE__ */ new WeakMap();
587
+ function debug(obj, file, loc, vars) {
588
+ if (true) {
589
+ DEBUG.set(obj, {
590
+ file,
591
+ loc,
592
+ vars
593
+ });
594
+ }
595
+ return obj;
596
+ }
585
597
  var Serializer = class {
586
598
  #state = new State();
587
599
  get flushed() {
@@ -682,6 +694,7 @@ function writeProp(state, val, parent, accessor) {
682
694
  case "object":
683
695
  return writeObject(state, val, parent, accessor);
684
696
  default:
697
+ throwUnserializable(state, val, parent, accessor);
685
698
  return false;
686
699
  }
687
700
  }
@@ -710,6 +723,9 @@ function writeReferenceOr(state, write2, val, parent, accessor) {
710
723
  val,
711
724
  ref = new Reference(parent, accessor, state.flush, state.buf.length)
712
725
  );
726
+ if (true) {
727
+ ref.debug = DEBUG.get(val);
728
+ }
713
729
  if (write2(state, val, ref)) return true;
714
730
  state.refs.delete(ref);
715
731
  return false;
@@ -786,7 +802,8 @@ function writeUnknownSymbol(state) {
786
802
  state.buf.push("Symbol()");
787
803
  return true;
788
804
  }
789
- function writeNever() {
805
+ function writeNever(state, val, ref) {
806
+ throwUnserializable(state, val, ref);
790
807
  return false;
791
808
  }
792
809
  function writeNull(state) {
@@ -867,6 +884,7 @@ function writeUnknownObject(state, val, ref) {
867
884
  case globalThis.Response:
868
885
  return writeResponse(state, val, ref);
869
886
  }
887
+ throwUnserializable(state, val, ref);
870
888
  return false;
871
889
  }
872
890
  function writePlainObject(state, val, ref) {
@@ -1284,6 +1302,45 @@ function writeAsyncCall(state, boundary, ref, method, value, preferredValueId =
1284
1302
  state.buf.push(")");
1285
1303
  boundary.endAsync();
1286
1304
  }
1305
+ function throwUnserializable(state, cause, ref = null, accessor = "") {
1306
+ if (cause !== void 0 && state.boundary?.abort) {
1307
+ let message = "Unable to serialize";
1308
+ let access = "";
1309
+ while (ref?.accessor) {
1310
+ const debug2 = ref.parent?.debug;
1311
+ if (debug2) {
1312
+ const varLoc = debug2.vars?.[ref.accessor];
1313
+ if (varLoc) {
1314
+ if (Array.isArray(varLoc)) {
1315
+ message += ` "${varLoc[0]}" in ${debug2.file}:${varLoc[1]}`;
1316
+ } else {
1317
+ message += ` "${ref.accessor}" in ${debug2.file}:${varLoc}`;
1318
+ }
1319
+ } else {
1320
+ message += ` ${JSON.stringify(ref.accessor)} in ${debug2.file}`;
1321
+ if (debug2.loc) {
1322
+ message += `:${debug2.loc}`;
1323
+ }
1324
+ }
1325
+ break;
1326
+ }
1327
+ access = toAccess(ref.accessor) + access;
1328
+ ref = ref.parent;
1329
+ }
1330
+ if (accessor) {
1331
+ access = toAccess(accessor) + access;
1332
+ }
1333
+ if (access[0] === ".") {
1334
+ access = access.slice(1);
1335
+ }
1336
+ if (access) {
1337
+ message += ` (reading ${access})`;
1338
+ }
1339
+ const err = new TypeError(message, { cause });
1340
+ err.stack = void 0;
1341
+ state.boundary.abort(err);
1342
+ }
1343
+ }
1287
1344
  function isCircular(parent, ref) {
1288
1345
  let cur = parent;
1289
1346
  while (cur) {
@@ -2416,6 +2473,7 @@ function escapeAttrValue(str) {
2416
2473
  var prefix = true ? "$compat_" : "$C_";
2417
2474
  var RENDERER_REGISTER_ID = prefix + (true ? "renderer" : "r");
2418
2475
  var SET_SCOPE_REGISTER_ID = prefix + (true ? "setScope" : "s");
2476
+ var RENDER_BODY_ID = prefix + (true ? "renderBody" : "b");
2419
2477
 
2420
2478
  // src/common/meta.ts
2421
2479
  var DEFAULT_RUNTIME_ID = "M";
@@ -2602,11 +2660,14 @@ var compat = {
2602
2660
  asyncOut.error(boundary.signal.reason);
2603
2661
  } else {
2604
2662
  queueMicrotask(() => {
2605
- const { scripts, html } = head = prepareChunk(head);
2606
- asyncOut.script(scripts);
2607
- asyncOut.write(html);
2608
- asyncOut.end();
2609
- head.html = head.scripts = "";
2663
+ head = prepareChunk(head);
2664
+ if (boundary.done) {
2665
+ const { scripts, html } = head;
2666
+ asyncOut.script(scripts);
2667
+ asyncOut.write(html);
2668
+ asyncOut.end();
2669
+ head.html = head.scripts = "";
2670
+ }
2610
2671
  });
2611
2672
  }
2612
2673
  }
@@ -2619,6 +2680,9 @@ var compat = {
2619
2680
  register(id, () => {
2620
2681
  })
2621
2682
  );
2683
+ },
2684
+ registerRenderBody(fn) {
2685
+ register(RENDER_BODY_ID, fn);
2622
2686
  }
2623
2687
  };
2624
2688
 
@@ -2713,17 +2777,23 @@ var ServerRenderResult = class {
2713
2777
  done = true;
2714
2778
  if (resolve) {
2715
2779
  resolve({ value, done: !value });
2780
+ value = "";
2716
2781
  }
2717
2782
  }
2718
2783
  );
2719
2784
  return {
2720
2785
  next() {
2721
- if (value) {
2786
+ if (aborted) {
2787
+ return Promise.reject(reason);
2788
+ } else if (value) {
2722
2789
  const result = { value, done: false };
2723
2790
  value = "";
2724
2791
  return Promise.resolve(result);
2792
+ } else if (done) {
2793
+ return Promise.resolve({ value: "", done });
2794
+ } else {
2795
+ return new Promise(exec);
2725
2796
  }
2726
- return done ? Promise.resolve({ value: "", done }) : aborted ? Promise.reject(reason) : new Promise(exec);
2727
2797
  },
2728
2798
  throw(error) {
2729
2799
  if (!(done || aborted)) {
@@ -2803,12 +2873,13 @@ var ServerRenderResult = class {
2803
2873
  }
2804
2874
  const { boundary } = head;
2805
2875
  (boundary.onNext = () => {
2806
- if (boundary.done) {
2807
- if (boundary.signal.aborted) {
2808
- reject(boundary.signal.reason);
2809
- } else {
2810
- head = prepareChunk(head);
2811
- if (boundary.done) resolve(flushChunk(head, true));
2876
+ if (boundary.signal.aborted) {
2877
+ boundary.onNext = NOOP2;
2878
+ reject(boundary.signal.reason);
2879
+ } else if (boundary.done) {
2880
+ head = prepareChunk(head);
2881
+ if (boundary.done) {
2882
+ resolve(flushChunk(head, true));
2812
2883
  }
2813
2884
  }
2814
2885
  })();
@@ -2824,26 +2895,27 @@ var ServerRenderResult = class {
2824
2895
  }
2825
2896
  const { boundary } = head;
2826
2897
  const onNext = boundary.onNext = (write2) => {
2827
- if (write2 || boundary.done) {
2828
- if (boundary.signal.aborted) {
2829
- if (!tick2) offTick(onNext);
2830
- onAbort(boundary.signal.reason);
2831
- return;
2898
+ if (boundary.signal.aborted) {
2899
+ if (!tick2) offTick(onNext);
2900
+ boundary.onNext = NOOP2;
2901
+ onAbort(boundary.signal.reason);
2902
+ } else {
2903
+ if (write2 || boundary.done) {
2904
+ head = prepareChunk(head);
2832
2905
  }
2833
- head = prepareChunk(head);
2834
- }
2835
- if (write2 || boundary.done) {
2836
- const html = flushChunk(head, boundary.done);
2837
- if (html) onWrite(html);
2838
- if (boundary.done) {
2839
- if (!tick2) offTick(onNext);
2840
- onClose();
2841
- } else {
2842
- tick2 = true;
2906
+ if (write2 || boundary.done) {
2907
+ const html = flushChunk(head, boundary.done);
2908
+ if (html) onWrite(html);
2909
+ if (boundary.done) {
2910
+ if (!tick2) offTick(onNext);
2911
+ onClose();
2912
+ } else {
2913
+ tick2 = true;
2914
+ }
2915
+ } else if (tick2) {
2916
+ tick2 = false;
2917
+ queueTick(onNext);
2843
2918
  }
2844
- } else if (tick2) {
2845
- tick2 = false;
2846
- queueTick(onNext);
2847
2919
  }
2848
2920
  };
2849
2921
  onNext();
@@ -2857,6 +2929,8 @@ var ServerRenderResult = class {
2857
2929
  return flushChunk(prepareChunk(head), true);
2858
2930
  }
2859
2931
  };
2932
+ function NOOP2() {
2933
+ }
2860
2934
  // Annotate the CommonJS export names for ESM import in node:
2861
2935
  0 && (module.exports = {
2862
2936
  $global,
@@ -2874,6 +2948,7 @@ var ServerRenderResult = class {
2874
2948
  controllable_textarea_value,
2875
2949
  createRenderer,
2876
2950
  createTemplate,
2951
+ debug,
2877
2952
  dynamicTagArgs,
2878
2953
  dynamicTagInput,
2879
2954
  ensureScopeWithId,
@@ -502,6 +502,17 @@ var Reference = class {
502
502
  init = "";
503
503
  assigns = "";
504
504
  };
505
+ var DEBUG = /* @__PURE__ */ new WeakMap();
506
+ function debug(obj, file, loc, vars) {
507
+ if (true) {
508
+ DEBUG.set(obj, {
509
+ file,
510
+ loc,
511
+ vars
512
+ });
513
+ }
514
+ return obj;
515
+ }
505
516
  var Serializer = class {
506
517
  #state = new State();
507
518
  get flushed() {
@@ -602,6 +613,7 @@ function writeProp(state, val, parent, accessor) {
602
613
  case "object":
603
614
  return writeObject(state, val, parent, accessor);
604
615
  default:
616
+ throwUnserializable(state, val, parent, accessor);
605
617
  return false;
606
618
  }
607
619
  }
@@ -630,6 +642,9 @@ function writeReferenceOr(state, write2, val, parent, accessor) {
630
642
  val,
631
643
  ref = new Reference(parent, accessor, state.flush, state.buf.length)
632
644
  );
645
+ if (true) {
646
+ ref.debug = DEBUG.get(val);
647
+ }
633
648
  if (write2(state, val, ref)) return true;
634
649
  state.refs.delete(ref);
635
650
  return false;
@@ -706,7 +721,8 @@ function writeUnknownSymbol(state) {
706
721
  state.buf.push("Symbol()");
707
722
  return true;
708
723
  }
709
- function writeNever() {
724
+ function writeNever(state, val, ref) {
725
+ throwUnserializable(state, val, ref);
710
726
  return false;
711
727
  }
712
728
  function writeNull(state) {
@@ -787,6 +803,7 @@ function writeUnknownObject(state, val, ref) {
787
803
  case globalThis.Response:
788
804
  return writeResponse(state, val, ref);
789
805
  }
806
+ throwUnserializable(state, val, ref);
790
807
  return false;
791
808
  }
792
809
  function writePlainObject(state, val, ref) {
@@ -1204,6 +1221,45 @@ function writeAsyncCall(state, boundary, ref, method, value, preferredValueId =
1204
1221
  state.buf.push(")");
1205
1222
  boundary.endAsync();
1206
1223
  }
1224
+ function throwUnserializable(state, cause, ref = null, accessor = "") {
1225
+ if (cause !== void 0 && state.boundary?.abort) {
1226
+ let message = "Unable to serialize";
1227
+ let access = "";
1228
+ while (ref?.accessor) {
1229
+ const debug2 = ref.parent?.debug;
1230
+ if (debug2) {
1231
+ const varLoc = debug2.vars?.[ref.accessor];
1232
+ if (varLoc) {
1233
+ if (Array.isArray(varLoc)) {
1234
+ message += ` "${varLoc[0]}" in ${debug2.file}:${varLoc[1]}`;
1235
+ } else {
1236
+ message += ` "${ref.accessor}" in ${debug2.file}:${varLoc}`;
1237
+ }
1238
+ } else {
1239
+ message += ` ${JSON.stringify(ref.accessor)} in ${debug2.file}`;
1240
+ if (debug2.loc) {
1241
+ message += `:${debug2.loc}`;
1242
+ }
1243
+ }
1244
+ break;
1245
+ }
1246
+ access = toAccess(ref.accessor) + access;
1247
+ ref = ref.parent;
1248
+ }
1249
+ if (accessor) {
1250
+ access = toAccess(accessor) + access;
1251
+ }
1252
+ if (access[0] === ".") {
1253
+ access = access.slice(1);
1254
+ }
1255
+ if (access) {
1256
+ message += ` (reading ${access})`;
1257
+ }
1258
+ const err = new TypeError(message, { cause });
1259
+ err.stack = void 0;
1260
+ state.boundary.abort(err);
1261
+ }
1262
+ }
1207
1263
  function isCircular(parent, ref) {
1208
1264
  let cur = parent;
1209
1265
  while (cur) {
@@ -2336,6 +2392,7 @@ function escapeAttrValue(str) {
2336
2392
  var prefix = true ? "$compat_" : "$C_";
2337
2393
  var RENDERER_REGISTER_ID = prefix + (true ? "renderer" : "r");
2338
2394
  var SET_SCOPE_REGISTER_ID = prefix + (true ? "setScope" : "s");
2395
+ var RENDER_BODY_ID = prefix + (true ? "renderBody" : "b");
2339
2396
 
2340
2397
  // src/common/meta.ts
2341
2398
  var DEFAULT_RUNTIME_ID = "M";
@@ -2522,11 +2579,14 @@ var compat = {
2522
2579
  asyncOut.error(boundary.signal.reason);
2523
2580
  } else {
2524
2581
  queueMicrotask(() => {
2525
- const { scripts, html } = head = prepareChunk(head);
2526
- asyncOut.script(scripts);
2527
- asyncOut.write(html);
2528
- asyncOut.end();
2529
- head.html = head.scripts = "";
2582
+ head = prepareChunk(head);
2583
+ if (boundary.done) {
2584
+ const { scripts, html } = head;
2585
+ asyncOut.script(scripts);
2586
+ asyncOut.write(html);
2587
+ asyncOut.end();
2588
+ head.html = head.scripts = "";
2589
+ }
2530
2590
  });
2531
2591
  }
2532
2592
  }
@@ -2539,6 +2599,9 @@ var compat = {
2539
2599
  register(id, () => {
2540
2600
  })
2541
2601
  );
2602
+ },
2603
+ registerRenderBody(fn) {
2604
+ register(RENDER_BODY_ID, fn);
2542
2605
  }
2543
2606
  };
2544
2607
 
@@ -2633,17 +2696,23 @@ var ServerRenderResult = class {
2633
2696
  done = true;
2634
2697
  if (resolve) {
2635
2698
  resolve({ value, done: !value });
2699
+ value = "";
2636
2700
  }
2637
2701
  }
2638
2702
  );
2639
2703
  return {
2640
2704
  next() {
2641
- if (value) {
2705
+ if (aborted) {
2706
+ return Promise.reject(reason);
2707
+ } else if (value) {
2642
2708
  const result = { value, done: false };
2643
2709
  value = "";
2644
2710
  return Promise.resolve(result);
2711
+ } else if (done) {
2712
+ return Promise.resolve({ value: "", done });
2713
+ } else {
2714
+ return new Promise(exec);
2645
2715
  }
2646
- return done ? Promise.resolve({ value: "", done }) : aborted ? Promise.reject(reason) : new Promise(exec);
2647
2716
  },
2648
2717
  throw(error) {
2649
2718
  if (!(done || aborted)) {
@@ -2723,12 +2792,13 @@ var ServerRenderResult = class {
2723
2792
  }
2724
2793
  const { boundary } = head;
2725
2794
  (boundary.onNext = () => {
2726
- if (boundary.done) {
2727
- if (boundary.signal.aborted) {
2728
- reject(boundary.signal.reason);
2729
- } else {
2730
- head = prepareChunk(head);
2731
- if (boundary.done) resolve(flushChunk(head, true));
2795
+ if (boundary.signal.aborted) {
2796
+ boundary.onNext = NOOP2;
2797
+ reject(boundary.signal.reason);
2798
+ } else if (boundary.done) {
2799
+ head = prepareChunk(head);
2800
+ if (boundary.done) {
2801
+ resolve(flushChunk(head, true));
2732
2802
  }
2733
2803
  }
2734
2804
  })();
@@ -2744,26 +2814,27 @@ var ServerRenderResult = class {
2744
2814
  }
2745
2815
  const { boundary } = head;
2746
2816
  const onNext = boundary.onNext = (write2) => {
2747
- if (write2 || boundary.done) {
2748
- if (boundary.signal.aborted) {
2749
- if (!tick2) offTick(onNext);
2750
- onAbort(boundary.signal.reason);
2751
- return;
2817
+ if (boundary.signal.aborted) {
2818
+ if (!tick2) offTick(onNext);
2819
+ boundary.onNext = NOOP2;
2820
+ onAbort(boundary.signal.reason);
2821
+ } else {
2822
+ if (write2 || boundary.done) {
2823
+ head = prepareChunk(head);
2752
2824
  }
2753
- head = prepareChunk(head);
2754
- }
2755
- if (write2 || boundary.done) {
2756
- const html = flushChunk(head, boundary.done);
2757
- if (html) onWrite(html);
2758
- if (boundary.done) {
2759
- if (!tick2) offTick(onNext);
2760
- onClose();
2761
- } else {
2762
- tick2 = true;
2825
+ if (write2 || boundary.done) {
2826
+ const html = flushChunk(head, boundary.done);
2827
+ if (html) onWrite(html);
2828
+ if (boundary.done) {
2829
+ if (!tick2) offTick(onNext);
2830
+ onClose();
2831
+ } else {
2832
+ tick2 = true;
2833
+ }
2834
+ } else if (tick2) {
2835
+ tick2 = false;
2836
+ queueTick(onNext);
2763
2837
  }
2764
- } else if (tick2) {
2765
- tick2 = false;
2766
- queueTick(onNext);
2767
2838
  }
2768
2839
  };
2769
2840
  onNext();
@@ -2777,6 +2848,8 @@ var ServerRenderResult = class {
2777
2848
  return flushChunk(prepareChunk(head), true);
2778
2849
  }
2779
2850
  };
2851
+ function NOOP2() {
2852
+ }
2780
2853
  export {
2781
2854
  $global,
2782
2855
  attr,
@@ -2793,6 +2866,7 @@ export {
2793
2866
  controllable_textarea_value,
2794
2867
  createRenderer,
2795
2868
  createTemplate,
2869
+ debug,
2796
2870
  dynamicTagArgs,
2797
2871
  dynamicTagInput,
2798
2872
  ensureScopeWithId,
@@ -4,7 +4,7 @@ import { type Renderer } from "./renderer";
4
4
  export declare const compat: {
5
5
  patchConditionals: typeof patchConditionals;
6
6
  queueEffect: typeof queueEffect;
7
- init(): void;
7
+ init(warp10Noop: any): void;
8
8
  registerRenderer(fn: any): void;
9
9
  isOp(value: any): boolean;
10
10
  isRenderer(renderer: any): boolean;
package/dist/dom.js CHANGED
@@ -1243,16 +1243,16 @@ function abort(ctrl) {
1243
1243
  }
1244
1244
 
1245
1245
  // src/common/compat-meta.ts
1246
- var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s";
1246
+ var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
1247
1247
 
1248
1248
  // src/dom/compat.ts
1249
1249
  var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1250
1250
  patchConditionals,
1251
1251
  queueEffect,
1252
- init() {
1252
+ init(warp10Noop) {
1253
1253
  register(SET_SCOPE_REGISTER_ID, (branch) => {
1254
1254
  classIdToBranch.set(branch.m5c, branch);
1255
- });
1255
+ }), register(RENDER_BODY_ID, warp10Noop);
1256
1256
  },
1257
1257
  registerRenderer(fn) {
1258
1258
  register(RENDERER_REGISTER_ID, fn);
package/dist/dom.mjs CHANGED
@@ -1159,16 +1159,16 @@ function abort(ctrl) {
1159
1159
  }
1160
1160
 
1161
1161
  // src/common/compat-meta.ts
1162
- var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s";
1162
+ var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
1163
1163
 
1164
1164
  // src/dom/compat.ts
1165
1165
  var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1166
1166
  patchConditionals,
1167
1167
  queueEffect,
1168
- init() {
1168
+ init(warp10Noop) {
1169
1169
  register(SET_SCOPE_REGISTER_ID, (branch) => {
1170
1170
  classIdToBranch.set(branch.m5c, branch);
1171
- });
1171
+ }), register(RENDER_BODY_ID, warp10Noop);
1172
1172
  },
1173
1173
  registerRenderer(fn) {
1174
1174
  register(RENDERER_REGISTER_ID, fn);
@@ -11,4 +11,5 @@ export declare const compat: {
11
11
  toJSON(this: WeakKey): [registryId: string, scopeId: unknown] | undefined;
12
12
  render(renderer: ServerRenderer, willRerender: boolean, classAPIOut: any, component: any, input: any): void;
13
13
  registerRenderer(renderer: any, id: string): any;
14
+ registerRenderBody(fn: any): void;
14
15
  };
@@ -1,4 +1,5 @@
1
1
  import type { Boundary } from "./writer";
2
+ export declare function debug(obj: WeakKey, file: string, loc: string | 0, vars?: Record<string, string>): WeakKey;
2
3
  export declare class Serializer {
3
4
  #private;
4
5
  get flushed(): boolean;
@@ -12,3 +13,4 @@ export declare function getRegistered(val: WeakKey): {
12
13
  scope: unknown;
13
14
  } | undefined;
14
15
  export declare function stringify(val: unknown): string;
16
+ export declare function toAccess(accessor: string): string;
package/dist/html.d.ts CHANGED
@@ -5,5 +5,6 @@ export { compat } from "./html/compat";
5
5
  export { escapeScript, escapeStyle, escapeXML, toString } from "./html/content";
6
6
  export { createRenderer, dynamicTagArgs, dynamicTagInput, } from "./html/dynamic-tag";
7
7
  export { forIn, forInBy, forOf, forOfBy, forTo, forToBy } from "./html/for";
8
+ export { debug } from "./html/serializer";
8
9
  export { createTemplate } from "./html/template";
9
10
  export { $global, ensureScopeWithId, fork, getScopeById, markResumeNode, nextScopeId, nextTagId, nodeRef, peekNextScope, register, resumeClosestBranch, resumeConditional, resumeForIn, resumeForOf, resumeForTo, resumeSingleNodeConditional, resumeSingleNodeForIn, resumeSingleNodeForOf, resumeSingleNodeForTo, tryContent, write, writeEffect, writeExistingScope, writeScope, writeTrailers, } from "./html/writer";
package/dist/html.js CHANGED
@@ -32,6 +32,7 @@ __export(html_exports, {
32
32
  controllable_textarea_value: () => controllable_textarea_value,
33
33
  createRenderer: () => createRenderer,
34
34
  createTemplate: () => createTemplate,
35
+ debug: () => debug,
35
36
  dynamicTagArgs: () => dynamicTagArgs,
36
37
  dynamicTagInput: () => dynamicTagInput,
37
38
  ensureScopeWithId: () => ensureScopeWithId,
@@ -435,7 +436,11 @@ var { hasOwnProperty } = {}, Generator = function* () {
435
436
  }
436
437
  init = "";
437
438
  assigns = "";
438
- }, Serializer = class {
439
+ };
440
+ function debug(obj, file, loc, vars) {
441
+ return obj;
442
+ }
443
+ var Serializer = class {
439
444
  #state = new State();
440
445
  get flushed() {
441
446
  return this.#state.flushed;
@@ -562,7 +567,7 @@ function writeSymbol(state, val, parent, accessor) {
562
567
  function writeUnknownSymbol(state) {
563
568
  return state.buf.push("Symbol()"), !0;
564
569
  }
565
- function writeNever() {
570
+ function writeNever(state, val, ref) {
566
571
  return !1;
567
572
  }
568
573
  function writeNull(state) {
@@ -1618,7 +1623,7 @@ function escapeAttrValue(str) {
1618
1623
  }
1619
1624
 
1620
1625
  // src/common/compat-meta.ts
1621
- var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s";
1626
+ var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
1622
1627
 
1623
1628
  // src/common/meta.ts
1624
1629
  var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
@@ -1745,8 +1750,10 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
1745
1750
  let asyncOut = classAPIOut.beginAsync();
1746
1751
  (boundary.onNext = () => {
1747
1752
  boundary.done && (boundary.signal.aborted ? asyncOut.error(boundary.signal.reason) : queueMicrotask(() => {
1748
- let { scripts, html } = head = prepareChunk(head);
1749
- asyncOut.script(scripts), asyncOut.write(html), asyncOut.end(), head.html = head.scripts = "";
1753
+ if (head = prepareChunk(head), boundary.done) {
1754
+ let { scripts, html } = head;
1755
+ asyncOut.script(scripts), asyncOut.write(html), asyncOut.end(), head.html = head.scripts = "";
1756
+ }
1750
1757
  }));
1751
1758
  })();
1752
1759
  },
@@ -1757,6 +1764,9 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
1757
1764
  register(id, () => {
1758
1765
  })
1759
1766
  );
1767
+ },
1768
+ registerRenderBody(fn) {
1769
+ register(RENDER_BODY_ID, fn);
1760
1770
  }
1761
1771
  };
1762
1772
 
@@ -1805,16 +1815,17 @@ var ServerRenderResult = class {
1805
1815
  aborted = !0, reason = err, reject && reject(err);
1806
1816
  },
1807
1817
  () => {
1808
- done = !0, resolve && resolve({ value, done: !value });
1818
+ done = !0, resolve && (resolve({ value, done: !value }), value = "");
1809
1819
  }
1810
1820
  );
1811
1821
  return {
1812
1822
  next() {
1823
+ if (aborted)
1824
+ return Promise.reject(reason);
1813
1825
  if (value) {
1814
1826
  let result = { value, done: !1 };
1815
1827
  return value = "", Promise.resolve(result);
1816
- }
1817
- return done ? Promise.resolve({ value: "", done }) : aborted ? Promise.reject(reason) : new Promise(exec);
1828
+ } else return done ? Promise.resolve({ value: "", done }) : new Promise(exec);
1818
1829
  },
1819
1830
  throw(error) {
1820
1831
  return done || aborted || boundary?.abort(error), Promise.resolve({
@@ -1881,7 +1892,7 @@ var ServerRenderResult = class {
1881
1892
  return reject(new Error("Cannot read from a consumed render result"));
1882
1893
  let { boundary } = head;
1883
1894
  (boundary.onNext = () => {
1884
- boundary.done && (boundary.signal.aborted ? reject(boundary.signal.reason) : (head = prepareChunk(head), boundary.done && resolve(flushChunk(head, !0))));
1895
+ boundary.signal.aborted ? (boundary.onNext = NOOP2, reject(boundary.signal.reason)) : boundary.done && (head = prepareChunk(head), boundary.done && resolve(flushChunk(head, !0)));
1885
1896
  })();
1886
1897
  });
1887
1898
  }
@@ -1892,14 +1903,9 @@ var ServerRenderResult = class {
1892
1903
  return;
1893
1904
  }
1894
1905
  let { boundary } = head, onNext = boundary.onNext = (write2) => {
1895
- if (write2 || boundary.done) {
1896
- if (boundary.signal.aborted) {
1897
- tick2 || offTick(onNext), onAbort(boundary.signal.reason);
1898
- return;
1899
- }
1900
- head = prepareChunk(head);
1901
- }
1902
- if (write2 || boundary.done) {
1906
+ if (boundary.signal.aborted)
1907
+ tick2 || offTick(onNext), boundary.onNext = NOOP2, onAbort(boundary.signal.reason);
1908
+ else if ((write2 || boundary.done) && (head = prepareChunk(head)), write2 || boundary.done) {
1903
1909
  let html = flushChunk(head, boundary.done);
1904
1910
  html && onWrite(html), boundary.done ? (tick2 || offTick(onNext), onClose()) : tick2 = !0;
1905
1911
  } else tick2 && (tick2 = !1, queueTick(onNext));
@@ -1913,6 +1919,8 @@ var ServerRenderResult = class {
1913
1919
  return this.#head = null, flushChunk(prepareChunk(head), !0);
1914
1920
  }
1915
1921
  };
1922
+ function NOOP2() {
1923
+ }
1916
1924
  // Annotate the CommonJS export names for ESM import in node:
1917
1925
  0 && (module.exports = {
1918
1926
  $global,
@@ -1930,6 +1938,7 @@ var ServerRenderResult = class {
1930
1938
  controllable_textarea_value,
1931
1939
  createRenderer,
1932
1940
  createTemplate,
1941
+ debug,
1933
1942
  dynamicTagArgs,
1934
1943
  dynamicTagInput,
1935
1944
  ensureScopeWithId,
package/dist/html.mjs CHANGED
@@ -358,7 +358,11 @@ var { hasOwnProperty } = {}, Generator = function* () {
358
358
  }
359
359
  init = "";
360
360
  assigns = "";
361
- }, Serializer = class {
361
+ };
362
+ function debug(obj, file, loc, vars) {
363
+ return obj;
364
+ }
365
+ var Serializer = class {
362
366
  #state = new State();
363
367
  get flushed() {
364
368
  return this.#state.flushed;
@@ -485,7 +489,7 @@ function writeSymbol(state, val, parent, accessor) {
485
489
  function writeUnknownSymbol(state) {
486
490
  return state.buf.push("Symbol()"), !0;
487
491
  }
488
- function writeNever() {
492
+ function writeNever(state, val, ref) {
489
493
  return !1;
490
494
  }
491
495
  function writeNull(state) {
@@ -1541,7 +1545,7 @@ function escapeAttrValue(str) {
1541
1545
  }
1542
1546
 
1543
1547
  // src/common/compat-meta.ts
1544
- var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s";
1548
+ var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
1545
1549
 
1546
1550
  // src/common/meta.ts
1547
1551
  var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
@@ -1668,8 +1672,10 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
1668
1672
  let asyncOut = classAPIOut.beginAsync();
1669
1673
  (boundary.onNext = () => {
1670
1674
  boundary.done && (boundary.signal.aborted ? asyncOut.error(boundary.signal.reason) : queueMicrotask(() => {
1671
- let { scripts, html } = head = prepareChunk(head);
1672
- asyncOut.script(scripts), asyncOut.write(html), asyncOut.end(), head.html = head.scripts = "";
1675
+ if (head = prepareChunk(head), boundary.done) {
1676
+ let { scripts, html } = head;
1677
+ asyncOut.script(scripts), asyncOut.write(html), asyncOut.end(), head.html = head.scripts = "";
1678
+ }
1673
1679
  }));
1674
1680
  })();
1675
1681
  },
@@ -1680,6 +1686,9 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
1680
1686
  register(id, () => {
1681
1687
  })
1682
1688
  );
1689
+ },
1690
+ registerRenderBody(fn) {
1691
+ register(RENDER_BODY_ID, fn);
1683
1692
  }
1684
1693
  };
1685
1694
 
@@ -1728,16 +1737,17 @@ var ServerRenderResult = class {
1728
1737
  aborted = !0, reason = err, reject && reject(err);
1729
1738
  },
1730
1739
  () => {
1731
- done = !0, resolve && resolve({ value, done: !value });
1740
+ done = !0, resolve && (resolve({ value, done: !value }), value = "");
1732
1741
  }
1733
1742
  );
1734
1743
  return {
1735
1744
  next() {
1745
+ if (aborted)
1746
+ return Promise.reject(reason);
1736
1747
  if (value) {
1737
1748
  let result = { value, done: !1 };
1738
1749
  return value = "", Promise.resolve(result);
1739
- }
1740
- return done ? Promise.resolve({ value: "", done }) : aborted ? Promise.reject(reason) : new Promise(exec);
1750
+ } else return done ? Promise.resolve({ value: "", done }) : new Promise(exec);
1741
1751
  },
1742
1752
  throw(error) {
1743
1753
  return done || aborted || boundary?.abort(error), Promise.resolve({
@@ -1804,7 +1814,7 @@ var ServerRenderResult = class {
1804
1814
  return reject(new Error("Cannot read from a consumed render result"));
1805
1815
  let { boundary } = head;
1806
1816
  (boundary.onNext = () => {
1807
- boundary.done && (boundary.signal.aborted ? reject(boundary.signal.reason) : (head = prepareChunk(head), boundary.done && resolve(flushChunk(head, !0))));
1817
+ boundary.signal.aborted ? (boundary.onNext = NOOP2, reject(boundary.signal.reason)) : boundary.done && (head = prepareChunk(head), boundary.done && resolve(flushChunk(head, !0)));
1808
1818
  })();
1809
1819
  });
1810
1820
  }
@@ -1815,14 +1825,9 @@ var ServerRenderResult = class {
1815
1825
  return;
1816
1826
  }
1817
1827
  let { boundary } = head, onNext = boundary.onNext = (write2) => {
1818
- if (write2 || boundary.done) {
1819
- if (boundary.signal.aborted) {
1820
- tick2 || offTick(onNext), onAbort(boundary.signal.reason);
1821
- return;
1822
- }
1823
- head = prepareChunk(head);
1824
- }
1825
- if (write2 || boundary.done) {
1828
+ if (boundary.signal.aborted)
1829
+ tick2 || offTick(onNext), boundary.onNext = NOOP2, onAbort(boundary.signal.reason);
1830
+ else if ((write2 || boundary.done) && (head = prepareChunk(head)), write2 || boundary.done) {
1826
1831
  let html = flushChunk(head, boundary.done);
1827
1832
  html && onWrite(html), boundary.done ? (tick2 || offTick(onNext), onClose()) : tick2 = !0;
1828
1833
  } else tick2 && (tick2 = !1, queueTick(onNext));
@@ -1836,6 +1841,8 @@ var ServerRenderResult = class {
1836
1841
  return this.#head = null, flushChunk(prepareChunk(head), !0);
1837
1842
  }
1838
1843
  };
1844
+ function NOOP2() {
1845
+ }
1839
1846
  export {
1840
1847
  $global,
1841
1848
  attr,
@@ -1852,6 +1859,7 @@ export {
1852
1859
  controllable_textarea_value,
1853
1860
  createRenderer,
1854
1861
  createTemplate,
1862
+ debug,
1855
1863
  dynamicTagArgs,
1856
1864
  dynamicTagInput,
1857
1865
  ensureScopeWithId,
@@ -542,6 +542,10 @@ var KNOWN_OBJECTS = /* @__PURE__ */ new Map([
542
542
  [Math, "Math"],
543
543
  [Reflect, "Reflect"]
544
544
  ]);
545
+ function toAccess(accessor) {
546
+ const start = accessor[0];
547
+ return start === '"' || start >= "0" && start <= "9" ? "[" + accessor + "]" : "." + accessor;
548
+ }
545
549
 
546
550
  // src/html/writer.ts
547
551
  var K_SCOPE_ID = Symbol("Scope ID");
@@ -596,6 +600,7 @@ function escapeAttrValue(str) {
596
600
  var prefix = false ? "$compat_" : "$C_";
597
601
  var RENDERER_REGISTER_ID = prefix + (false ? "renderer" : "r");
598
602
  var SET_SCOPE_REGISTER_ID = prefix + (false ? "setScope" : "s");
603
+ var RENDER_BODY_ID = prefix + (false ? "renderBody" : "b");
599
604
 
600
605
  // src/html/compat.ts
601
606
  var K_TAGS_API_STATE = Symbol();
@@ -1091,6 +1096,7 @@ function startSection(path5) {
1091
1096
  section = extra.section = {
1092
1097
  id: sections.length,
1093
1098
  name: sectionName,
1099
+ loc: sectionNamePath?.node.loc || void 0,
1094
1100
  depth: parentSection ? parentSection.depth + 1 : 0,
1095
1101
  parent: parentSection,
1096
1102
  params: void 0,
@@ -2581,16 +2587,48 @@ function writeHTMLResumeStatements(path5, tagVarIdentifier) {
2581
2587
  }
2582
2588
  }
2583
2589
  if (serializedProperties.length || forceResumeScope(section)) {
2584
- path5.pushContainer(
2585
- "body",
2586
- import_compiler17.types.expressionStatement(
2587
- callRuntime(
2588
- "writeScope",
2589
- scopeIdIdentifier,
2590
- import_compiler17.types.objectExpression(serializedProperties)
2591
- )
2592
- )
2590
+ let writeScope2 = callRuntime(
2591
+ "writeScope",
2592
+ scopeIdIdentifier,
2593
+ import_compiler17.types.objectExpression(serializedProperties)
2593
2594
  );
2595
+ if (!isOptimize()) {
2596
+ let debugVars;
2597
+ forEach(section.bindings, (binding) => {
2598
+ let root = binding;
2599
+ let access = "";
2600
+ while (!root.loc && root.upstreamAlias) {
2601
+ if (root.property !== void 0) {
2602
+ access = toAccess(root.property) + access;
2603
+ }
2604
+ root = root.upstreamAlias;
2605
+ }
2606
+ if (root.loc) {
2607
+ const locStr = import_compiler17.types.stringLiteral(
2608
+ `${root.loc.start.line}:${root.loc.start.column + 1}`
2609
+ );
2610
+ (debugVars ||= []).push(
2611
+ import_compiler17.types.objectProperty(
2612
+ getScopeAccessorLiteral(binding),
2613
+ root !== binding ? import_compiler17.types.arrayExpression([
2614
+ import_compiler17.types.stringLiteral(root.name + access),
2615
+ locStr
2616
+ ]) : locStr
2617
+ )
2618
+ );
2619
+ }
2620
+ });
2621
+ writeScope2 = callRuntime(
2622
+ "debug",
2623
+ writeScope2,
2624
+ import_compiler17.types.stringLiteral(path5.hub.file.opts.filenameRelative),
2625
+ section.loc && section.loc.start.line != null ? import_compiler17.types.stringLiteral(
2626
+ `${section.loc.start.line}:${section.loc.start.column + 1}`
2627
+ ) : import_compiler17.types.numericLiteral(0),
2628
+ debugVars && import_compiler17.types.objectExpression(debugVars)
2629
+ );
2630
+ }
2631
+ path5.pushContainer("body", import_compiler17.types.expressionStatement(writeScope2));
2594
2632
  }
2595
2633
  const resumeClosestBranch2 = !section.isBranch && (section.hasAbortSignal || !!section.closures || !!find(section.bindings, (binding) => binding.type === 1 /* let */));
2596
2634
  if (resumeClosestBranch2) {
@@ -3204,12 +3242,13 @@ function withPreviousLocation(newNode, originalNode) {
3204
3242
  // src/translator/util/references.ts
3205
3243
  var [getBindings] = createProgramState(() => /* @__PURE__ */ new Set());
3206
3244
  var [getNextBindingId, setNextBindingId] = createProgramState(() => 0);
3207
- function createBinding(name2, type, section, upstreamAlias, upstreamExpression, property, declared = false) {
3245
+ function createBinding(name2, type, section, upstreamAlias, upstreamExpression, property, loc = null, declared = false) {
3208
3246
  const id = getNextBindingId();
3209
3247
  const binding = {
3210
3248
  id,
3211
3249
  name: name2,
3212
3250
  type,
3251
+ loc,
3213
3252
  section,
3214
3253
  property,
3215
3254
  declared,
@@ -3333,6 +3372,7 @@ function createBindingsAndTrackReferences(lVal, type, scope, section, upstreamAl
3333
3372
  upstreamAlias,
3334
3373
  upstreamExpression,
3335
3374
  property,
3375
+ lVal.loc,
3336
3376
  true
3337
3377
  );
3338
3378
  trackReferencesForBinding(scope.getBinding(lVal.name));
@@ -3344,7 +3384,8 @@ function createBindingsAndTrackReferences(lVal, type, scope, section, upstreamAl
3344
3384
  section,
3345
3385
  upstreamAlias,
3346
3386
  void 0,
3347
- property
3387
+ property,
3388
+ lVal.loc
3348
3389
  ));
3349
3390
  for (const prop of lVal.properties) {
3350
3391
  if (prop.type === "RestElement") {
@@ -3386,7 +3427,8 @@ function createBindingsAndTrackReferences(lVal, type, scope, section, upstreamAl
3386
3427
  section,
3387
3428
  upstreamAlias,
3388
3429
  void 0,
3389
- property
3430
+ property,
3431
+ lVal.loc
3390
3432
  ));
3391
3433
  let i = -1;
3392
3434
  for (const element of lVal.elements) {
@@ -7930,7 +7972,7 @@ var function_default = {
7930
7972
  const extra = node.extra ??= {};
7931
7973
  const name2 = extra.name = fn.node.id?.name || (isMarkoAttribute(markoRoot) ? markoRoot.node.default ? import_compiler47.types.toIdentifier(
7932
7974
  markoRoot.parentPath.has("var") ? markoRoot.parentPath.get("var") : markoRoot.parentPath.get("name")
7933
- ) : markoRoot.node.name : import_compiler47.types.isVariableDeclarator(fn.parent) && import_compiler47.types.isIdentifier(fn.parent.id) ? fn.parent.id.name : "anonymous");
7975
+ ) : markoRoot.node.name : import_compiler47.types.isVariableDeclarator(fn.parent) && import_compiler47.types.isIdentifier(fn.parent.id) ? fn.parent.id.name : import_compiler47.types.isObjectMethod(node) && import_compiler47.types.isIdentifier(node.key) ? node.key.name : "anonymous");
7934
7976
  if (isMarkoAttribute(markoRoot) && ((0, import_babel_utils37.isNativeTag)(markoRoot.parentPath) && /^on[A-Z-]/.test(markoRoot.node.name) || isCoreTagName(markoRoot.parentPath, "script") || isCoreTagName(markoRoot.parentPath, "lifecycle") || isCoreTagName(markoRoot.parentPath, "for"))) {
7935
7977
  return;
7936
7978
  }
@@ -7965,6 +8007,7 @@ function isFunction(fn, isStatic2) {
7965
8007
  return isStatic2 && !fn.node.declare;
7966
8008
  case "FunctionExpression":
7967
8009
  case "ArrowFunctionExpression":
8010
+ case "ObjectMethod":
7968
8011
  return true;
7969
8012
  default:
7970
8013
  return false;
@@ -15,6 +15,7 @@ export type Binding = {
15
15
  id: number;
16
16
  name: string;
17
17
  type: BindingType;
18
+ loc: t.SourceLocation | null;
18
19
  section: Section;
19
20
  serialize: boolean | Set<Binding>;
20
21
  aliases: Set<Binding>;
@@ -53,7 +54,7 @@ declare module "@marko/compiler/dist/types" {
53
54
  interface FunctionExpressionExtra extends FunctionExtra {
54
55
  }
55
56
  }
56
- export declare function createBinding(name: string, type: Binding["type"], section: Section, upstreamAlias?: Binding["upstreamAlias"], upstreamExpression?: Binding["upstreamExpression"], property?: string, declared?: boolean): Binding;
57
+ export declare function createBinding(name: string, type: Binding["type"], section: Section, upstreamAlias?: Binding["upstreamAlias"], upstreamExpression?: Binding["upstreamExpression"], property?: string, loc?: t.SourceLocation | null, declared?: boolean): Binding;
57
58
  export declare function trackVarReferences(tag: t.NodePath<t.MarkoTag>, type: BindingType, upstreamAlias?: Binding["upstreamAlias"], upstreamExpression?: Binding["upstreamExpression"]): void;
58
59
  export declare function trackParamsReferences(body: t.NodePath<t.MarkoTagBody | t.Program>, type: BindingType, upstreamAlias?: Binding["upstreamAlias"], upstreamExpression?: Binding["upstreamExpression"]): void;
59
60
  export declare function setReferencesScope(path: t.NodePath<any>): void;
@@ -10,6 +10,7 @@ export declare enum ContentType {
10
10
  export interface Section {
11
11
  id: number;
12
12
  name: string;
13
+ loc: t.SourceLocation | undefined;
13
14
  depth: number;
14
15
  parent: Section | undefined;
15
16
  params: undefined | Binding;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.0.0-next.3.27",
3
+ "version": "6.0.0-next.3.28",
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.11",
51
+ "@marko/compiler": "^5.39.12",
52
52
  "csstype": "^3.1.3",
53
53
  "magic-string": "^0.30.17"
54
54
  },