mol_jsx_lib 0.0.1370 → 0.0.1372

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/node.mjs CHANGED
@@ -570,11 +570,11 @@ var $;
570
570
  function $mol_dev_format_button(label, click) {
571
571
  return $mol_dev_format_auto({
572
572
  [$.$mol_dev_format_head]() {
573
- return $mol_dev_format_span({ color: 'cornflowerblue' }, label);
573
+ return $.$mol_dev_format_span({ color: 'cornflowerblue' }, label);
574
574
  },
575
575
  [$.$mol_dev_format_body]() {
576
576
  Promise.resolve().then(click);
577
- return $mol_dev_format_span({});
577
+ return $.$mol_dev_format_span({});
578
578
  }
579
579
  });
580
580
  }
@@ -595,8 +595,8 @@ var $;
595
595
  if (typeof val === 'function') {
596
596
  return $mol_dev_format_native(val);
597
597
  }
598
- if (Error.isError(val)) {
599
- return $mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
598
+ if (val instanceof Error) {
599
+ return $.$mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
600
600
  }
601
601
  if (val instanceof Promise) {
602
602
  return $.$mol_dev_format_shade($mol_dev_format_native(val), ' ', val[Symbol.toStringTag] ?? '');
@@ -668,28 +668,23 @@ var $;
668
668
  ];
669
669
  }
670
670
  $.$mol_dev_format_element = $mol_dev_format_element;
671
- function $mol_dev_format_span(style, ...content) {
672
- return $mol_dev_format_element('span', {
673
- ...style,
674
- }, ...content);
675
- }
676
- $.$mol_dev_format_span = $mol_dev_format_span;
671
+ $.$mol_dev_format_span = $mol_dev_format_element.bind(null, 'span');
677
672
  $.$mol_dev_format_div = $mol_dev_format_element.bind(null, 'div');
678
673
  $.$mol_dev_format_ol = $mol_dev_format_element.bind(null, 'ol');
679
674
  $.$mol_dev_format_li = $mol_dev_format_element.bind(null, 'li');
680
675
  $.$mol_dev_format_table = $mol_dev_format_element.bind(null, 'table');
681
676
  $.$mol_dev_format_tr = $mol_dev_format_element.bind(null, 'tr');
682
677
  $.$mol_dev_format_td = $mol_dev_format_element.bind(null, 'td');
