mol_conform 0.0.39 → 0.0.41

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.test.js CHANGED
@@ -819,11 +819,11 @@ var $;
819
819
  function $mol_dev_format_button(label, click) {
820
820
  return $mol_dev_format_auto({
821
821
  [$.$mol_dev_format_head]() {
822
- return $mol_dev_format_span({ color: 'cornflowerblue' }, label);
822
+ return $.$mol_dev_format_span({ color: 'cornflowerblue' }, label);
823
823
  },
824
824
  [$.$mol_dev_format_body]() {
825
825
  Promise.resolve().then(click);
826
- return $mol_dev_format_span({});
826
+ return $.$mol_dev_format_span({});
827
827
  }
828
828
  });
829
829
  }
@@ -845,7 +845,7 @@ var $;
845
845
  return $mol_dev_format_native(val);
846
846
  }
847
847
  if (val instanceof Error) {
848
- return $mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
848
+ return $.$mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
849
849
  }
850
850
  if (val instanceof Promise) {
851
851
  return $.$mol_dev_format_shade($mol_dev_format_native(val), ' ', val[Symbol.toStringTag] ?? '');
@@ -917,28 +917,23 @@ var $;
917
917
  ];
918
918
  }
919
919
  $.$mol_dev_format_element = $mol_dev_format_element;
920
- function $mol_dev_format_span(style, ...content) {
921
- return $mol_dev_format_element('span', {
922
- ...style,
923
- }, ...content);
924
- }
925
- $.$mol_dev_format_span = $mol_dev_format_span;
920
+ $.$mol_dev_format_span = $mol_dev_format_element.bind(null, 'span');
926
921
  $.$mol_dev_format_div = $mol_dev_format_element.bind(null, 'div');
927
922
  $.$mol_dev_format_ol = $mol_dev_format_element.bind(null, 'ol');
928
923
  $.$mol_dev_format_li = $mol_dev_format_element.bind(null, 'li');
929
924
  $.$mol_dev_format_table = $mol_dev_format_element.bind(null, 'table');
930
925
  $.$mol_dev_format_tr = $mol_dev_format_element.bind(null, 'tr');
931
926
  $.$mol_dev_format_td = $mol_dev_format_element.bind(null, 'td');
932
- $.$mol_dev_format_accent = $mol_dev_format_span.bind(null, {
927
+ $.$mol_dev_format_accent = $.$mol_dev_format_span.bind(null, {
933
928
  'color': 'magenta',
934
929
  });
935
- $.$mol_dev_format_strong = $mol_dev_format_span.bind(null, {
930
+ $.$mol_dev_format_strong = $.$mol_dev_format_span.bind(null, {
936
931
  'font-weight': 'bold',
937
932
  });
938
- $.$mol_dev_format_string = $mol_dev_format_span.bind(null, {
933
+ $.$mol_dev_format_string = $.$mol_dev_format_span.bind(null, {
939
934
  'color': 'green',
940
935
  });
941
- $.$mol_dev_format_shade = $mol_dev_format_span.bind(null, {
936
+ $.$mol_dev_format_shade = $.$mol_dev_format_span.bind(null, {
942
937
  'color': 'gray',
943
938
  });
944
939
  $.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
@@ -1730,15 +1725,22 @@ var $;
1730
1725
  return function $mol_wire_task_get(host, args) {
1731
1726
  const sub = $mol_wire_auto();
1732
1727
  const existen = sub?.track_next();
1728
+ let cause = '';
1733
1729
  reuse: if (existen) {
1734
1730
  if (!existen.temp)
1735
1731
  break reuse;
1736
- if (existen.host !== host)
1732
+ if (existen.task !== task) {
1733
+ cause = 'task';
1737
1734
  break reuse;
1738
- if (existen.task !== task)
1735
+ }
1736
+ if (existen.host !== host) {
1737
+ cause = 'host';
1739
1738
  break reuse;
1740
- if (!$mol_compare_deep(existen.args, args))
1739
+ }
1740
+ if (!$mol_compare_deep(existen.args, args)) {
1741
+ cause = 'args';
1741
1742
  break reuse;
1743
+ }
1742
1744
  return existen;
1743
1745
  }
1744
1746
  const key = (host?.[Symbol.toStringTag] ?? host) + ('.' + task.name + '<#>');
@@ -1746,11 +1748,11 @@ var $;
1746
1748
  if (existen?.temp) {
1747
1749
  $$.$mol_log3_warn({
1748
1750
  place: '$mol_wire_task',
1749
- message: `Non idempotency`,
1751
+ message: `Different ${cause} on restart`,
1750
1752
  sub,
1751
- pubs: [...sub?.pub_list ?? [], existen],
1753
+ prev: existen,
1752
1754
  next,
1753
- hint: 'Ignore it',
1755
+ hint: 'Maybe required additional memoization',
1754
1756
  });
1755
1757
  }
1756
1758
  return next;