sibujs 3.0.0 → 3.1.0

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.
Files changed (47) hide show
  1. package/dist/browser.js +4 -4
  2. package/dist/build.cjs +43 -5
  3. package/dist/build.js +10 -10
  4. package/dist/cdn.global.js +7 -7
  5. package/dist/{chunk-VSNLICTS.js → chunk-2HAGQWDV.js} +1 -1
  6. package/dist/{chunk-L52H775O.js → chunk-2N2UL7O4.js} +4 -4
  7. package/dist/{chunk-UKMXT5T6.js → chunk-2ZJ7TSW4.js} +4 -5
  8. package/dist/{chunk-NEWH4O5U.js → chunk-3DJH25UO.js} +1 -1
  9. package/dist/{chunk-XDKP4T7G.js → chunk-3DYB5B3S.js} +2 -2
  10. package/dist/{chunk-L4DAT4WU.js → chunk-3U4ZVXVD.js} +24 -1
  11. package/dist/{chunk-INBOWHQ3.js → chunk-CR4MXPHB.js} +9 -9
  12. package/dist/{chunk-YMOIAHWA.js → chunk-EFOAE5NC.js} +1 -1
  13. package/dist/{chunk-4YTVESDX.js → chunk-GQ7RRFPU.js} +1 -1
  14. package/dist/{chunk-2KM2724A.js → chunk-IVOUCSZL.js} +2 -2
  15. package/dist/{chunk-KZA7ANXP.js → chunk-KB3BA2XK.js} +3 -3
  16. package/dist/{chunk-2JQUV4Y3.js → chunk-PMSDFTK3.js} +4 -4
  17. package/dist/{chunk-KH4OE6WY.js → chunk-QNQY5DUS.js} +5 -5
  18. package/dist/{chunk-6QZO7MMG.js → chunk-RK4BQG25.js} +1 -1
  19. package/dist/{chunk-DF3GTP4Q.js → chunk-SC437AMI.js} +1 -1
  20. package/dist/{chunk-XVYB3J6C.js → chunk-SVVAUX7J.js} +3 -3
  21. package/dist/{chunk-V65KTDZW.js → chunk-UYX2NDOH.js} +3 -3
  22. package/dist/{chunk-STFTTMO2.js → chunk-WKUXSE7V.js} +21 -3
  23. package/dist/{chunk-RJIRT46U.js → chunk-WYU7CYJ3.js} +4 -4
  24. package/dist/{chunk-5WD7BYTZ.js → chunk-ZIBE2SAT.js} +1 -1
  25. package/dist/data.cjs +23 -1
  26. package/dist/data.js +6 -6
  27. package/dist/devtools.js +4 -4
  28. package/dist/ecosystem.cjs +42 -4
  29. package/dist/ecosystem.js +7 -7
  30. package/dist/extras.cjs +42 -4
  31. package/dist/extras.js +19 -19
  32. package/dist/index.cjs +43 -5
  33. package/dist/index.js +10 -10
  34. package/dist/motion.js +3 -3
  35. package/dist/patterns.cjs +23 -1
  36. package/dist/patterns.js +5 -5
  37. package/dist/performance.js +4 -4
  38. package/dist/plugins.cjs +42 -4
  39. package/dist/plugins.js +6 -6
  40. package/dist/ssr.cjs +42 -4
  41. package/dist/ssr.js +7 -7
  42. package/dist/testing.js +2 -2
  43. package/dist/ui.cjs +24 -3
  44. package/dist/ui.js +6 -6
  45. package/dist/widgets.cjs +23 -1
  46. package/dist/widgets.js +6 -6
  47. package/package.json +1 -1
package/dist/extras.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  optimisticList,
6
6
  persisted,
7
7
  timeline
