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/performance.cjs
CHANGED
|
@@ -238,7 +238,7 @@ function devWarn(message) {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
// src/reactivity/track.ts
|
|
241
|
+
// src/reactivity/track-core.ts
|
|
242
242
|
var _isDev2 = isDev();
|
|
243
243
|
var POOL_MAX = 4096;
|
|
244
244
|
var nodePool = [];
|
|
@@ -322,6 +322,7 @@ function unlinkSub(node) {
|
|
|
322
322
|
else sub.depsTail = prev;
|
|
323
323
|
}
|
|
324
324
|
var currentSubscriber = null;
|
|
325
|
+
var suspendSavedSub = null;
|
|
325
326
|
var notifyDepth = 0;
|
|
326
327
|
var pendingQueue = [];
|
|
327
328
|
var pendingSet = /* @__PURE__ */ new Set();
|
|
@@ -333,6 +334,35 @@ function safeInvoke(sub) {
|
|
|
333
334
|
if (_isDev2) devWarn(`Subscriber threw during notification: ${err instanceof Error ? err.message : String(err)}`);
|
|
334
335
|
}
|
|
335
336
|
}
|
|
337
|
+
var suspendDepth = 0;
|
|
338
|
+
var trackingSuspended = false;
|
|
339
|
+
function suspendTracking() {
|
|
340
|
+
if (suspendDepth === 0) {
|
|
341
|
+
suspendSavedSub = currentSubscriber;
|
|
342
|
+
currentSubscriber = null;
|
|
343
|
+
trackingSuspended = true;
|
|
344
|
+
}
|
|
345
|
+
suspendDepth++;
|
|
346
|
+
}
|
|
347
|
+
function resumeTracking() {
|
|
348
|
+
suspendDepth--;
|
|
349
|
+
if (suspendDepth === 0) {
|
|
350
|
+
currentSubscriber = suspendSavedSub;
|
|
351
|
+
suspendSavedSub = null;
|
|
352
|
+
trackingSuspended = false;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
function isTrackingSuspended() {
|
|
356
|
+
return trackingSuspended;
|
|
357
|
+
}
|
|
358
|
+
function untracked(fn) {
|
|
359
|
+
suspendTracking();
|
|
360
|
+
try {
|
|
361
|
+
return fn();
|
|
362
|
+
} finally {
|
|
363
|
+
resumeTracking();
|
|
364
|
+
}
|
|
365
|
+
}
|
|
336
366
|
var subscriberEpochCounter = 0;
|
|
337
367
|
function retrack(effectFn, subscriber) {
|
|
338
368
|
const prev = currentSubscriber;
|
|
@@ -365,6 +395,51 @@ function retrack(effectFn, subscriber) {
|
|
|
365
395
|
}
|
|
366
396
|
}
|
|
367
397
|
}
|
|
398
|
+
function track(effectFn, subscriber) {
|
|
399
|
+
if (!subscriber) return reactiveBinding(effectFn);
|
|
400
|
+
cleanup(subscriber);
|
|
401
|
+
const prev = currentSubscriber;
|
|
402
|
+
currentSubscriber = subscriber;
|
|
403
|
+
try {
|
|
404
|
+
effectFn();
|
|
405
|
+
} finally {
|
|
406
|
+
currentSubscriber = prev;
|
|
407
|
+
const sub2 = subscriber;
|
|
408
|
+
for (let n = sub2.depsHead ?? null; n !== null; n = n.subNext) {
|
|
409
|
+
const sig = n.sig;
|
|
410
|
+
sig.__activeNode = n.prevActive;
|
|
411
|
+
n.prevActive = null;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
const sub = subscriber;
|
|
415
|
+
return sub._dispose ?? (sub._dispose = () => cleanup(subscriber));
|
|
416
|
+
}
|
|
417
|
+
function reactiveBinding(commit) {
|
|
418
|
+
const run = () => {
|
|
419
|
+
const s = subscriber;
|
|
420
|
+
if (s._disposed || s._reentrant) return;
|
|
421
|
+
s._reentrant = true;
|
|
422
|
+
try {
|
|
423
|
+
retrack(commit, subscriber);
|
|
424
|
+
} finally {
|
|
425
|
+
s._reentrant = false;
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
const subscriber = run;
|
|
429
|
+
subscriber.depsHead = null;
|
|
430
|
+
subscriber.depsTail = null;
|
|
431
|
+
subscriber._epoch = 0;
|
|
432
|
+
subscriber._structDirty = false;
|
|
433
|
+
subscriber._runEpoch = 0;
|
|
434
|
+
subscriber._runs = 0;
|
|
435
|
+
subscriber._reentrant = false;
|
|
436
|
+
subscriber._disposed = false;
|
|
437
|
+
run();
|
|
438
|
+
return subscriber._dispose ?? (subscriber._dispose = () => {
|
|
439
|
+
subscriber._disposed = true;
|
|
440
|
+
cleanup(subscriber);
|
|
441
|
+
});
|
|
442
|
+
}
|
|
368
443
|
function recordDependency(signal2) {
|
|
369
444
|
if (!currentSubscriber) return;
|
|
370
445
|
const sub = currentSubscriber;
|
|
@@ -397,6 +472,16 @@ function cleanup(subscriber) {
|
|
|
397
472
|
var maxSubscriberRepeats = 50;
|
|
398
473
|
var maxDrainIterations = 1e6;
|
|
399
474
|
var drainEpoch = 0;
|
|
475
|
+
function setMaxSubscriberRepeats(n) {
|
|
476
|
+
const prev = maxSubscriberRepeats;
|
|
477
|
+
if (Number.isFinite(n) && n > 0) maxSubscriberRepeats = Math.floor(n);
|
|
478
|
+
return prev;
|
|
479
|
+
}
|
|
480
|
+
function setMaxDrainIterations(n) {
|
|
481
|
+
const prev = maxDrainIterations;
|
|
482
|
+
if (Number.isFinite(n) && n > 0) maxDrainIterations = Math.floor(n);
|
|
483
|
+
return prev;
|
|
484
|
+
}
|
|
400
485
|
function tickRepeat(sub) {
|
|
401
486
|
const s = sub;
|
|
402
487
|
if (s._runEpoch !== drainEpoch) {
|
|
@@ -438,6 +523,20 @@ function drainQueue() {
|
|
|
438
523
|
safeInvoke(sub);
|
|
439
524
|
}
|
|
440
525
|
}
|
|
526
|
+
function drainNotificationQueue() {
|
|
527
|
+
if (notifyDepth > 0) return;
|
|
528
|
+
notifyDepth++;
|
|
529
|
+
drainEpoch++;
|
|
530
|
+
try {
|
|
531
|
+
drainQueue();
|
|
532
|
+
} finally {
|
|
533
|
+
notifyDepth--;
|
|
534
|
+
if (notifyDepth === 0) {
|
|
535
|
+
pendingQueue.length = 0;
|
|
536
|
+
pendingSet.clear();
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
441
540
|
function propagateDirty(sub) {
|
|
442
541
|
sub();
|
|
443
542
|
const rootSig = sub._sig;
|
|
@@ -470,6 +569,22 @@ function propagateDirty(sub) {
|
|
|
470
569
|
}
|
|
471
570
|
}
|
|
472
571
|
}
|
|
572
|
+
function queueSignalNotification(signal2) {
|
|
573
|
+
const sig = signal2;
|
|
574
|
+
let node = sig.subsHead ?? null;
|
|
575
|
+
while (node) {
|
|
576
|
+
const s = node.sub;
|
|
577
|
+
if (s) {
|
|
578
|
+
if (s._c) {
|
|
579
|
+
propagateDirty(s);
|
|
580
|
+
} else if (!pendingSet.has(s)) {
|
|
581
|
+
pendingSet.add(s);
|
|
582
|
+
pendingQueue.push(s);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
node = node.sigNext;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
473
588
|
function notifySubscribers(signal2) {
|
|
474
589
|
const sig = signal2;
|
|
475
590
|
const head = sig.subsHead;
|
|
@@ -515,6 +630,85 @@ function notifySubscribers(signal2) {
|
|
|
515
630
|
}
|
|
516
631
|
}
|
|
517
632
|
}
|
|
633
|
+
function getSubscriberCount(signal2) {
|
|
634
|
+
return signal2.__sc ?? 0;
|
|
635
|
+
}
|
|
636
|
+
function getSubscriberDeps(subscriber) {
|
|
637
|
+
const sub = subscriber;
|
|
638
|
+
const out = [];
|
|
639
|
+
let node = sub.depsHead ?? null;
|
|
640
|
+
while (node) {
|
|
641
|
+
if (node.sig) out.push(node.sig);
|
|
642
|
+
node = node.subNext;
|
|
643
|
+
}
|
|
644
|
+
return out;
|
|
645
|
+
}
|
|
646
|
+
function forEachSubscriber(signal2, visit) {
|
|
647
|
+
let node = signal2.subsHead ?? null;
|
|
648
|
+
while (node) {
|
|
649
|
+
const s = node.sub;
|
|
650
|
+
if (s) visit(s);
|
|
651
|
+
node = node.sigNext;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
// src/reactivity/track.ts
|
|
656
|
+
var _isDev3 = isDev();
|
|
657
|
+
var _runtimeVersion = typeof __SIBU_VERSION__ !== "undefined" ? __SIBU_VERSION__ : "dev";
|
|
658
|
+
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
659
|
+
function resolveReactiveApi() {
|
|
660
|
+
const g = globalThis;
|
|
661
|
+
const existing = g[REGISTRY_KEY];
|
|
662
|
+
if (existing) {
|
|
663
|
+
if (_isDev3 && !existing.__dupWarned) {
|
|
664
|
+
existing.__dupWarned = true;
|
|
665
|
+
devWarn(
|
|
666
|
+
`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']).`
|
|
667
|
+
);
|
|
668
|
+
}
|
|
669
|
+
return existing;
|
|
670
|
+
}
|
|
671
|
+
const local = {
|
|
672
|
+
suspendTracking,
|
|
673
|
+
resumeTracking,
|
|
674
|
+
isTrackingSuspended,
|
|
675
|
+
untracked,
|
|
676
|
+
retrack,
|
|
677
|
+
track,
|
|
678
|
+
reactiveBinding,
|
|
679
|
+
recordDependency,
|
|
680
|
+
cleanup,
|
|
681
|
+
setMaxSubscriberRepeats,
|
|
682
|
+
setMaxDrainIterations,
|
|
683
|
+
drainNotificationQueue,
|
|
684
|
+
queueSignalNotification,
|
|
685
|
+
notifySubscribers,
|
|
686
|
+
getSubscriberCount,
|
|
687
|
+
getSubscriberDeps,
|
|
688
|
+
forEachSubscriber,
|
|
689
|
+
version: _runtimeVersion
|
|
690
|
+
};
|
|
691
|
+
g[REGISTRY_KEY] = local;
|
|
692
|
+
return local;
|
|
693
|
+
}
|
|
694
|
+
var API = resolveReactiveApi();
|
|
695
|
+
var suspendTracking2 = API.suspendTracking;
|
|
696
|
+
var resumeTracking2 = API.resumeTracking;
|
|
697
|
+
var isTrackingSuspended2 = API.isTrackingSuspended;
|
|
698
|
+
var untracked2 = API.untracked;
|
|
699
|
+
var retrack2 = API.retrack;
|
|
700
|
+
var track2 = API.track;
|
|
701
|
+
var reactiveBinding2 = API.reactiveBinding;
|
|
702
|
+
var recordDependency2 = API.recordDependency;
|
|
703
|
+
var cleanup2 = API.cleanup;
|
|
704
|
+
var setMaxSubscriberRepeats2 = API.setMaxSubscriberRepeats;
|
|
705
|
+
var setMaxDrainIterations2 = API.setMaxDrainIterations;
|
|
706
|
+
var drainNotificationQueue2 = API.drainNotificationQueue;
|
|
707
|
+
var queueSignalNotification2 = API.queueSignalNotification;
|
|
708
|
+
var notifySubscribers2 = API.notifySubscribers;
|
|
709
|
+
var getSubscriberCount2 = API.getSubscriberCount;
|
|
710
|
+
var getSubscriberDeps2 = API.getSubscriberDeps;
|
|
711
|
+
var forEachSubscriber2 = API.forEachSubscriber;
|
|
518
712
|
|
|
519
713
|
// src/core/ssr-context.ts
|
|
520
714
|
var als = null;
|
|
@@ -565,7 +759,7 @@ function drainReruns(ctx) {
|
|
|
565
759
|
do {
|
|
566
760
|
ctx.rerunPending = false;
|
|
567
761
|
if (ctx.userCleanups.length > 0) flushUserCleanups(ctx);
|
|
568
|
-
|
|
762
|
+
retrack2(ctx.bodyFn, ctx.subscriber);
|
|
569
763
|
} while (ctx.rerunPending && ++reruns <= MAX_RERUNS);
|
|
570
764
|
if (ctx.rerunPending) {
|
|
571
765
|
ctx.rerunPending = false;
|
|
@@ -594,7 +788,7 @@ function disposeEffect(ctx) {
|
|
|
594
788
|
}
|
|
595
789
|
}
|
|
596
790
|
try {
|
|
597
|
-
|
|
791
|
+
cleanup2(ctx.subscriber);
|
|
598
792
|
} catch (err) {
|
|
599
793
|
if (typeof console !== "undefined") {
|
|
600
794
|
console.warn("[SibuJS effect] dispose threw:", err);
|
|
@@ -639,7 +833,7 @@ function effect(effectFn, options) {
|
|
|
639
833
|
try {
|
|
640
834
|
ctx.rerunPending = false;
|
|
641
835
|
if (ctx.userCleanups.length > 0) flushUserCleanups(ctx);
|
|
642
|
-
|
|
836
|
+
retrack2(ctx.bodyFn, sub);
|
|
643
837
|
if (ctx.rerunPending) drainReruns(ctx);
|
|
644
838
|
} finally {
|
|
645
839
|
ctx.running = false;
|
|
@@ -655,7 +849,7 @@ function effect(effectFn, options) {
|
|
|
655
849
|
ctx.subscriber = sub;
|
|
656
850
|
ctx.running = true;
|
|
657
851
|
try {
|
|
658
|
-
|
|
852
|
+
retrack2(ctx.bodyFn, ctx.subscriber);
|
|
659
853
|
if (ctx.rerunPending) drainReruns(ctx);
|
|
660
854
|
} finally {
|
|
661
855
|
ctx.running = false;
|
|
@@ -669,15 +863,56 @@ function effect(effectFn, options) {
|
|
|
669
863
|
// src/reactivity/batch.ts
|
|
670
864
|
var batchDepth = 0;
|
|
671
865
|
var pendingSignals = /* @__PURE__ */ new Set();
|
|
672
|
-
function
|
|
866
|
+
function batchImpl(fn) {
|
|
867
|
+
batchDepth++;
|
|
868
|
+
try {
|
|
869
|
+
return fn();
|
|
870
|
+
} finally {
|
|
871
|
+
batchDepth--;
|
|
872
|
+
if (batchDepth === 0) {
|
|
873
|
+
flushBatch();
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
function enqueueBatchedSignalImpl(signal2) {
|
|
673
878
|
if (batchDepth === 0) return false;
|
|
674
879
|
pendingSignals.add(signal2);
|
|
675
880
|
return true;
|
|
676
881
|
}
|
|
882
|
+
function isBatchingImpl() {
|
|
883
|
+
return batchDepth > 0;
|
|
884
|
+
}
|
|
885
|
+
function flushBatch() {
|
|
886
|
+
try {
|
|
887
|
+
for (const signal2 of pendingSignals) {
|
|
888
|
+
queueSignalNotification2(signal2);
|
|
889
|
+
}
|
|
890
|
+
} finally {
|
|
891
|
+
pendingSignals.clear();
|
|
892
|
+
}
|
|
893
|
+
drainNotificationQueue2();
|
|
894
|
+
}
|
|
895
|
+
var BATCH_REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.batch.v1");
|
|
896
|
+
function resolveBatchApi() {
|
|
897
|
+
const g = globalThis;
|
|
898
|
+
const existing = g[BATCH_REGISTRY_KEY];
|
|
899
|
+
if (existing) return existing;
|
|
900
|
+
const local = {
|
|
901
|
+
batch: batchImpl,
|
|
902
|
+
enqueueBatchedSignal: enqueueBatchedSignalImpl,
|
|
903
|
+
isBatching: isBatchingImpl
|
|
904
|
+
};
|
|
905
|
+
g[BATCH_REGISTRY_KEY] = local;
|
|
906
|
+
return local;
|
|
907
|
+
}
|
|
908
|
+
var API2 = resolveBatchApi();
|
|
909
|
+
var batch = API2.batch;
|
|
910
|
+
var enqueueBatchedSignal = API2.enqueueBatchedSignal;
|
|
911
|
+
var isBatching = API2.isBatching;
|
|
677
912
|
|
|
678
913
|
// src/core/signals/signal.ts
|
|
679
914
|
var _g2 = globalThis;
|
|
680
|
-
var
|
|
915
|
+
var _isDev4 = isDev();
|
|
681
916
|
function signal(initial, options) {
|
|
682
917
|
const state = {
|
|
683
918
|
value: initial,
|
|
@@ -688,11 +923,11 @@ function signal(initial, options) {
|
|
|
688
923
|
__activeNode: null,
|
|
689
924
|
__name: void 0
|
|
690
925
|
};
|
|
691
|
-
const debugName =
|
|
926
|
+
const debugName = _isDev4 ? options?.name : void 0;
|
|
692
927
|
const equalsFn = options?.equals;
|
|
693
928
|
if (debugName) state.__name = debugName;
|
|
694
929
|
function get() {
|
|
695
|
-
|
|
930
|
+
recordDependency2(state);
|
|
696
931
|
return state.value;
|
|
697
932
|
}
|
|
698
933
|
get.__signal = state;
|
|
@@ -705,15 +940,15 @@ function signal(initial, options) {
|
|
|
705
940
|
if (equalsFn(prev, newValue)) return;
|
|
706
941
|
state.value = newValue;
|
|
707
942
|
state.__v++;
|
|
708
|
-
if (
|
|
943
|
+
if (_isDev4) {
|
|
709
944
|
const hook = _g2.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
710
945
|
if (hook) hook.emit("signal:update", { signal: state, name: debugName, oldValue: prev, newValue });
|
|
711
946
|
}
|
|
712
947
|
if (!enqueueBatchedSignal(state)) {
|
|
713
|
-
|
|
948
|
+
notifySubscribers2(state);
|
|
714
949
|
}
|
|
715
950
|
};
|
|
716
|
-
} else if (
|
|
951
|
+
} else if (_isDev4) {
|
|
717
952
|
set = (next) => {
|
|
718
953
|
const prev = state.value;
|
|
719
954
|
const newValue = typeof next === "function" ? next(prev) : next;
|
|
@@ -723,7 +958,7 @@ function signal(initial, options) {
|
|
|
723
958
|
const hook = _g2.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
724
959
|
if (hook) hook.emit("signal:update", { signal: state, name: debugName, oldValue: prev, newValue });
|
|
725
960
|
if (!enqueueBatchedSignal(state)) {
|
|
726
|
-
|
|
961
|
+
notifySubscribers2(state);
|
|
727
962
|
}
|
|
728
963
|
};
|
|
729
964
|
} else {
|
|
@@ -734,11 +969,11 @@ function signal(initial, options) {
|
|
|
734
969
|
state.value = newValue;
|
|
735
970
|
state.__v++;
|
|
736
971
|
if (!enqueueBatchedSignal(state)) {
|
|
737
|
-
|
|
972
|
+
notifySubscribers2(state);
|
|
738
973
|
}
|
|
739
974
|
};
|
|
740
975
|
}
|
|
741
|
-
if (
|
|
976
|
+
if (_isDev4) {
|
|
742
977
|
const hook = _g2.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
743
978
|
if (hook) hook.emit("signal:create", { signal: state, name: debugName, getter: get, initial });
|
|
744
979
|
}
|
|
@@ -810,7 +1045,7 @@ function sanitizeUrl(url) {
|
|
|
810
1045
|
}
|
|
811
1046
|
|
|
812
1047
|
// src/performance/domRecycler.ts
|
|
813
|
-
var
|
|
1048
|
+
var _isDev5 = isDev();
|
|
814
1049
|
var DOMPool = class {
|
|
815
1050
|
constructor(maxSize = 50) {
|
|
816
1051
|
this.pools = /* @__PURE__ */ new Map();
|
|
@@ -837,7 +1072,7 @@ var DOMPool = class {
|
|
|
837
1072
|
* is almost certainly a bug.
|
|
838
1073
|
*/
|
|
839
1074
|
release(element) {
|
|
840
|
-
if (
|
|
1075
|
+
if (_isDev5 && element.isConnected) {
|
|
841
1076
|
devWarn(
|
|
842
1077
|
"DOMPool.release() called on a still-connected element. Detach it from the DOM first (remove() / dispose())."
|
|
843
1078
|
);
|
|
@@ -949,7 +1184,7 @@ function noSideEffect(fn) {
|
|
|
949
1184
|
}
|
|
950
1185
|
|
|
951
1186
|
// src/platform/ssr.ts
|
|
952
|
-
var
|
|
1187
|
+
var _isDev6 = isDev();
|
|
953
1188
|
function trustHTML(html) {
|
|
954
1189
|
return html;
|
|
955
1190
|
}
|
|
@@ -1108,7 +1343,7 @@ function denormalize(id, entities, schema) {
|
|
|
1108
1343
|
|
|
1109
1344
|
// src/core/rendering/dispose.ts
|
|
1110
1345
|
var elementDisposers = /* @__PURE__ */ new WeakMap();
|
|
1111
|
-
var
|
|
1346
|
+
var _isDev7 = isDev();
|
|
1112
1347
|
var activeBindingCount = 0;
|
|
1113
1348
|
function dispose(node) {
|
|
1114
1349
|
const stack = [node];
|
|
@@ -1127,12 +1362,12 @@ function dispose(node) {
|
|
|
1127
1362
|
if (disposers) {
|
|
1128
1363
|
const snapshot = disposers.slice();
|
|
1129
1364
|
elementDisposers.delete(current);
|
|
1130
|
-
if (
|
|
1365
|
+
if (_isDev7) activeBindingCount -= snapshot.length;
|
|
1131
1366
|
for (const d of snapshot) {
|
|
1132
1367
|
try {
|
|
1133
1368
|
d();
|
|
1134
1369
|
} catch (err) {
|
|
1135
|
-
if (
|
|
1370
|
+
if (_isDev7 && typeof console !== "undefined") {
|
|
1136
1371
|
console.warn("[SibuJS] Disposer threw during cleanup:", err);
|
|
1137
1372
|
}
|
|
1138
1373
|
}
|
|
@@ -1143,12 +1378,12 @@ function dispose(node) {
|
|
|
1143
1378
|
if (!added || added.length === 0) break;
|
|
1144
1379
|
const moreSnapshot = added.slice();
|
|
1145
1380
|
elementDisposers.delete(current);
|
|
1146
|
-
if (
|
|
1381
|
+
if (_isDev7) activeBindingCount -= moreSnapshot.length;
|
|
1147
1382
|
for (const d of moreSnapshot) {
|
|
1148
1383
|
try {
|
|
1149
1384
|
d();
|
|
1150
1385
|
} catch (err) {
|
|
1151
|
-
if (
|
|
1386
|
+
if (_isDev7 && typeof console !== "undefined") {
|
|
1152
1387
|
console.warn("[SibuJS] Disposer threw during cleanup:", err);
|
|
1153
1388
|
}
|
|
1154
1389
|
}
|
package/dist/performance.js
CHANGED
|
@@ -33,16 +33,16 @@ import {
|
|
|
33
33
|
transitionState,
|
|
34
34
|
uniqueId,
|
|
35
35
|
yieldToMain
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-M5KBNOSJ.js";
|
|
37
37
|
import {
|
|
38
38
|
trustHTML
|
|
39
39
|
} from "./chunk-R3QEDXFS.js";
|
|
40
40
|
import "./chunk-5VGSK6D2.js";
|
|
41
41
|
import "./chunk-L3GAGWCC.js";
|
|
42
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-MHBCEJQO.js";
|
|
43
43
|
import "./chunk-GOJMFRBL.js";
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-WZG2SZOT.js";
|
|
45
|
+
import "./chunk-TEFZT5PJ.js";
|
|
46
46
|
import "./chunk-COY6PUD2.js";
|
|
47
47
|
export {
|
|
48
48
|
DOMPool,
|