683
- $.$mol_dev_format_accent = $mol_dev_format_span.bind(null, {
678
+ $.$mol_dev_format_accent = $.$mol_dev_format_span.bind(null, {
684
679
  'color': 'magenta',
685
680
  });
686
- $.$mol_dev_format_strong = $mol_dev_format_span.bind(null, {
681
+ $.$mol_dev_format_strong = $.$mol_dev_format_span.bind(null, {
687
682
  'font-weight': 'bold',
688
683
  });
689
- $.$mol_dev_format_string = $mol_dev_format_span.bind(null, {
684
+ $.$mol_dev_format_string = $.$mol_dev_format_span.bind(null, {
690
685
  'color': 'green',
691
686
  });
692
- $.$mol_dev_format_shade = $mol_dev_format_span.bind(null, {
687
+ $.$mol_dev_format_shade = $.$mol_dev_format_span.bind(null, {
693
688
  'color': 'gray',
694
689
  });
695
690
  $.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
@@ -1321,7 +1316,7 @@ var $;
1321
1316
  var $;
1322
1317
  (function ($) {
1323
1318
  function $mol_log3_area_lazy(event) {
1324
- const self = this;
1319
+ const self = this.$;
1325
1320
  const stack = self.$mol_log3_stack;
1326
1321
  const deep = stack.length;
1327
1322
  let logged = false;
@@ -1857,15 +1852,22 @@ var $;
1857
1852
  return function $mol_wire_task_get(host, args) {
1858
1853
  const sub = $mol_wire_auto();
1859
1854
  const existen = sub?.track_next();
1855
+ let cause = '';
1860
1856
  reuse: if (existen) {
1861
1857
  if (!existen.temp)
1862
1858
  break reuse;
1863
- if (existen.host !== host)
1859
+ if (existen.task !== task) {
1860
+ cause = 'task';
1864
1861
  break reuse;
1865
- if (existen.task !== task)
1862
+ }
1863
+ if (existen.host !== host) {
1864
+ cause = 'host';
1866
1865
  break reuse;
1867
- if (!$mol_compare_deep(existen.args, args))
1866
+ }
1867
+ if (!$mol_compare_deep(existen.args, args)) {
1868
+ cause = 'args';
1868
1869
  break reuse;
1870
+ }
1869
1871
  return existen;
1870
1872
  }
1871
1873
  const key = (host?.[Symbol.toStringTag] ?? host) + ('.' + task.name + '<#>');
@@ -1873,11 +1875,11 @@ var $;
1873
1875
  if (existen?.temp) {
1874
1876
  $$.$mol_log3_warn({
1875
1877
  place: '$mol_wire_task',
1876
- message: `Non idempotency`,
1878
+ message: `Different ${cause} on restart`,
1877
1879
  sub,
1878
- pubs: [...sub?.pub_list ?? [], existen],
1880
+ prev: existen,
1879
1881
  next,
1880
- hint: 'Ignore it',
1882
+ hint: 'Maybe required additional memoization',
1881
1883
  });
1882
1884
  }
1883
1885
  return next;
package/node.test.js CHANGED
@@ -561,11 +561,11 @@ var $;
561
561
  function $mol_dev_format_button(label, click) {
562
562
  return $mol_dev_format_auto({
563
563
  [$.$mol_dev_format_head]() {
564
- return $mol_dev_format_span({ color: 'cornflowerblue' }, label);
564
+ return $.$mol_dev_format_span({ color: 'cornflowerblue' }, label);
565
565
  },
566
566
  [$.$mol_dev_format_body]() {
567
567
  Promise.resolve().then(click);
568
- return $mol_dev_format_span({});
568
+ return $.$mol_dev_format_span({});
569
569
  }
570
570
  });
571
571
  }
@@ -586,8 +586,8 @@ var $;
586
586
  if (typeof val === 'function') {
587
587
  return $mol_dev_format_native(val);
588
588
  }
589
- if (Error.isError(val)) {
590
- return $mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
589
+ if (val instanceof Error) {
590
+ return $.$mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
591
591
  }
592
592
  if (val instanceof Promise) {
593
593
  return $.$mol_dev_format_shade($mol_dev_format_native(val), ' ', val[Symbol.toStringTag] ?? '');
@@ -659,28 +659,23 @@ var $;
659
659
  ];
660
660
  }
661
661
  $.$mol_dev_format_element = $mol_dev_format_element;
662
- function $mol_dev_format_span(style, ...content) {
663
- return $mol_dev_format_element('span', {
664
- ...style,
665
- }, ...content);
666
- }
667
- $.$mol_dev_format_span = $mol_dev_format_span;
662
+ $.$mol_dev_format_span = $mol_dev_format_element.bind(null, 'span');
668
663
  $.$mol_dev_format_div = $mol_dev_format_element.bind(null, 'div');
669
664
  $.$mol_dev_format_ol = $mol_dev_format_element.bind(null, 'ol');
670
665
  $.$mol_dev_format_li = $mol_dev_format_element.bind(null, 'li');
671
666
  $.$mol_dev_format_table = $mol_dev_format_element.bind(null, 'table');
672
667
  $.$mol_dev_format_tr = $mol_dev_format_element.bind(null, 'tr');
673
668
  $.$mol_dev_format_td = $mol_dev_format_element.bind(null, 'td');
674
- $.$mol_dev_format_accent = $mol_dev_format_span.bind(null, {
669
+ $.$mol_dev_format_accent = $.$mol_dev_format_span.bind(null, {
675
670
  'color': 'magenta',
676
671
  });
677
- $.$mol_dev_format_strong = $mol_dev_format_span.bind(null, {
672
+ $.$mol_dev_format_strong = $.$mol_dev_format_span.bind(null, {
678
673
  'font-weight': 'bold',
679
674
  });
680
- $.$mol_dev_format_string = $mol_dev_format_span.bind(null, {
675
+ $.$mol_dev_format_string = $.$mol_dev_format_span.bind(null, {
681
676
  'color': 'green',
682
677
  });
683
- $.$mol_dev_format_shade = $mol_dev_format_span.bind(null, {
678
+ $.$mol_dev_format_shade = $.$mol_dev_format_span.bind(null, {
684
679
  'color': 'gray',
685
680
  });
686
681
  $.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
@@ -1312,7 +1307,7 @@ var $;
1312
1307
  var $;
1313
1308
  (function ($) {
1314
1309
  function $mol_log3_area_lazy(event) {
1315
- const self = this;
1310
+ const self = this.$;
1316
1311
  const stack = self.$mol_log3_stack;
1317
1312
  const deep = stack.length;
1318
1313
  let logged = false;
@@ -1848,15 +1843,22 @@ var $;
1848
1843
  return function $mol_wire_task_get(host, args) {
1849
1844
  const sub = $mol_wire_auto();
1850
1845
  const existen = sub?.track_next();
1846
+ let cause = '';
1851
1847
  reuse: if (existen) {
1852
1848
  if (!existen.temp)
1853
1849
  break reuse;
1854
- if (existen.host !== host)
1850
+ if (existen.task !== task) {
1851
+ cause = 'task';
1855
1852
  break reuse;
1856
- if (existen.task !== task)
1853
+ }
1854
+ if (existen.host !== host) {
1855
+ cause = 'host';
1857
1856
  break reuse;
1858
- if (!$mol_compare_deep(existen.args, args))
1857
+ }
1858
+ if (!$mol_compare_deep(existen.args, args)) {
1859
+ cause = 'args';
1859
1860
  break reuse;
1861
+ }
1860
1862
  return existen;
1861
1863
  }
1862
1864
  const key = (host?.[Symbol.toStringTag] ?? host) + ('.' + task.name + '<#>');
@@ -1864,11 +1866,11 @@ var $;
1864
1866
  if (existen?.temp) {
1865
1867
  $$.$mol_log3_warn({
1866
1868
  place: '$mol_wire_task',
1867
- message: `Non idempotency`,
1869
+ message: `Different ${cause} on restart`,
1868
1870
  sub,
1869
- pubs: [...sub?.pub_list ?? [], existen],
1871
+ prev: existen,
1870
1872
  next,
1871
- hint: 'Ignore it',
1873
+ hint: 'Maybe required additional memoization',
1872
1874
  });
1873
1875
  }
1874
1876
  return next;