8
- } from "./chunk-KZA7ANXP.js";
8
+ } from "./chunk-KB3BA2XK.js";
9
9
  import {
10
10
  DOMPool,
11
11
  Features,
@@ -41,7 +41,7 @@ import {
41
41
  transitionState,
42
42
  uniqueId,
43
43
  yieldToMain
44
- } from "./chunk-XDKP4T7G.js";
44
+ } from "./chunk-3DYB5B3S.js";
45
45
  import {
46
46
  VERSION,
47
47
  bundlerMetadata,
@@ -87,7 +87,7 @@ import {
87
87
  wasm,
88
88
  worker,
89
89
  workerFn
90
- } from "./chunk-V65KTDZW.js";
90
+ } from "./chunk-UYX2NDOH.js";
91
91
  import {
92
92
  FocusTrap,
93
93
  VirtualList,
@@ -128,7 +128,7 @@ import {
128
128
  toast,
129
129
  withScopedStyle,
130
130
  zipMask
131
- } from "./chunk-KH4OE6WY.js";
131
+ } from "./chunk-QNQY5DUS.js";
132
132
  import {
133
133
  RenderProp,
134
134
  assertType,
@@ -155,7 +155,7 @@ import {
155
155
  select,
156
156
  tabs,
157
157
  tooltip
158
- } from "./chunk-RJIRT46U.js";
158
+ } from "./chunk-WYU7CYJ3.js";
159
159
  import {
160
160
  animationFrame,
161
161
  battery,
@@ -193,7 +193,7 @@ import {
193
193
  visibility,
194
194
  wakeLock,
195
195
  windowSize
196
- } from "./chunk-2KM2724A.js";
196
+ } from "./chunk-IVOUCSZL.js";
197
197
  import {
198
198
  __resetQueryCache,
199
199
  calculateDelay,
@@ -216,7 +216,7 @@ import {
216
216
  syncAdapter,
217
217
  throttle,
218
218
  withRetry
219
- } from "./chunk-2JQUV4Y3.js";
219
+ } from "./chunk-PMSDFTK3.js";
220
220
  import {
221
221
  SibuError,
222
222
  checkLeaks,
@@ -254,7 +254,7 @@ import {
254
254
  trackCleanup,
255
255
  walkDependencyGraph,
256
256
  withErrorTracking
257
- } from "./chunk-XVYB3J6C.js";
257
+ } from "./chunk-SVVAUX7J.js";
258
258
  import {
259
259
  antdAdapter,
260
260
  chakraAdapter,
@@ -264,7 +264,7 @@ import {
264
264
  mobXAdapter,
265
265
  reduxAdapter,
266
266
  zustandAdapter
267
- } from "./chunk-L52H775O.js";
267
+ } from "./chunk-2N2UL7O4.js";
268
268
  import {
269
269
  createPlugin,
270
270
  createPluginRegistry,
@@ -276,8 +276,8 @@ import {
276
276
  triggerPluginMount,
277
277
  triggerPluginUnmount
278
278
  } from "./chunk-3JHCYHWN.js";
279
- import "./chunk-VSNLICTS.js";
280
- import "./chunk-NEWH4O5U.js";
279
+ import "./chunk-2HAGQWDV.js";
280
+ import "./chunk-3DJH25UO.js";
281
281
  import {
282
282
  collectStream,
283
283
  deserializeState,
@@ -297,13 +297,13 @@ import {
297
297
  suspenseSwapScript,
298
298
  trustHTML
299
299
  } from "./chunk-JYD2PWXH.js";
300
- import "./chunk-YMOIAHWA.js";
301
- import "./chunk-STFTTMO2.js";
302
- import "./chunk-UKMXT5T6.js";
303
- import "./chunk-DF3GTP4Q.js";
300
+ import "./chunk-EFOAE5NC.js";
301
+ import "./chunk-WKUXSE7V.js";
302
+ import "./chunk-2ZJ7TSW4.js";
303
+ import "./chunk-SC437AMI.js";
304
304
  import "./chunk-2UPRY23K.js";
305
305
  import "./chunk-UCS6AMJ7.js";
306
- import "./chunk-5WD7BYTZ.js";
306
+ import "./chunk-ZIBE2SAT.js";
307
307
  import "./chunk-2RA7SHDA.js";
308
308
  import {
309
309
  TransitionGroup,
@@ -326,9 +326,9 @@ import {
326
326
  stagger,
327
327
  transition,
328
328
  viewTransition
329
- } from "./chunk-4YTVESDX.js";
330
- import "./chunk-6QZO7MMG.js";
331
- import "./chunk-L4DAT4WU.js";
329
+ } from "./chunk-GQ7RRFPU.js";
330
+ import "./chunk-RK4BQG25.js";
331
+ import "./chunk-3U4ZVXVD.js";
332
332
  import "./chunk-LMLD24FC.js";
333
333
  export {
334
334
  DOMPool,
package/dist/index.cjs CHANGED
@@ -471,7 +471,7 @@ function retrack(effectFn, subscriber) {
471
471
  }
472
472
  }
473
473
  function track(effectFn, subscriber) {
474
- if (!subscriber) subscriber = effectFn;
474
+ if (!subscriber) return reactiveBinding(effectFn);
475
475
  cleanup(subscriber);
476
476
  const prev = currentSubscriber;
477
477
  currentSubscriber = subscriber;
@@ -489,6 +489,28 @@ function track(effectFn, subscriber) {
489
489
  const sub2 = subscriber;
490
490
  return sub2._dispose ?? (sub2._dispose = () => cleanup(subscriber));
491
491
  }
492
+ function reactiveBinding(commit) {
493
+ const run = () => {
494
+ const s2 = subscriber;
495
+ if (s2._reentrant) return;
496
+ s2._reentrant = true;
497
+ try {
498
+ retrack(commit, subscriber);
499
+ } finally {
500
+ s2._reentrant = false;
501
+ }
502
+ };
503
+ const subscriber = run;
504
+ subscriber.depsHead = null;
505
+ subscriber.depsTail = null;
506
+ subscriber._epoch = 0;
507
+ subscriber._structDirty = false;
508
+ subscriber._runEpoch = 0;
509
+ subscriber._runs = 0;
510
+ subscriber._reentrant = false;
511
+ run();
512
+ return subscriber._dispose ?? (subscriber._dispose = () => cleanup(subscriber));
513
+ }
492
514
  function recordDependency(signal2) {
493
515
  if (!currentSubscriber) return;
494
516
  const sub2 = currentSubscriber;
@@ -720,8 +742,7 @@ function bindAttribute(el, attr, getter) {
720
742
  el.setAttribute(attr, isUrlAttribute(attr) ? sanitizeUrl(str) : str);
721
743
  }
722
744
  }
723
- const teardown = track(commit);
724
- return teardown;
745
+ return reactiveBinding(commit);
725
746
  }
726
747
  function bindDynamic(el, nameGetter, valueGetter) {
727
748
  let prevName = null;
@@ -752,7 +773,7 @@ function bindDynamic(el, nameGetter, valueGetter) {
752
773
  }
753
774
  prevName = name;
754
775
  }
755
- const teardown = track(commit);
776
+ const teardown = reactiveBinding(commit);
756
777
  return () => {
757
778
  teardown();
758
779
  if (prevName !== null) {
@@ -832,7 +853,7 @@ function bindChildNode(placeholder, getter) {
832
853
  }
833
854
  lastNodes = newNodes;
834
855
  }
835
- return track(commit);
856
+ return reactiveBinding(commit);
836
857
  }
837
858
 
838
859
  // src/core/rendering/dispose.ts
@@ -931,6 +952,18 @@ var CLOBBER_RISKY_IDS = /* @__PURE__ */ new Set([
931
952
  function setProp2(el, key, val) {
932
953
  el[key] = val;
933
954
  }
955
+ function looksLikeClassList(s2) {
956
+ const t = s2.trim();
957
+ if (!t) return false;
958
+ const tokens = t.split(/\s+/);
959
+ let sawClassish = false;
960
+ for (let i2 = 0; i2 < tokens.length; i2++) {
961
+ const tok = tokens[i2];
962
+ if (!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(tok)) return false;
963
+ if (/[-:/0-9]/.test(tok)) sawClassish = true;
964
+ }
965
+ return sawClassish;
966
+ }
934
967
  var kebabCache = /* @__PURE__ */ new Map();
935
968
  function toKebab(prop) {
936
969
  let cached = kebabCache.get(prop);
@@ -1066,6 +1099,11 @@ var tagFactory = (tag, ns) => {
1066
1099
  appendChildren(el, second);
1067
1100
  return el;
1068
1101
  }
1102
+ if (_isDev6 && looksLikeClassList(first)) {
1103
+ devWarn(
1104
+ `tagFactory: lone string "${first}" looks like a class list but is being rendered as TEXT. For a class, use ${tag}({ class: "${first}" }) \u2014 or ${tag}("${first}", children) to set the class AND add children.`
1105
+ );
1106
+ }
1069
1107
  el.textContent = first;
1070
1108
  return el;
1071
1109
  }
package/dist/index.js CHANGED
@@ -44,7 +44,7 @@ import {
44
44
  unregisterComponent,
45
45
  when,
46
46
  writable
47
- } from "./chunk-INBOWHQ3.js";
47
+ } from "./chunk-CR4MXPHB.js";
48
48
  import {
49
49
  __resetIdCounter,
50
50
  createId
@@ -186,26 +186,26 @@ import {
186
186
  use,
187
187
  var_,
188
188
  video
189
- } from "./chunk-VSNLICTS.js";
189
+ } from "./chunk-2HAGQWDV.js";
190
190
  import {
191
191
  watch
192
- } from "./chunk-NEWH4O5U.js";
192
+ } from "./chunk-3DJH25UO.js";
193
193
  import {
194
194
  trustHTML
195
195
  } from "./chunk-JYD2PWXH.js";
196
196
  import {
197
197
  context
198
- } from "./chunk-YMOIAHWA.js";
198
+ } from "./chunk-EFOAE5NC.js";
199
199
  import {
200
200
  SVG_NS,
201
201
  tagFactory
202
- } from "./chunk-STFTTMO2.js";
202
+ } from "./chunk-WKUXSE7V.js";
203
203
  import {
204
204
  bindDynamic
205
- } from "./chunk-UKMXT5T6.js";
205
+ } from "./chunk-2ZJ7TSW4.js";
206
206
  import {
207
207
  derived
208
- } from "./chunk-DF3GTP4Q.js";
208
+ } from "./chunk-SC437AMI.js";
209
209
  import {
210
210
  checkLeaks,
211
211
  dispose,
@@ -215,7 +215,7 @@ import "./chunk-UCS6AMJ7.js";
215
215
  import {
216
216
  effect,
217
217
  on
218
- } from "./chunk-5WD7BYTZ.js";
218
+ } from "./chunk-ZIBE2SAT.js";
219
219
  import {
220
220
  disableSSR,
221
221
  enableSSR,
@@ -229,12 +229,12 @@ import {
229
229
  enqueueBatchedSignal,
230
230
  isBatching,
231
231
  signal
232
- } from "./chunk-6QZO7MMG.js";
232
+ } from "./chunk-RK4BQG25.js";
233
233
  import {
234
234
  retrack,
235
235
  setMaxDrainIterations,
236
236
  untracked
237
- } from "./chunk-L4DAT4WU.js";
237
+ } from "./chunk-3U4ZVXVD.js";
238
238
  import "./chunk-LMLD24FC.js";
