sibujs 3.3.0 → 3.3.1
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/browser.cjs +210 -26
- package/dist/browser.js +4 -4
- package/dist/build.cjs +193 -89
- package/dist/build.js +10 -10
- package/dist/cdn.global.js +7 -7
- package/dist/{chunk-24DBWDTK.js → chunk-37BUKSLH.js} +1 -1
- package/dist/{chunk-IHBVTURX.js → chunk-4UUMSLSL.js} +4 -4
- package/dist/{chunk-USDR2GFV.js → chunk-6LTFHJQG.js} +3 -3
- package/dist/{chunk-MWZFOIBG.js → chunk-AMIKDMLP.js} +4 -4
- package/dist/{chunk-JBXNCZSC.js → chunk-F7FXQ3QS.js} +1 -1
- package/dist/{chunk-BEIKESVL.js → chunk-IKLYI3RF.js} +9 -9
- package/dist/{chunk-NUWKIEHE.js → chunk-LU2MQXQQ.js} +2 -2
- package/dist/{chunk-WVJJUFPC.js → chunk-M5KBNOSJ.js} +2 -2
- package/dist/{chunk-7JHWAGRQ.js → chunk-MHBCEJQO.js} +1 -1
- package/dist/{chunk-Q2ERM6NT.js → chunk-NHKQKKZU.js} +1 -1
- package/dist/{chunk-6G6UNHZI.js → chunk-RYMOSG5B.js} +5 -5
- package/dist/{chunk-F4UM7QBJ.js → chunk-SLMFA3ZZ.js} +1 -1
- package/dist/{chunk-X3NHE2DK.js → chunk-TEFZT5PJ.js} +83 -17
- package/dist/{chunk-SLCUP2EK.js → chunk-ULLTNDRA.js} +3 -3
- package/dist/{chunk-M6WSIGYW.js → chunk-VOVVTOEA.js} +2 -2
- package/dist/{chunk-XQ7XSGYP.js → chunk-WL7BIR6O.js} +1 -1
- package/dist/{chunk-CVMMULHO.js → chunk-WW6DAGGR.js} +4 -4
- package/dist/{chunk-5K72I3UQ.js → chunk-WZG2SZOT.js} +21 -4
- package/dist/{chunk-S4FHR5ZZ.js → chunk-XH2RTYEQ.js} +3 -3
- package/dist/{chunk-4WXWJ4SW.js → chunk-Z37APKBV.js} +4 -4
- package/dist/data.cjs +161 -23
- package/dist/data.js +6 -6
- package/dist/devtools.cjs +245 -31
- package/dist/devtools.js +4 -4
- package/dist/ecosystem.cjs +183 -45
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +185 -86
- package/dist/extras.js +19 -19
- package/dist/index.cjs +193 -89
- package/dist/index.d.cts +59 -8
- package/dist/index.d.ts +59 -8
- package/dist/index.js +10 -10
- package/dist/motion.cjs +329 -13
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +161 -23
- package/dist/patterns.js +5 -5
- package/dist/performance.cjs +258 -23
- package/dist/performance.js +4 -4
- package/dist/plugins.cjs +244 -51
- package/dist/plugins.js +6 -6
- package/dist/ssr.cjs +183 -44
- package/dist/ssr.js +7 -7
- package/dist/testing.cjs +396 -5
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +221 -32
- package/dist/ui.js +6 -6
- package/dist/widgets.cjs +146 -26
- package/dist/widgets.js +6 -6
- package/package.json +1 -1
package/dist/ui.cjs
CHANGED
|
@@ -107,7 +107,7 @@ function devWarn(message) {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
// src/reactivity/track.ts
|
|
110
|
+
// src/reactivity/track-core.ts
|
|
111
111
|
var _isDev2 = isDev();
|
|
112
112
|
var POOL_MAX = 4096;
|
|
113
113
|
var nodePool = [];
|
|
@@ -191,6 +191,7 @@ function unlinkSub(node) {
|
|
|
191
191
|
else sub.depsTail = prev;
|
|
192
192
|
}
|
|
193
193
|
var currentSubscriber = null;
|
|
194
|
+
var suspendSavedSub = null;
|
|
194
195
|
var notifyDepth = 0;
|
|
195
196
|
var pendingQueue = [];
|
|
196
197
|
var pendingSet = /* @__PURE__ */ new Set();
|
|
@@ -202,7 +203,35 @@ function safeInvoke(sub) {
|
|
|
202
203
|
if (_isDev2) devWarn(`Subscriber threw during notification: ${err instanceof Error ? err.message : String(err)}`);
|
|
203
204
|
}
|
|
204
205
|
}
|
|
206
|
+
var suspendDepth = 0;
|
|
205
207
|
var trackingSuspended = false;
|
|
208
|
+
function suspendTracking() {
|
|
209
|
+
if (suspendDepth === 0) {
|
|
210
|
+
suspendSavedSub = currentSubscriber;
|
|
211
|
+
currentSubscriber = null;
|
|
212
|
+
trackingSuspended = true;
|
|
213
|
+
}
|
|
214
|
+
suspendDepth++;
|
|
215
|
+
}
|
|
216
|
+
function resumeTracking() {
|
|
217
|
+
suspendDepth--;
|
|
218
|
+
if (suspendDepth === 0) {
|
|
219
|
+
currentSubscriber = suspendSavedSub;
|
|
220
|
+
suspendSavedSub = null;
|
|
221
|
+
trackingSuspended = false;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function isTrackingSuspended() {
|
|
225
|
+
return trackingSuspended;
|
|
226
|
+
}
|
|
227
|
+
function untracked(fn) {
|
|
228
|
+
suspendTracking();
|
|
229
|
+
try {
|
|
230
|
+
return fn();
|
|
231
|
+
} finally {
|
|
232
|
+
resumeTracking();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
206
235
|
var subscriberEpochCounter = 0;
|
|
207
236
|
function retrack(effectFn, subscriber) {
|
|
208
237
|
const prev = currentSubscriber;
|
|
@@ -312,6 +341,16 @@ function cleanup(subscriber) {
|
|
|
312
341
|
var maxSubscriberRepeats = 50;
|
|
313
342
|
var maxDrainIterations = 1e6;
|
|
314
343
|
var drainEpoch = 0;
|
|
344
|
+
function setMaxSubscriberRepeats(n) {
|
|
345
|
+
const prev = maxSubscriberRepeats;
|
|
346
|
+
if (Number.isFinite(n) && n > 0) maxSubscriberRepeats = Math.floor(n);
|
|
347
|
+
return prev;
|
|
348
|
+
}
|
|
349
|
+
function setMaxDrainIterations(n) {
|
|
350
|
+
const prev = maxDrainIterations;
|
|
351
|
+
if (Number.isFinite(n) && n > 0) maxDrainIterations = Math.floor(n);
|
|
352
|
+
return prev;
|
|
353
|
+
}
|
|
315
354
|
function tickRepeat(sub) {
|
|
316
355
|
const s = sub;
|
|
317
356
|
if (s._runEpoch !== drainEpoch) {
|
|
@@ -353,6 +392,20 @@ function drainQueue() {
|
|
|
353
392
|
safeInvoke(sub);
|
|
354
393
|
}
|
|
355
394
|
}
|
|
395
|
+
function drainNotificationQueue() {
|
|
396
|
+
if (notifyDepth > 0) return;
|
|
397
|
+
notifyDepth++;
|
|
398
|
+
drainEpoch++;
|
|
399
|
+
try {
|
|
400
|
+
drainQueue();
|
|
401
|
+
} finally {
|
|
402
|
+
notifyDepth--;
|
|
403
|
+
if (notifyDepth === 0) {
|
|
404
|
+
pendingQueue.length = 0;
|
|
405
|
+
pendingSet.clear();
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
356
409
|
function propagateDirty(sub) {
|
|
357
410
|
sub();
|
|
358
411
|
const rootSig = sub._sig;
|
|
@@ -385,6 +438,22 @@ function propagateDirty(sub) {
|
|
|
385
438
|
}
|
|
386
439
|
}
|
|
387
440
|
}
|
|
441
|
+
function queueSignalNotification(signal2) {
|
|
442
|
+
const sig = signal2;
|
|
443
|
+
let node = sig.subsHead ?? null;
|
|
444
|
+
while (node) {
|
|
445
|
+
const s = node.sub;
|
|
446
|
+
if (s) {
|
|
447
|
+
if (s._c) {
|
|
448
|
+
propagateDirty(s);
|
|
449
|
+
} else if (!pendingSet.has(s)) {
|
|
450
|
+
pendingSet.add(s);
|
|
451
|
+
pendingQueue.push(s);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
node = node.sigNext;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
388
457
|
function notifySubscribers(signal2) {
|
|
389
458
|
const sig = signal2;
|
|
390
459
|
const head = sig.subsHead;
|
|
@@ -430,6 +499,85 @@ function notifySubscribers(signal2) {
|
|
|
430
499
|
}
|
|
431
500
|
}
|
|
432
501
|
}
|
|
502
|
+
function getSubscriberCount(signal2) {
|
|
503
|
+
return signal2.__sc ?? 0;
|
|
504
|
+
}
|
|
505
|
+
function getSubscriberDeps(subscriber) {
|
|
506
|
+
const sub = subscriber;
|
|
507
|
+
const out = [];
|
|
508
|
+
let node = sub.depsHead ?? null;
|
|
509
|
+
while (node) {
|
|
510
|
+
if (node.sig) out.push(node.sig);
|
|
511
|
+
node = node.subNext;
|
|
512
|
+
}
|
|
513
|
+
return out;
|
|
514
|
+
}
|
|
515
|
+
function forEachSubscriber(signal2, visit) {
|
|
516
|
+
let node = signal2.subsHead ?? null;
|
|
517
|
+
while (node) {
|
|
518
|
+
const s = node.sub;
|
|
519
|
+
if (s) visit(s);
|
|
520
|
+
node = node.sigNext;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// src/reactivity/track.ts
|
|
525
|
+
var _isDev3 = isDev();
|
|
526
|
+
var _runtimeVersion = typeof __SIBU_VERSION__ !== "undefined" ? __SIBU_VERSION__ : "dev";
|
|
527
|
+
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
528
|
+
function resolveReactiveApi() {
|
|
529
|
+
const g = globalThis;
|
|
530
|
+
const existing = g[REGISTRY_KEY];
|
|
531
|
+
if (existing) {
|
|
532
|
+
if (_isDev3 && !existing.__dupWarned) {
|
|
533
|
+
existing.__dupWarned = true;
|
|
534
|
+
devWarn(
|
|
535
|
+
`Multiple instances of the reactive runtime detected on this page (active: ${existing.version}, duplicate: ${_runtimeVersion}). Reactivity still works \u2014 all copies share the first one \u2014 but de-duplicate sibujs in your bundler (e.g. Vite optimizeDeps.exclude: ['sibujs'] or resolve.dedupe: ['sibujs']).`
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
return existing;
|
|
539
|
+
}
|
|
540
|
+
const local = {
|
|
541
|
+
suspendTracking,
|
|
542
|
+
resumeTracking,
|
|
543
|
+
isTrackingSuspended,
|
|
544
|
+
untracked,
|
|
545
|
+
retrack,
|
|
546
|
+
track,
|
|
547
|
+
reactiveBinding,
|
|
548
|
+
recordDependency,
|
|
549
|
+
cleanup,
|
|
550
|
+
setMaxSubscriberRepeats,
|
|
551
|
+
setMaxDrainIterations,
|
|
552
|
+
drainNotificationQueue,
|
|
553
|
+
queueSignalNotification,
|
|
554
|
+
notifySubscribers,
|
|
555
|
+
getSubscriberCount,
|
|
556
|
+
getSubscriberDeps,
|
|
557
|
+
forEachSubscriber,
|
|
558
|
+
version: _runtimeVersion
|
|
559
|
+
};
|
|
560
|
+
g[REGISTRY_KEY] = local;
|
|
561
|
+
return local;
|
|
562
|
+
}
|
|
563
|
+
var API = resolveReactiveApi();
|
|
564
|
+
var suspendTracking2 = API.suspendTracking;
|
|
565
|
+
var resumeTracking2 = API.resumeTracking;
|
|
566
|
+
var isTrackingSuspended2 = API.isTrackingSuspended;
|
|
567
|
+
var untracked2 = API.untracked;
|
|
568
|
+
var retrack2 = API.retrack;
|
|
569
|
+
var track2 = API.track;
|
|
570
|
+
var reactiveBinding2 = API.reactiveBinding;
|
|
571
|
+
var recordDependency2 = API.recordDependency;
|
|
572
|
+
var cleanup2 = API.cleanup;
|
|
573
|
+
var setMaxSubscriberRepeats2 = API.setMaxSubscriberRepeats;
|
|
574
|
+
var setMaxDrainIterations2 = API.setMaxDrainIterations;
|
|
575
|
+
var drainNotificationQueue2 = API.drainNotificationQueue;
|
|
576
|
+
var queueSignalNotification2 = API.queueSignalNotification;
|
|
577
|
+
var notifySubscribers2 = API.notifySubscribers;
|
|
578
|
+
var getSubscriberCount2 = API.getSubscriberCount;
|
|
579
|
+
var getSubscriberDeps2 = API.getSubscriberDeps;
|
|
580
|
+
var forEachSubscriber2 = API.forEachSubscriber;
|
|
433
581
|
|
|
434
582
|
// src/core/signals/derived.ts
|
|
435
583
|
function derived(getter, options) {
|
|
@@ -453,7 +601,7 @@ function derived(getter, options) {
|
|
|
453
601
|
cs._d = false;
|
|
454
602
|
cs._init = true;
|
|
455
603
|
};
|
|
456
|
-
|
|
604
|
+
track2(() => {
|
|
457
605
|
let threw = true;
|
|
458
606
|
try {
|
|
459
607
|
cs._v = getter();
|
|
@@ -472,12 +620,12 @@ function derived(getter, options) {
|
|
|
472
620
|
`[SibuJS] Circular dependency detected in derived${debugName ? ` "${debugName}"` : ""}. A derived signal cannot read itself (directly or through a chain).`
|
|
473
621
|
);
|
|
474
622
|
}
|
|
475
|
-
if (
|
|
623
|
+
if (isTrackingSuspended2()) {
|
|
476
624
|
if (cs._d) {
|
|
477
625
|
const prev = cs._v;
|
|
478
626
|
evaluating = true;
|
|
479
627
|
try {
|
|
480
|
-
|
|
628
|
+
retrack2(recompute, markDirty);
|
|
481
629
|
if (!Object.is(prev, cs._v)) cs.__v++;
|
|
482
630
|
} finally {
|
|
483
631
|
evaluating = false;
|
|
@@ -485,12 +633,12 @@ function derived(getter, options) {
|
|
|
485
633
|
}
|
|
486
634
|
return cs._v;
|
|
487
635
|
}
|
|
488
|
-
|
|
636
|
+
recordDependency2(cs);
|
|
489
637
|
if (cs._d) {
|
|
490
638
|
const oldValue = cs._v;
|
|
491
639
|
evaluating = true;
|
|
492
640
|
try {
|
|
493
|
-
|
|
641
|
+
retrack2(recompute, markDirty);
|
|
494
642
|
if (!Object.is(oldValue, cs._v)) cs.__v++;
|
|
495
643
|
} finally {
|
|
496
644
|
evaluating = false;
|
|
@@ -513,15 +661,56 @@ function derived(getter, options) {
|
|
|
513
661
|
// src/reactivity/batch.ts
|
|
514
662
|
var batchDepth = 0;
|
|
515
663
|
var pendingSignals = /* @__PURE__ */ new Set();
|
|
516
|
-
function
|
|
664
|
+
function batchImpl(fn) {
|
|
665
|
+
batchDepth++;
|
|
666
|
+
try {
|
|
667
|
+
return fn();
|
|
668
|
+
} finally {
|
|
669
|
+
batchDepth--;
|
|
670
|
+
if (batchDepth === 0) {
|
|
671
|
+
flushBatch();
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
function enqueueBatchedSignalImpl(signal2) {
|
|
517
676
|
if (batchDepth === 0) return false;
|
|
518
677
|
pendingSignals.add(signal2);
|
|
519
678
|
return true;
|
|
520
679
|
}
|
|
680
|
+
function isBatchingImpl() {
|
|
681
|
+
return batchDepth > 0;
|
|
682
|
+
}
|
|
683
|
+
function flushBatch() {
|
|
684
|
+
try {
|
|
685
|
+
for (const signal2 of pendingSignals) {
|
|
686
|
+
queueSignalNotification2(signal2);
|
|
687
|
+
}
|
|
688
|
+
} finally {
|
|
689
|
+
pendingSignals.clear();
|
|
690
|
+
}
|
|
691
|
+
drainNotificationQueue2();
|
|
692
|
+
}
|
|
693
|
+
var BATCH_REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.batch.v1");
|
|
694
|
+
function resolveBatchApi() {
|
|
695
|
+
const g = globalThis;
|
|
696
|
+
const existing = g[BATCH_REGISTRY_KEY];
|
|
697
|
+
if (existing) return existing;
|
|
698
|
+
const local = {
|
|
699
|
+
batch: batchImpl,
|
|
700
|
+
enqueueBatchedSignal: enqueueBatchedSignalImpl,
|
|
701
|
+
isBatching: isBatchingImpl
|
|
702
|
+
};
|
|
703
|
+
g[BATCH_REGISTRY_KEY] = local;
|
|
704
|
+
return local;
|
|
705
|
+
}
|
|
706
|
+
var API2 = resolveBatchApi();
|
|
707
|
+
var batch = API2.batch;
|
|
708
|
+
var enqueueBatchedSignal = API2.enqueueBatchedSignal;
|
|
709
|
+
var isBatching = API2.isBatching;
|
|
521
710
|
|
|
522
711
|
// src/core/signals/signal.ts
|
|
523
712
|
var _g = globalThis;
|
|
524
|
-
var
|
|
713
|
+
var _isDev4 = isDev();
|
|
525
714
|
function signal(initial, options) {
|
|
526
715
|
const state = {
|
|
527
716
|
value: initial,
|
|
@@ -532,11 +721,11 @@ function signal(initial, options) {
|
|
|
532
721
|
__activeNode: null,
|
|
533
722
|
__name: void 0
|
|
534
723
|
};
|
|
535
|
-
const debugName =
|
|
724
|
+
const debugName = _isDev4 ? options?.name : void 0;
|
|
536
725
|
const equalsFn = options?.equals;
|
|
537
726
|
if (debugName) state.__name = debugName;
|
|
538
727
|
function get() {
|
|
539
|
-
|
|
728
|
+
recordDependency2(state);
|
|
540
729
|
return state.value;
|
|
541
730
|
}
|
|
542
731
|
get.__signal = state;
|
|
@@ -549,15 +738,15 @@ function signal(initial, options) {
|
|
|
549
738
|
if (equalsFn(prev, newValue)) return;
|
|
550
739
|
state.value = newValue;
|
|
551
740
|
state.__v++;
|
|
552
|
-
if (
|
|
741
|
+
if (_isDev4) {
|
|
553
742
|
const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
554
743
|
if (hook) hook.emit("signal:update", { signal: state, name: debugName, oldValue: prev, newValue });
|
|
555
744
|
}
|
|
556
745
|
if (!enqueueBatchedSignal(state)) {
|
|
557
|
-
|
|
746
|
+
notifySubscribers2(state);
|
|
558
747
|
}
|
|
559
748
|
};
|
|
560
|
-
} else if (
|
|
749
|
+
} else if (_isDev4) {
|
|
561
750
|
set = (next) => {
|
|
562
751
|
const prev = state.value;
|
|
563
752
|
const newValue = typeof next === "function" ? next(prev) : next;
|
|
@@ -567,7 +756,7 @@ function signal(initial, options) {
|
|
|
567
756
|
const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
568
757
|
if (hook) hook.emit("signal:update", { signal: state, name: debugName, oldValue: prev, newValue });
|
|
569
758
|
if (!enqueueBatchedSignal(state)) {
|
|
570
|
-
|
|
759
|
+
notifySubscribers2(state);
|
|
571
760
|
}
|
|
572
761
|
};
|
|
573
762
|
} else {
|
|
@@ -578,11 +767,11 @@ function signal(initial, options) {
|
|
|
578
767
|
state.value = newValue;
|
|
579
768
|
state.__v++;
|
|
580
769
|
if (!enqueueBatchedSignal(state)) {
|
|
581
|
-
|
|
770
|
+
notifySubscribers2(state);
|
|
582
771
|
}
|
|
583
772
|
};
|
|
584
773
|
}
|
|
585
|
-
if (
|
|
774
|
+
if (_isDev4) {
|
|
586
775
|
const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
587
776
|
if (hook) hook.emit("signal:create", { signal: state, name: debugName, getter: get, initial });
|
|
588
777
|
}
|
|
@@ -824,7 +1013,7 @@ function formAction(fn) {
|
|
|
824
1013
|
|
|
825
1014
|
// src/core/rendering/dispose.ts
|
|
826
1015
|
var elementDisposers = /* @__PURE__ */ new WeakMap();
|
|
827
|
-
var
|
|
1016
|
+
var _isDev5 = isDev();
|
|
828
1017
|
var activeBindingCount = 0;
|
|
829
1018
|
function registerDisposer(node, teardown) {
|
|
830
1019
|
let disposers = elementDisposers.get(node);
|
|
@@ -833,7 +1022,7 @@ function registerDisposer(node, teardown) {
|
|
|
833
1022
|
elementDisposers.set(node, disposers);
|
|
834
1023
|
}
|
|
835
1024
|
disposers.push(teardown);
|
|
836
|
-
if (
|
|
1025
|
+
if (_isDev5) activeBindingCount++;
|
|
837
1026
|
}
|
|
838
1027
|
function dispose(node) {
|
|
839
1028
|
const stack = [node];
|
|
@@ -852,12 +1041,12 @@ function dispose(node) {
|
|
|
852
1041
|
if (disposers) {
|
|
853
1042
|
const snapshot = disposers.slice();
|
|
854
1043
|
elementDisposers.delete(current);
|
|
855
|
-
if (
|
|
1044
|
+
if (_isDev5) activeBindingCount -= snapshot.length;
|
|
856
1045
|
for (const d of snapshot) {
|
|
857
1046
|
try {
|
|
858
1047
|
d();
|
|
859
1048
|
} catch (err) {
|
|
860
|
-
if (
|
|
1049
|
+
if (_isDev5 && typeof console !== "undefined") {
|
|
861
1050
|
console.warn("[SibuJS] Disposer threw during cleanup:", err);
|
|
862
1051
|
}
|
|
863
1052
|
}
|
|
@@ -868,12 +1057,12 @@ function dispose(node) {
|
|
|
868
1057
|
if (!added || added.length === 0) break;
|
|
869
1058
|
const moreSnapshot = added.slice();
|
|
870
1059
|
elementDisposers.delete(current);
|
|
871
|
-
if (
|
|
1060
|
+
if (_isDev5) activeBindingCount -= moreSnapshot.length;
|
|
872
1061
|
for (const d of moreSnapshot) {
|
|
873
1062
|
try {
|
|
874
1063
|
d();
|
|
875
1064
|
} catch (err) {
|
|
876
|
-
if (
|
|
1065
|
+
if (_isDev5 && typeof console !== "undefined") {
|
|
877
1066
|
console.warn("[SibuJS] Disposer threw during cleanup:", err);
|
|
878
1067
|
}
|
|
879
1068
|
}
|
|
@@ -932,7 +1121,7 @@ function drainReruns(ctx) {
|
|
|
932
1121
|
do {
|
|
933
1122
|
ctx.rerunPending = false;
|
|
934
1123
|
if (ctx.userCleanups.length > 0) flushUserCleanups(ctx);
|
|
935
|
-
|
|
1124
|
+
retrack2(ctx.bodyFn, ctx.subscriber);
|
|
936
1125
|
} while (ctx.rerunPending && ++reruns <= MAX_RERUNS);
|
|
937
1126
|
if (ctx.rerunPending) {
|
|
938
1127
|
ctx.rerunPending = false;
|
|
@@ -961,7 +1150,7 @@ function disposeEffect(ctx) {
|
|
|
961
1150
|
}
|
|
962
1151
|
}
|
|
963
1152
|
try {
|
|
964
|
-
|
|
1153
|
+
cleanup2(ctx.subscriber);
|
|
965
1154
|
} catch (err) {
|
|
966
1155
|
if (typeof console !== "undefined") {
|
|
967
1156
|
console.warn("[SibuJS effect] dispose threw:", err);
|
|
@@ -1006,7 +1195,7 @@ function effect(effectFn, options) {
|
|
|
1006
1195
|
try {
|
|
1007
1196
|
ctx.rerunPending = false;
|
|
1008
1197
|
if (ctx.userCleanups.length > 0) flushUserCleanups(ctx);
|
|
1009
|
-
|
|
1198
|
+
retrack2(ctx.bodyFn, sub);
|
|
1010
1199
|
if (ctx.rerunPending) drainReruns(ctx);
|
|
1011
1200
|
} finally {
|
|
1012
1201
|
ctx.running = false;
|
|
@@ -1022,7 +1211,7 @@ function effect(effectFn, options) {
|
|
|
1022
1211
|
ctx.subscriber = sub;
|
|
1023
1212
|
ctx.running = true;
|
|
1024
1213
|
try {
|
|
1025
|
-
|
|
1214
|
+
retrack2(ctx.bodyFn, ctx.subscriber);
|
|
1026
1215
|
if (ctx.rerunPending) drainReruns(ctx);
|
|
1027
1216
|
} finally {
|
|
1028
1217
|
ctx.running = false;
|
|
@@ -1261,7 +1450,7 @@ function aria(element, attrs) {
|
|
|
1261
1450
|
const getter = value;
|
|
1262
1451
|
registerDisposer(
|
|
1263
1452
|
element,
|
|
1264
|
-
|
|
1453
|
+
track2(() => {
|
|
1265
1454
|
element.setAttribute(ariaKey, String(getter()));
|
|
1266
1455
|
})
|
|
1267
1456
|
);
|
|
@@ -1782,13 +1971,13 @@ function sanitizeAttributeString(attr, value) {
|
|
|
1782
1971
|
}
|
|
1783
1972
|
|
|
1784
1973
|
// src/reactivity/bindAttribute.ts
|
|
1785
|
-
var
|
|
1974
|
+
var _isDev6 = isDev();
|
|
1786
1975
|
function setProp(el, key, val) {
|
|
1787
1976
|
el[key] = val;
|
|
1788
1977
|
}
|
|
1789
1978
|
function bindAttribute(el, attr, getter) {
|
|
1790
1979
|
if (isEventHandlerAttr(attr)) {
|
|
1791
|
-
if (
|
|
1980
|
+
if (_isDev6)
|
|
1792
1981
|
devWarn(
|
|
1793
1982
|
`bindAttribute: refusing to bind event-handler attribute "${attr}". Use on:{ ${attr.slice(2)}: fn } instead.`
|
|
1794
1983
|
);
|
|
@@ -1800,7 +1989,7 @@ function bindAttribute(el, attr, getter) {
|
|
|
1800
1989
|
try {
|
|
1801
1990
|
value = getter();
|
|
1802
1991
|
} catch (err) {
|
|
1803
|
-
if (
|
|
1992
|
+
if (_isDev6)
|
|
1804
1993
|
devWarn(`bindAttribute: getter for "${attr}" threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
1805
1994
|
return;
|
|
1806
1995
|
}
|
|
@@ -1821,7 +2010,7 @@ function bindAttribute(el, attr, getter) {
|
|
|
1821
2010
|
el.setAttribute(attr, sanitizeAttributeString(attr, str));
|
|
1822
2011
|
}
|
|
1823
2012
|
}
|
|
1824
|
-
return
|
|
2013
|
+
return reactiveBinding2(commit);
|
|
1825
2014
|
}
|
|
1826
2015
|
|
|
1827
2016
|
// src/ui/reactiveAttr.ts
|
|
@@ -1871,7 +2060,7 @@ function bindBoolAttr(el, attr, getter) {
|
|
|
1871
2060
|
el.removeAttribute(attr);
|
|
1872
2061
|
}
|
|
1873
2062
|
}
|
|
1874
|
-
const teardown =
|
|
2063
|
+
const teardown = track2(commit);
|
|
1875
2064
|
return teardown;
|
|
1876
2065
|
}
|
|
1877
2066
|
function bindData(el, key, getter) {
|
package/dist/ui.js
CHANGED
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
toast,
|
|
39
39
|
withScopedStyle,
|
|
40
40
|
zipMask
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-RYMOSG5B.js";
|
|
42
42
|
import {
|
|
43
43
|
RenderProp,
|
|
44
44
|
assertType,
|
|
@@ -58,20 +58,20 @@ import {
|
|
|
58
58
|
import {
|
|
59
59
|
createId
|
|
60
60
|
} from "./chunk-YT6HQ6AM.js";
|
|
61
|
-
import "./chunk-
|
|
62
|
-
import "./chunk-
|
|
61
|
+
import "./chunk-NHKQKKZU.js";
|
|
62
|
+
import "./chunk-WW6DAGGR.js";
|
|
63
63
|
import {
|
|
64
64
|
registerDisposer
|
|
65
65
|
} from "./chunk-5VGSK6D2.js";
|
|
66
66
|
import "./chunk-L3GAGWCC.js";
|
|
67
67
|
import {
|
|
68
68
|
effect
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-MHBCEJQO.js";
|
|
70
70
|
import "./chunk-GOJMFRBL.js";
|
|
71
71
|
import {
|
|
72
72
|
signal
|
|
73
|
-
} from "./chunk-
|
|
74
|
-
import "./chunk-
|
|
73
|
+
} from "./chunk-WZG2SZOT.js";
|
|
74
|
+
import "./chunk-TEFZT5PJ.js";
|
|
75
75
|
import "./chunk-COY6PUD2.js";
|
|
76
76
|
|
|
77
77
|
// src/ui/formAction.ts
|