sibujs 3.3.0 → 3.3.2
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 +230 -40
- package/dist/browser.js +5 -5
- package/dist/build.cjs +240 -108
- package/dist/build.js +13 -13
- package/dist/cdn.global.js +7 -7
- package/dist/{chunk-BEIKESVL.js → chunk-2ARSB7NG.js} +36 -13
- package/dist/{chunk-X3NHE2DK.js → chunk-4NJEAPLI.js} +83 -17
- package/dist/{chunk-JBXNCZSC.js → chunk-5VH3GIDX.js} +1 -1
- package/dist/{chunk-6G6UNHZI.js → chunk-62V653X2.js} +16 -21
- package/dist/{chunk-S4FHR5ZZ.js → chunk-655B7MMR.js} +3 -3
- package/dist/{chunk-24DBWDTK.js → chunk-6TCOWMGY.js} +1 -1
- package/dist/{chunk-USDR2GFV.js → chunk-A7CZH3GN.js} +3 -3
- package/dist/{chunk-SLCUP2EK.js → chunk-AEOLHSSQ.js} +3 -3
- package/dist/chunk-CCSJMTRN.js +15 -0
- package/dist/{chunk-R3QEDXFS.js → chunk-EX77FXTT.js} +1 -1
- package/dist/{chunk-ZUVLC7TM.js → chunk-FJIRS3FM.js} +1 -1
- package/dist/{chunk-4WXWJ4SW.js → chunk-FJO2ZL4Q.js} +4 -4
- package/dist/{chunk-CVMMULHO.js → chunk-G6N3LMO2.js} +4 -4
- package/dist/{chunk-XQ7XSGYP.js → chunk-IQJ36UTJ.js} +1 -1
- package/dist/{chunk-5K72I3UQ.js → chunk-JCQG2I2G.js} +21 -4
- package/dist/{chunk-7JHWAGRQ.js → chunk-N5TQVEKE.js} +2 -2
- package/dist/{chunk-IHBVTURX.js → chunk-P7C7SEJV.js} +4 -4
- package/dist/{chunk-M6WSIGYW.js → chunk-Q46YIQYW.js} +2 -2
- package/dist/{chunk-Q2ERM6NT.js → chunk-QCFBIVIQ.js} +1 -1
- package/dist/{chunk-F4UM7QBJ.js → chunk-RLTFJYDN.js} +2 -2
- package/dist/{chunk-GOJMFRBL.js → chunk-S3NFJO6L.js} +20 -14
- package/dist/{chunk-MWZFOIBG.js → chunk-YUBEOWII.js} +5 -5
- package/dist/{chunk-WVJJUFPC.js → chunk-YUR5SX7F.js} +2 -2
- package/dist/{chunk-NUWKIEHE.js → chunk-ZEUP4TUD.js} +2 -2
- package/dist/data.cjs +181 -37
- package/dist/data.js +7 -7
- package/dist/devtools.cjs +265 -45
- package/dist/devtools.js +5 -5
- package/dist/ecosystem.cjs +203 -59
- package/dist/ecosystem.js +8 -8
- package/dist/extras.cjs +216 -116
- package/dist/extras.js +22 -22
- package/dist/index.cjs +242 -108
- package/dist/index.d.cts +78 -14
- package/dist/index.d.ts +78 -14
- package/dist/index.js +17 -13
- package/dist/motion.cjs +329 -13
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +181 -37
- package/dist/patterns.js +6 -6
- package/dist/performance.cjs +278 -37
- package/dist/performance.js +6 -6
- package/dist/plugins.cjs +353 -153
- package/dist/plugins.js +95 -94
- package/dist/{ssr-6D67RAVB.js → ssr-2PPULEK2.js} +2 -2
- package/dist/ssr.cjs +203 -58
- package/dist/ssr.js +9 -9
- package/dist/testing.cjs +416 -19
- package/dist/testing.js +3 -3
- package/dist/ui.cjs +256 -65
- package/dist/ui.js +8 -8
- package/dist/widgets.cjs +166 -40
- package/dist/widgets.js +7 -7
- package/package.json +1 -1
- package/dist/chunk-YT6HQ6AM.js +0 -14
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,25 +630,110 @@ 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 = true ? "3.3.2" : "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
|
-
var
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
714
|
+
var SSR_KEY = /* @__PURE__ */ Symbol.for("sibujs.ssr.v1");
|
|
715
|
+
function detectSSRShared() {
|
|
716
|
+
let detected = null;
|
|
717
|
+
try {
|
|
718
|
+
if (typeof process !== "undefined" && process.versions && process.versions.node) {
|
|
719
|
+
let mod = null;
|
|
720
|
+
const getBuiltin = process.getBuiltinModule;
|
|
721
|
+
if (typeof getBuiltin === "function") {
|
|
722
|
+
mod = getBuiltin("node:async_hooks");
|
|
723
|
+
} else {
|
|
724
|
+
const req = Function("return typeof require==='function'?require:null")();
|
|
725
|
+
if (req) mod = req("node:async_hooks");
|
|
726
|
+
}
|
|
727
|
+
if (mod) detected = new mod.AsyncLocalStorage();
|
|
530
728
|
}
|
|
531
|
-
|
|
729
|
+
} catch {
|
|
730
|
+
detected = null;
|
|
532
731
|
}
|
|
533
|
-
|
|
534
|
-
als = null;
|
|
732
|
+
return { als: detected, fallbackStore: { ssr: false, suspenseIdCounter: 0 } };
|
|
535
733
|
}
|
|
536
|
-
var
|
|
734
|
+
var _shared = globalThis[SSR_KEY] ?? (globalThis[SSR_KEY] = detectSSRShared());
|
|
735
|
+
var als = _shared.als;
|
|
736
|
+
var fallbackStore = _shared.fallbackStore;
|
|
537
737
|
function getSSRStore() {
|
|
538
738
|
if (als) {
|
|
539
739
|
const s = als.getStore();
|
|
@@ -565,7 +765,7 @@ function drainReruns(ctx) {
|
|
|
565
765
|
do {
|
|
566
766
|
ctx.rerunPending = false;
|
|
567
767
|
if (ctx.userCleanups.length > 0) flushUserCleanups(ctx);
|
|
568
|
-
|
|
768
|
+
retrack2(ctx.bodyFn, ctx.subscriber);
|
|
569
769
|
} while (ctx.rerunPending && ++reruns <= MAX_RERUNS);
|
|
570
770
|
if (ctx.rerunPending) {
|
|
571
771
|
ctx.rerunPending = false;
|
|
@@ -594,7 +794,7 @@ function disposeEffect(ctx) {
|
|
|
594
794
|
}
|
|
595
795
|
}
|
|
596
796
|
try {
|
|
597
|
-
|
|
797
|
+
cleanup2(ctx.subscriber);
|
|
598
798
|
} catch (err) {
|
|
599
799
|
if (typeof console !== "undefined") {
|
|
600
800
|
console.warn("[SibuJS effect] dispose threw:", err);
|
|
@@ -639,7 +839,7 @@ function effect(effectFn, options) {
|
|
|
639
839
|
try {
|
|
640
840
|
ctx.rerunPending = false;
|
|
641
841
|
if (ctx.userCleanups.length > 0) flushUserCleanups(ctx);
|
|
642
|
-
|
|
842
|
+
retrack2(ctx.bodyFn, sub);
|
|
643
843
|
if (ctx.rerunPending) drainReruns(ctx);
|
|
644
844
|
} finally {
|
|
645
845
|
ctx.running = false;
|
|
@@ -655,7 +855,7 @@ function effect(effectFn, options) {
|
|
|
655
855
|
ctx.subscriber = sub;
|
|
656
856
|
ctx.running = true;
|
|
657
857
|
try {
|
|
658
|
-
|
|
858
|
+
retrack2(ctx.bodyFn, ctx.subscriber);
|
|
659
859
|
if (ctx.rerunPending) drainReruns(ctx);
|
|
660
860
|
} finally {
|
|
661
861
|
ctx.running = false;
|
|
@@ -669,15 +869,56 @@ function effect(effectFn, options) {
|
|
|
669
869
|
// src/reactivity/batch.ts
|
|
670
870
|
var batchDepth = 0;
|
|
671
871
|
var pendingSignals = /* @__PURE__ */ new Set();
|
|
672
|
-
function
|
|
872
|
+
function batchImpl(fn) {
|
|
873
|
+
batchDepth++;
|
|
874
|
+
try {
|
|
875
|
+
return fn();
|
|
876
|
+
} finally {
|
|
877
|
+
batchDepth--;
|
|
878
|
+
if (batchDepth === 0) {
|
|
879
|
+
flushBatch();
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
function enqueueBatchedSignalImpl(signal2) {
|
|
673
884
|
if (batchDepth === 0) return false;
|
|
674
885
|
pendingSignals.add(signal2);
|
|
675
886
|
return true;
|
|
676
887
|
}
|
|
888
|
+
function isBatchingImpl() {
|
|
889
|
+
return batchDepth > 0;
|
|
890
|
+
}
|
|
891
|
+
function flushBatch() {
|
|
892
|
+
try {
|
|
893
|
+
for (const signal2 of pendingSignals) {
|
|
894
|
+
queueSignalNotification2(signal2);
|
|
895
|
+
}
|
|
896
|
+
} finally {
|
|
897
|
+
pendingSignals.clear();
|
|
898
|
+
}
|
|
899
|
+
drainNotificationQueue2();
|
|
900
|
+
}
|
|
901
|
+
var BATCH_REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.batch.v1");
|
|
902
|
+
function resolveBatchApi() {
|
|
903
|
+
const g = globalThis;
|
|
904
|
+
const existing = g[BATCH_REGISTRY_KEY];
|
|
905
|
+
if (existing) return existing;
|
|
906
|
+
const local = {
|
|
907
|
+
batch: batchImpl,
|
|
908
|
+
enqueueBatchedSignal: enqueueBatchedSignalImpl,
|
|
909
|
+
isBatching: isBatchingImpl
|
|
910
|
+
};
|
|
911
|
+
g[BATCH_REGISTRY_KEY] = local;
|
|
912
|
+
return local;
|
|
913
|
+
}
|
|
914
|
+
var API2 = resolveBatchApi();
|
|
915
|
+
var batch = API2.batch;
|
|
916
|
+
var enqueueBatchedSignal = API2.enqueueBatchedSignal;
|
|
917
|
+
var isBatching = API2.isBatching;
|
|
677
918
|
|
|
678
919
|
// src/core/signals/signal.ts
|
|
679
920
|
var _g2 = globalThis;
|
|
680
|
-
var
|
|
921
|
+
var _isDev4 = isDev();
|
|
681
922
|
function signal(initial, options) {
|
|
682
923
|
const state = {
|
|
683
924
|
value: initial,
|
|
@@ -688,11 +929,11 @@ function signal(initial, options) {
|
|
|
688
929
|
__activeNode: null,
|
|
689
930
|
__name: void 0
|
|
690
931
|
};
|
|
691
|
-
const debugName =
|
|
932
|
+
const debugName = _isDev4 ? options?.name : void 0;
|
|
692
933
|
const equalsFn = options?.equals;
|
|
693
934
|
if (debugName) state.__name = debugName;
|
|
694
935
|
function get() {
|
|
695
|
-
|
|
936
|
+
recordDependency2(state);
|
|
696
937
|
return state.value;
|
|
697
938
|
}
|
|
698
939
|
get.__signal = state;
|
|
@@ -705,15 +946,15 @@ function signal(initial, options) {
|
|
|
705
946
|
if (equalsFn(prev, newValue)) return;
|
|
706
947
|
state.value = newValue;
|
|
707
948
|
state.__v++;
|
|
708
|
-
if (
|
|
949
|
+
if (_isDev4) {
|
|
709
950
|
const hook = _g2.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
710
951
|
if (hook) hook.emit("signal:update", { signal: state, name: debugName, oldValue: prev, newValue });
|
|
711
952
|
}
|
|
712
953
|
if (!enqueueBatchedSignal(state)) {
|
|
713
|
-
|
|
954
|
+
notifySubscribers2(state);
|
|
714
955
|
}
|
|
715
956
|
};
|
|
716
|
-
} else if (
|
|
957
|
+
} else if (_isDev4) {
|
|
717
958
|
set = (next) => {
|
|
718
959
|
const prev = state.value;
|
|
719
960
|
const newValue = typeof next === "function" ? next(prev) : next;
|
|
@@ -723,7 +964,7 @@ function signal(initial, options) {
|
|
|
723
964
|
const hook = _g2.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
724
965
|
if (hook) hook.emit("signal:update", { signal: state, name: debugName, oldValue: prev, newValue });
|
|
725
966
|
if (!enqueueBatchedSignal(state)) {
|
|
726
|
-
|
|
967
|
+
notifySubscribers2(state);
|
|
727
968
|
}
|
|
728
969
|
};
|
|
729
970
|
} else {
|
|
@@ -734,11 +975,11 @@ function signal(initial, options) {
|
|
|
734
975
|
state.value = newValue;
|
|
735
976
|
state.__v++;
|
|
736
977
|
if (!enqueueBatchedSignal(state)) {
|
|
737
|
-
|
|
978
|
+
notifySubscribers2(state);
|
|
738
979
|
}
|
|
739
980
|
};
|
|
740
981
|
}
|
|
741
|
-
if (
|
|
982
|
+
if (_isDev4) {
|
|
742
983
|
const hook = _g2.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
743
984
|
if (hook) hook.emit("signal:create", { signal: state, name: debugName, getter: get, initial });
|
|
744
985
|
}
|
|
@@ -810,7 +1051,7 @@ function sanitizeUrl(url) {
|
|
|
810
1051
|
}
|
|
811
1052
|
|
|
812
1053
|
// src/performance/domRecycler.ts
|
|
813
|
-
var
|
|
1054
|
+
var _isDev5 = isDev();
|
|
814
1055
|
var DOMPool = class {
|
|
815
1056
|
constructor(maxSize = 50) {
|
|
816
1057
|
this.pools = /* @__PURE__ */ new Map();
|
|
@@ -837,7 +1078,7 @@ var DOMPool = class {
|
|
|
837
1078
|
* is almost certainly a bug.
|
|
838
1079
|
*/
|
|
839
1080
|
release(element) {
|
|
840
|
-
if (
|
|
1081
|
+
if (_isDev5 && element.isConnected) {
|
|
841
1082
|
devWarn(
|
|
842
1083
|
"DOMPool.release() called on a still-connected element. Detach it from the DOM first (remove() / dispose())."
|
|
843
1084
|
);
|
|
@@ -949,7 +1190,7 @@ function noSideEffect(fn) {
|
|
|
949
1190
|
}
|
|
950
1191
|
|
|
951
1192
|
// src/platform/ssr.ts
|
|
952
|
-
var
|
|
1193
|
+
var _isDev6 = isDev();
|
|
953
1194
|
function trustHTML(html) {
|
|
954
1195
|
return html;
|
|
955
1196
|
}
|
|
@@ -1108,7 +1349,7 @@ function denormalize(id, entities, schema) {
|
|
|
1108
1349
|
|
|
1109
1350
|
// src/core/rendering/dispose.ts
|
|
1110
1351
|
var elementDisposers = /* @__PURE__ */ new WeakMap();
|
|
1111
|
-
var
|
|
1352
|
+
var _isDev7 = isDev();
|
|
1112
1353
|
var activeBindingCount = 0;
|
|
1113
1354
|
function dispose(node) {
|
|
1114
1355
|
const stack = [node];
|
|
@@ -1127,12 +1368,12 @@ function dispose(node) {
|
|
|
1127
1368
|
if (disposers) {
|
|
1128
1369
|
const snapshot = disposers.slice();
|
|
1129
1370
|
elementDisposers.delete(current);
|
|
1130
|
-
if (
|
|
1371
|
+
if (_isDev7) activeBindingCount -= snapshot.length;
|
|
1131
1372
|
for (const d of snapshot) {
|
|
1132
1373
|
try {
|
|
1133
1374
|
d();
|
|
1134
1375
|
} catch (err) {
|
|
1135
|
-
if (
|
|
1376
|
+
if (_isDev7 && typeof console !== "undefined") {
|
|
1136
1377
|
console.warn("[SibuJS] Disposer threw during cleanup:", err);
|
|
1137
1378
|
}
|
|
1138
1379
|
}
|
|
@@ -1143,12 +1384,12 @@ function dispose(node) {
|
|
|
1143
1384
|
if (!added || added.length === 0) break;
|
|
1144
1385
|
const moreSnapshot = added.slice();
|
|
1145
1386
|
elementDisposers.delete(current);
|
|
1146
|
-
if (
|
|
1387
|
+
if (_isDev7) activeBindingCount -= moreSnapshot.length;
|
|
1147
1388
|
for (const d of moreSnapshot) {
|
|
1148
1389
|
try {
|
|
1149
1390
|
d();
|
|
1150
1391
|
} catch (err) {
|
|
1151
|
-
if (
|
|
1392
|
+
if (_isDev7 && typeof console !== "undefined") {
|
|
1152
1393
|
console.warn("[SibuJS] Disposer threw during cleanup:", err);
|
|
1153
1394
|
}
|
|
1154
1395
|
}
|
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-YUR5SX7F.js";
|
|
37
37
|
import {
|
|
38
38
|
trustHTML
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-EX77FXTT.js";
|
|
40
40
|
import "./chunk-5VGSK6D2.js";
|
|
41
41
|
import "./chunk-L3GAGWCC.js";
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-N5TQVEKE.js";
|
|
43
|
+
import "./chunk-S3NFJO6L.js";
|
|
44
|
+
import "./chunk-JCQG2I2G.js";
|
|
45
|
+
import "./chunk-4NJEAPLI.js";
|
|
46
46
|
import "./chunk-COY6PUD2.js";
|
|
47
47
|
export {
|
|
48
48
|
DOMPool,
|