239
239
  export {
240
240
  DynamicComponent,
package/dist/motion.js CHANGED
@@ -19,9 +19,9 @@ import {
19
19
  stagger,
20
20
  transition,
21
21
  viewTransition
22
- } from "./chunk-4YTVESDX.js";
23
- import "./chunk-6QZO7MMG.js";
24
- import "./chunk-L4DAT4WU.js";
22
+ } from "./chunk-GQ7RRFPU.js";
23
+ import "./chunk-RK4BQG25.js";
24
+ import "./chunk-3U4ZVXVD.js";
25
25
  import "./chunk-LMLD24FC.js";
26
26
  export {
27
27
  TransitionGroup,
package/dist/patterns.cjs CHANGED
@@ -188,7 +188,7 @@ function retrack(effectFn, subscriber) {
188
188
  }
189
189
  }
190
190
  function track(effectFn, subscriber) {
191
- if (!subscriber) subscriber = effectFn;
191
+ if (!subscriber) return reactiveBinding(effectFn);
192
192
  cleanup(subscriber);
193
193
  const prev = currentSubscriber;
194
194
  currentSubscriber = subscriber;
@@ -206,6 +206,28 @@ function track(effectFn, subscriber) {
206
206
  const sub = subscriber;
207
207
  return sub._dispose ?? (sub._dispose = () => cleanup(subscriber));
208
208
  }
209
+ function reactiveBinding(commit) {
210
+ const run = () => {
211
+ const s = subscriber;
212
+ if (s._reentrant) return;
213
+ s._reentrant = true;
214
+ try {
215
+ retrack(commit, subscriber);
216
+ } finally {
217
+ s._reentrant = false;
218
+ }
219
+ };
220
+ const subscriber = run;
221
+ subscriber.depsHead = null;
222
+ subscriber.depsTail = null;
223
+ subscriber._epoch = 0;
224
+ subscriber._structDirty = false;
225
+ subscriber._runEpoch = 0;
226
+ subscriber._runs = 0;
227
+ subscriber._reentrant = false;
228
+ run();
229
+ return subscriber._dispose ?? (subscriber._dispose = () => cleanup(subscriber));
230
+ }
209
231
  function recordDependency(signal2) {
210
232
  if (!currentSubscriber) return;
211
233
  const sub = currentSubscriber;
package/dist/patterns.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  optimisticList,
6
6
  persisted,
7
7
  timeline
8
- } from "./chunk-KZA7ANXP.js";
8
+ } from "./chunk-KB3BA2XK.js";
9
9
  import {
10
10
  RenderProp,
11
11
  assertType,
@@ -22,11 +22,11 @@ import {
22
22
  withProps,
23
23
  withWrapper
24
24
  } from "./chunk-CNZ35WI2.js";
25
- import "./chunk-DF3GTP4Q.js";
26
- import "./chunk-5WD7BYTZ.js";
25
+ import "./chunk-SC437AMI.js";
26
+ import "./chunk-ZIBE2SAT.js";
27
27
  import "./chunk-2RA7SHDA.js";
28
- import "./chunk-6QZO7MMG.js";
29
- import "./chunk-L4DAT4WU.js";
28
+ import "./chunk-RK4BQG25.js";
29
+ import "./chunk-3U4ZVXVD.js";
30
30
  import "./chunk-LMLD24FC.js";
31
31
  export {
32
32
  RenderProp,
@@ -33,15 +33,15 @@ import {
33
33
  transitionState,
34
34
  uniqueId,
35
35
  yieldToMain
36
- } from "./chunk-XDKP4T7G.js";
36
+ } from "./chunk-3DYB5B3S.js";
37
37
  import {
38
38
  trustHTML
39
39
  } from "./chunk-JYD2PWXH.js";
40
40
  import "./chunk-UCS6AMJ7.js";
41
- import "./chunk-5WD7BYTZ.js";
41
+ import "./chunk-ZIBE2SAT.js";
42
42
  import "./chunk-2RA7SHDA.js";
43
- import "./chunk-6QZO7MMG.js";
44
- import "./chunk-L4DAT4WU.js";
43
+ import "./chunk-RK4BQG25.js";
44
+ import "./chunk-3U4ZVXVD.js";
45
45
  import "./chunk-LMLD24FC.js";
46
46
  export {
47
47
  DOMPool,
package/dist/plugins.cjs CHANGED
@@ -901,7 +901,7 @@ function retrack(effectFn, subscriber) {
901
901
  }
902
902
  }
903
903
  function track(effectFn, subscriber) {
904
- if (!subscriber) subscriber = effectFn;
904
+ if (!subscriber) return reactiveBinding(effectFn);
905
905
  cleanup(subscriber);
906
906
  const prev = currentSubscriber;
907
907
  currentSubscriber = subscriber;
@@ -919,6 +919,28 @@ function track(effectFn, subscriber) {
919
919
  const sub2 = subscriber;
920
920
  return sub2._dispose ?? (sub2._dispose = () => cleanup(subscriber));
921
921
  }
922
+ function reactiveBinding(commit) {
923
+ const run = () => {
924
+ const s2 = subscriber;
925
+ if (s2._reentrant) return;
926
+ s2._reentrant = true;
927
+ try {
928
+ retrack(commit, subscriber);
929
+ } finally {
930
+ s2._reentrant = false;
931
+ }
932
+ };
933
+ const subscriber = run;
934
+ subscriber.depsHead = null;
935
+ subscriber.depsTail = null;
936
+ subscriber._epoch = 0;
937
+ subscriber._structDirty = false;
938
+ subscriber._runEpoch = 0;
939
+ subscriber._runs = 0;
940
+ subscriber._reentrant = false;
941
+ run();
942
+ return subscriber._dispose ?? (subscriber._dispose = () => cleanup(subscriber));
943
+ }
922
944
  function recordDependency(signal2) {
923
945
  if (!currentSubscriber) return;
924
946
  const sub2 = currentSubscriber;
@@ -1115,8 +1137,7 @@ function bindAttribute(el, attr, getter) {
1115
1137
  el.setAttribute(attr, isUrlAttribute(attr) ? sanitizeUrl(str) : str);
1116
1138
  }
1117
1139
  }
1118
- const teardown = track(commit);
1119
- return teardown;
1140
+ return reactiveBinding(commit);
1120
1141
  }
1121
1142
 
1122
1143
  // src/reactivity/bindChildNode.ts
@@ -1191,7 +1212,7 @@ function bindChildNode(placeholder, getter) {
1191
1212
  }
1192
1213
  lastNodes = newNodes;
1193
1214
  }
1194
- return track(commit);
1215
+ return reactiveBinding(commit);
1195
1216
  }
1196
1217
 
1197
1218
  // src/core/rendering/tagFactory.ts
@@ -1285,6 +1306,18 @@ var CLOBBER_RISKY_IDS = /* @__PURE__ */ new Set([
1285
1306
  function setProp2(el, key, val) {
1286
1307
  el[key] = val;
1287
1308
  }
1309
+ function looksLikeClassList(s2) {
1310
+ const t2 = s2.trim();
1311
+ if (!t2) return false;
1312
+ const tokens = t2.split(/\s+/);
1313
+ let sawClassish = false;
1314
+ for (let i2 = 0; i2 < tokens.length; i2++) {
1315
+ const tok = tokens[i2];
1316
+ if (!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(tok)) return false;
1317
+ if (/[-:/0-9]/.test(tok)) sawClassish = true;
1318
+ }
1319
+ return sawClassish;
1320
+ }
1288
1321
  var kebabCache = /* @__PURE__ */ new Map();
1289
1322
  function toKebab(prop) {
1290
1323
  let cached = kebabCache.get(prop);
@@ -1420,6 +1453,11 @@ var tagFactory = (tag, ns) => {
1420
1453
  appendChildren(el, second);
1421
1454
  return el;
1422
1455
  }
1456
+ if (_isDev6 && looksLikeClassList(first)) {
1457
+ devWarn(
1458
+ `tagFactory: lone string "${first}" looks like a class list but is being rendered as TEXT. For a class, use ${tag}({ class: "${first}" }) \u2014 or ${tag}("${first}", children) to set the class AND add children.`
1459
+ );
1460
+ }
1423
1461
  el.textContent = first;
1424
1462
  return el;
1425
1463
  }
package/dist/plugins.js CHANGED
@@ -32,13 +32,13 @@ import {
32
32
  } from "./chunk-3JHCYHWN.js";
33
33
  import {
34
34
  span
35
- } from "./chunk-VSNLICTS.js";
35
+ } from "./chunk-2HAGQWDV.js";
36
36
  import {
37
37
  escapeScriptJson,
38
38
  renderToString
39
39
  } from "./chunk-JYD2PWXH.js";
40
- import "./chunk-STFTTMO2.js";
41
- import "./chunk-UKMXT5T6.js";
40
+ import "./chunk-WKUXSE7V.js";
41
+ import "./chunk-2ZJ7TSW4.js";
42
42
  import {
43
43
  dispose,
44
44
  registerDisposer
@@ -48,14 +48,14 @@ import {
48
48
  } from "./chunk-UCS6AMJ7.js";
49
49
  import {
50
50
  effect
51
- } from "./chunk-5WD7BYTZ.js";
51
+ } from "./chunk-ZIBE2SAT.js";
52
52
  import "./chunk-2RA7SHDA.js";
53
53
  import {
54
54
  signal
55
- } from "./chunk-6QZO7MMG.js";
55
+ } from "./chunk-RK4BQG25.js";
56
56
  import {
57
57
  track
58
- } from "./chunk-L4DAT4WU.js";
58
+ } from "./chunk-3U4ZVXVD.js";
59
59
  import "./chunk-LMLD24FC.js";
60
60
 
61
61
  // src/plugins/i18n.ts
package/dist/ssr.cjs CHANGED
@@ -808,7 +808,7 @@ function retrack(effectFn, subscriber) {
808
808
  }
809
809
  }
810
810
  function track(effectFn, subscriber) {
811
- if (!subscriber) subscriber = effectFn;
811
+ if (!subscriber) return reactiveBinding(effectFn);
812
812
  cleanup(subscriber);
813
813
  const prev = currentSubscriber;
814
814
  currentSubscriber = subscriber;
@@ -826,6 +826,28 @@ function track(effectFn, subscriber) {
826
826
  const sub2 = subscriber;
827
827
  return sub2._dispose ?? (sub2._dispose = () => cleanup(subscriber));
828
828
  }
829
+ function reactiveBinding(commit) {
830
+ const run = () => {
831
+ const s2 = subscriber;
832
+ if (s2._reentrant) return;
833
+ s2._reentrant = true;
834
+ try {
835
+ retrack(commit, subscriber);
836
+ } finally {
837
+ s2._reentrant = false;
838
+ }
839
+ };
840
+ const subscriber = run;
841
+ subscriber.depsHead = null;
842
+ subscriber.depsTail = null;
843
+ subscriber._epoch = 0;
844
+ subscriber._structDirty = false;
845
+ subscriber._runEpoch = 0;
846
+ subscriber._runs = 0;
847
+ subscriber._reentrant = false;
848
+ run();
849
+ return subscriber._dispose ?? (subscriber._dispose = () => cleanup(subscriber));
850
+ }
829
851
  function recordDependency(signal2) {
830
852
  if (!currentSubscriber) return;
831
853
  const sub2 = currentSubscriber;
@@ -1566,8 +1588,7 @@ function bindAttribute(el, attr, getter) {
1566
1588
  el.setAttribute(attr, isUrlAttribute(attr) ? sanitizeUrl(str) : str);
1567
1589
  }
1568
1590
  }
1569
- const teardown = track(commit);
1570
- return teardown;
1591
+ return reactiveBinding(commit);
1571
1592
  }
1572
1593
 
1573
1594
  // src/reactivity/bindChildNode.ts
@@ -1641,7 +1662,7 @@ function bindChildNode(placeholder, getter) {
1641
1662
  }
1642
1663
  lastNodes = newNodes;
1643
1664
  }
1644
- return track(commit);
1665
+ return reactiveBinding(commit);
1645
1666
  }
1646
1667
 
1647
1668
  // src/core/rendering/dispose.ts
@@ -1684,6 +1705,18 @@ var CLOBBER_RISKY_IDS = /* @__PURE__ */ new Set([
1684
1705
  function setProp2(el, key, val) {
1685
1706
  el[key] = val;
1686
1707
  }
1708
+ function looksLikeClassList(s2) {
1709
+ const t = s2.trim();
1710
+ if (!t) return false;
1711
+ const tokens = t.split(/\s+/);
1712
+ let sawClassish = false;
1713
+ for (let i2 = 0; i2 < tokens.length; i2++) {
1714
+ const tok = tokens[i2];
1715
+ if (!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(tok)) return false;
1716
+ if (/[-:/0-9]/.test(tok)) sawClassish = true;
1717
+ }
1718
+ return sawClassish;
1719
+ }
1687
1720
  var kebabCache = /* @__PURE__ */ new Map();
1688
1721
  function toKebab(prop) {
1689
1722
  let cached = kebabCache.get(prop);
@@ -1819,6 +1852,11 @@ var tagFactory = (tag, ns) => {
1819
1852
  appendChildren(el, second);
1820
1853
  return el;
1821
1854
  }
1855
+ if (_isDev8 && looksLikeClassList(first)) {
1856
+ devWarn(
1857
+ `tagFactory: lone string "${first}" looks like a class list but is being rendered as TEXT. For a class, use ${tag}({ class: "${first}" }) \u2014 or ${tag}("${first}", children) to set the class AND add children.`
1858
+ );
1859
+ }
1822
1860
  el.textContent = first;
1823
1861
  return el;
1824
1862
  }
package/dist/ssr.js CHANGED
@@ -22,8 +22,8 @@ import {
22
22
  wasm,
23
23
  worker,
24
24
  workerFn
25
- } from "./chunk-V65KTDZW.js";
26
- import "./chunk-VSNLICTS.js";
25
+ } from "./chunk-UYX2NDOH.js";
26
+ import "./chunk-2HAGQWDV.js";
27
27
  import {
28
28
  collectStream,
29
29
  deserializeState,
@@ -43,14 +43,14 @@ import {
43
43
  suspenseSwapScript,
44
44
  trustHTML
45
45
  } from "./chunk-JYD2PWXH.js";
46
- import "./chunk-STFTTMO2.js";
47
- import "./chunk-UKMXT5T6.js";
46
+ import "./chunk-WKUXSE7V.js";
47
+ import "./chunk-2ZJ7TSW4.js";
48
48
  import "./chunk-2UPRY23K.js";
49
49
  import "./chunk-UCS6AMJ7.js";
50
- import "./chunk-5WD7BYTZ.js";
50
+ import "./chunk-ZIBE2SAT.js";
51
51
  import "./chunk-2RA7SHDA.js";
52
- import "./chunk-6QZO7MMG.js";
53
- import "./chunk-L4DAT4WU.js";
52
+ import "./chunk-RK4BQG25.js";
53
+ import "./chunk-3U4ZVXVD.js";
54
54
  import "./chunk-LMLD24FC.js";
55
55
  export {
56
56
  Head,
package/dist/testing.js CHANGED
@@ -3,9 +3,9 @@ import {
3
3
  } from "./chunk-2UPRY23K.js";
4
4
  import {
5
5
  effect
6
- } from "./chunk-5WD7BYTZ.js";
6
+ } from "./chunk-ZIBE2SAT.js";
7
7
  import "./chunk-2RA7SHDA.js";
8
- import "./chunk-L4DAT4WU.js";
8
+ import "./chunk-3U4ZVXVD.js";
9
9
  import "./chunk-LMLD24FC.js";
10
10
 
11
11
  // src/testing/a11y.ts
package/dist/ui.cjs CHANGED
@@ -230,7 +230,7 @@ function retrack(effectFn, subscriber) {
230
230
  }
231
231
  }
232
232
  function track(effectFn, subscriber) {
233
- if (!subscriber) subscriber = effectFn;
233
+ if (!subscriber) return reactiveBinding(effectFn);
234
234
  cleanup(subscriber);
235
235
  const prev = currentSubscriber;
236
236
  currentSubscriber = subscriber;
@@ -248,6 +248,28 @@ function track(effectFn, subscriber) {
248
248
  const sub = subscriber;
249
249
  return sub._dispose ?? (sub._dispose = () => cleanup(subscriber));
250
250
  }
251
+ function reactiveBinding(commit) {
252
+ const run = () => {
253
+ const s = subscriber;
254
+ if (s._reentrant) return;
255
+ s._reentrant = true;
256
+ try {
257
+ retrack(commit, subscriber);
258
+ } finally {
259
+ s._reentrant = false;
260
+ }
261
+ };
262
+ const subscriber = run;
263
+ subscriber.depsHead = null;
264
+ subscriber.depsTail = null;
265
+ subscriber._epoch = 0;
266
+ subscriber._structDirty = false;
267
+ subscriber._runEpoch = 0;
268
+ subscriber._runs = 0;
269
+ subscriber._reentrant = false;
270
+ run();
271
+ return subscriber._dispose ?? (subscriber._dispose = () => cleanup(subscriber));
272
+ }
251
273
  function recordDependency(signal2) {
252
274
  if (!currentSubscriber) return;
253
275
  const sub = currentSubscriber;
@@ -1760,8 +1782,7 @@ function bindAttribute(el, attr, getter) {
1760
1782
  el.setAttribute(attr, isUrlAttribute(attr) ? sanitizeUrl(str) : str);
1761
1783
  }
1762
1784
  }
1763
- const teardown = track(commit);
1764
- return teardown;
1785
+ return reactiveBinding(commit);
1765
1786
  }
1766
1787
 
1767
1788
  // src/ui/reactiveAttr.ts