sibujs 4.1.0 → 4.2.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.
- package/README.md +24 -0
- package/dist/browser.cjs +13 -21
- package/dist/browser.js +6 -6
- package/dist/build.cjs +278 -104
- package/dist/build.js +15 -15
- package/dist/cdn.dev.global.js +398 -0
- package/dist/cdn.global.js +10 -10
- package/dist/{chunk-DCDS2PQ6.js → chunk-2LOYNGBY.js} +2 -2
- package/dist/{chunk-VPP2FONR.js → chunk-2WLZ6757.js} +17 -10
- package/dist/{chunk-IM7N5WR4.js → chunk-3VTSPNC5.js} +2 -2
- package/dist/{chunk-TIRZCERI.js → chunk-5DXA2J44.js} +1 -1
- package/dist/{chunk-I3VI34DP.js → chunk-6ZGI3RBE.js} +149 -33
- package/dist/{chunk-D3SZ4LVS.js → chunk-7ALC7KGE.js} +5 -6
- package/dist/{chunk-PFTDGEPZ.js → chunk-7VEC3UD2.js} +3 -3
- package/dist/{chunk-KSOEJGFO.js → chunk-BMYYZWHX.js} +3 -3
- package/dist/{chunk-LOFZHP6V.js → chunk-BNKV4REK.js} +7 -8
- package/dist/{chunk-5GJ5RTHA.js → chunk-FOWBJZDL.js} +7 -8
- package/dist/{chunk-FB7KQXZI.js → chunk-GDUNQCCW.js} +4 -4
- package/dist/{chunk-UFSQEO7P.js → chunk-HECVW343.js} +7 -8
- package/dist/{chunk-SHDVWATN.js → chunk-HJEPKZ2O.js} +7 -8
- package/dist/{chunk-ANGSYNPX.js → chunk-HZEBO22J.js} +57 -37
- package/dist/{chunk-5INI7D2L.js → chunk-IXKSNWV5.js} +74 -11
- package/dist/{chunk-DAKLOMKS.js → chunk-KE4KWRDY.js} +3 -3
- package/dist/{chunk-AW6HPJ3L.js → chunk-KKLW7YWL.js} +1 -1
- package/dist/{chunk-BMSN6NWQ.js → chunk-NEYWS4EX.js} +6 -6
- package/dist/{chunk-HYCCIYNS.js → chunk-NIOYEGBQ.js} +13 -14
- package/dist/{chunk-4U7KD3RY.js → chunk-OUWAIXIK.js} +3 -3
- package/dist/{chunk-MRAMKDHQ.js → chunk-P3DHXBR6.js} +1 -1
- package/dist/{chunk-FMHIQNMP.js → chunk-QCFLDD7C.js} +5 -5
- package/dist/{chunk-DHDZ7IVN.js → chunk-QKRPLZ2V.js} +7 -8
- package/dist/{chunk-4RH6D7GR.js → chunk-QL4UREZO.js} +6 -6
- package/dist/{chunk-XIHMS2Y6.js → chunk-SF3TB4K6.js} +8 -8
- package/dist/{chunk-XSZRJW76.js → chunk-XZ2N525U.js} +6 -6
- package/dist/{customElement-CKLoO63w.d.ts → customElement-CNZxEB9G.d.cts} +77 -0
- package/dist/{customElement-CKLoO63w.d.cts → customElement-CNZxEB9G.d.ts} +77 -0
- package/dist/data.cjs +15 -24
- package/dist/data.js +9 -9
- package/dist/devtools.cjs +18 -22
- package/dist/devtools.d.cts +1 -1
- package/dist/devtools.d.ts +1 -1
- package/dist/devtools.js +8 -8
- package/dist/{dispose-4FZ6OFXR.js → dispose-46BOMMQJ.js} +2 -2
- package/dist/ecosystem.cjs +222 -67
- package/dist/ecosystem.js +11 -11
- package/dist/extras.cjs +243 -86
- package/dist/extras.d.cts +2 -2
- package/dist/extras.d.ts +2 -2
- package/dist/extras.js +25 -25
- package/dist/index.cjs +272 -98
- package/dist/index.d.cts +154 -33
- package/dist/index.d.ts +154 -33
- package/dist/index.js +15 -15
- package/dist/{introspect-RjLfIFpL.d.cts → introspect-D5xF-0Es.d.cts} +7 -0
- package/dist/{introspect-DOZfmC-4.d.ts → introspect-rSBIxEQi.d.ts} +7 -0
- package/dist/motion.cjs +13 -22
- package/dist/motion.js +5 -5
- package/dist/patterns.cjs +16 -24
- package/dist/patterns.d.cts +8 -0
- package/dist/patterns.d.ts +8 -0
- package/dist/patterns.js +7 -7
- package/dist/performance.cjs +16 -27
- package/dist/performance.js +9 -9
- package/dist/plugins.cjs +260 -86
- package/dist/plugins.d.cts +92 -0
- package/dist/plugins.d.ts +92 -0
- package/dist/plugins.js +18 -17
- package/dist/{ssr-JFP5535P.js → ssr-Y7XOEPEN.js} +5 -5
- package/dist/ssr.cjs +233 -79
- package/dist/ssr.js +12 -12
- package/dist/testing.cjs +11 -19
- package/dist/testing.js +5 -5
- package/dist/ui.cjs +98 -43
- package/dist/ui.d.cts +7 -1
- package/dist/ui.d.ts +7 -1
- package/dist/ui.js +10 -10
- package/dist/widgets.cjs +13 -21
- package/dist/widgets.d.cts +8 -0
- package/dist/widgets.d.ts +8 -0
- package/dist/widgets.js +9 -9
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -200,13 +200,37 @@ Utilities for testing components and reactivity.
|
|
|
200
200
|
### `sibujs/cdn` — Script-tag bundle
|
|
201
201
|
Self-registering IIFE build exposing `window.Sibu`, for use without a bundler.
|
|
202
202
|
|
|
203
|
+
There are two builds. Load **exactly one** — they both define `window.Sibu`, so
|
|
204
|
+
loading both leaves whichever came last in charge.
|
|
205
|
+
|
|
206
|
+
Development, with every diagnostic live:
|
|
207
|
+
|
|
208
|
+
```html
|
|
209
|
+
<script src="https://unpkg.com/sibujs@latest/dist/cdn.dev.global.js"></script>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Production, with diagnostics compiled out rather than merely disabled:
|
|
213
|
+
|
|
203
214
|
```html
|
|
204
215
|
<script src="https://unpkg.com/sibujs@latest/dist/cdn.global.js"></script>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Either way, the API is on `window.Sibu`:
|
|
219
|
+
|
|
220
|
+
```html
|
|
205
221
|
<script>
|
|
206
222
|
const { signal, effect, div, mount } = window.Sibu;
|
|
207
223
|
</script>
|
|
208
224
|
```
|
|
209
225
|
|
|
226
|
+
Develop against `cdn.dev.global.js` and swap the one line to ship. The runtime
|
|
227
|
+
behaviour is identical; only the warnings differ.
|
|
228
|
+
|
|
229
|
+
A bundled app needs neither file — import from `"sibujs"` and let your bundler
|
|
230
|
+
define `__SIBU_DEV__` per build (the Vite and webpack plugins in `sibujs/build`
|
|
231
|
+
do this for you). The two CDN files exist because a `<script>` tag has no
|
|
232
|
+
bundler to make that choice.
|
|
233
|
+
|
|
210
234
|
---
|
|
211
235
|
|
|
212
236
|
## Ecosystem
|
package/dist/browser.cjs
CHANGED
|
@@ -60,23 +60,17 @@ __export(browser_exports, {
|
|
|
60
60
|
module.exports = __toCommonJS(browser_exports);
|
|
61
61
|
|
|
62
62
|
// src/core/dev.ts
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
// this branch is unreachable here.
|
|
68
|
-
/* v8 ignore next 2 */
|
|
69
|
-
typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : typeof process !== "undefined" && process.env?.NODE_ENV !== "production"
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
var _isDev = isDev();
|
|
63
|
+
var DEV = typeof __SIBU_DEV__ !== "undefined" ? !!__SIBU_DEV__ : typeof globalThis.__SIBU_DEV__ !== "undefined" ? !!globalThis.__SIBU_DEV__ : (
|
|
64
|
+
// safe default: off in browser, on in test/dev Node
|
|
65
|
+
typeof process !== "undefined" && process.env?.NODE_ENV !== "production"
|
|
66
|
+
);
|
|
73
67
|
function devAssert(condition, message) {
|
|
74
|
-
if (
|
|
68
|
+
if ((typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : DEV) && !condition) {
|
|
75
69
|
throw new Error(`[SibuJS] ${message}`);
|
|
76
70
|
}
|
|
77
71
|
}
|
|
78
72
|
function devWarn(message) {
|
|
79
|
-
if (
|
|
73
|
+
if (typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : DEV) {
|
|
80
74
|
console.warn(`[SibuJS] ${message}`);
|
|
81
75
|
}
|
|
82
76
|
}
|
|
@@ -625,17 +619,16 @@ function forEachSubscriber(signal2, visit) {
|
|
|
625
619
|
}
|
|
626
620
|
|
|
627
621
|
// src/reactivity/track.ts
|
|
628
|
-
var
|
|
629
|
-
var _runtimeVersion = true ? "4.1.0" : "dev";
|
|
622
|
+
var _runtimeVersion = true ? "4.2.0" : "dev";
|
|
630
623
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
631
624
|
function resolveReactiveApi() {
|
|
632
625
|
const g = globalThis;
|
|
633
626
|
const existing = g[REGISTRY_KEY];
|
|
634
627
|
if (existing) {
|
|
635
|
-
if (
|
|
628
|
+
if (DEV && !existing.__dupWarned) {
|
|
636
629
|
existing.__dupWarned = true;
|
|
637
630
|
devWarn(
|
|
638
|
-
`Multiple instances of the reactive runtime detected on this page (active: ${existing.version}, duplicate: ${_runtimeVersion}). Reactivity
|
|
631
|
+
`Multiple instances of the reactive runtime detected on this page (active: ${existing.version}, duplicate: ${_runtimeVersion}). Reactivity is NOT broken and no bundler configuration is required: every copy routes through the first one via a global registry, so signal writes still reach subscribers registered by any copy. This is only a SIZE issue \u2014 the duplicate copy's bytes are downloaded and parsed for nothing. If you want them back, de-duplicate sibujs in your bundler (Vite: resolve.dedupe: ['sibujs']). Mismatched VERSIONS above are worth fixing regardless, since only the first one loaded is used.`
|
|
639
632
|
);
|
|
640
633
|
}
|
|
641
634
|
return existing;
|
|
@@ -734,7 +727,6 @@ var isBatching = API2.isBatching;
|
|
|
734
727
|
|
|
735
728
|
// src/core/signals/signal.ts
|
|
736
729
|
var _g = globalThis;
|
|
737
|
-
var _isDev3 = isDev();
|
|
738
730
|
function signal(initial, options) {
|
|
739
731
|
const state2 = {
|
|
740
732
|
value: initial,
|
|
@@ -747,7 +739,7 @@ function signal(initial, options) {
|
|
|
747
739
|
_d: false,
|
|
748
740
|
_validate: void 0
|
|
749
741
|
};
|
|
750
|
-
const debugName =
|
|
742
|
+
const debugName = DEV ? options?.name : void 0;
|
|
751
743
|
const equalsFn = options?.equals;
|
|
752
744
|
if (debugName) state2.__name = debugName;
|
|
753
745
|
function get() {
|
|
@@ -764,7 +756,7 @@ function signal(initial, options) {
|
|
|
764
756
|
if (equalsFn(prev, newValue)) return;
|
|
765
757
|
state2.value = newValue;
|
|
766
758
|
state2.__v++;
|
|
767
|
-
if (
|
|
759
|
+
if (DEV) {
|
|
768
760
|
const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
769
761
|
if (hook) hook.emit("signal:update", { signal: state2, name: debugName, oldValue: prev, newValue });
|
|
770
762
|
}
|
|
@@ -772,7 +764,7 @@ function signal(initial, options) {
|
|
|
772
764
|
notifySubscribers2(state2);
|
|
773
765
|
}
|
|
774
766
|
};
|
|
775
|
-
} else if (
|
|
767
|
+
} else if (DEV) {
|
|
776
768
|
set = (next) => {
|
|
777
769
|
const prev = state2.value;
|
|
778
770
|
const newValue = typeof next === "function" ? next(prev) : next;
|
|
@@ -797,7 +789,7 @@ function signal(initial, options) {
|
|
|
797
789
|
}
|
|
798
790
|
};
|
|
799
791
|
}
|
|
800
|
-
if (
|
|
792
|
+
if (DEV) {
|
|
801
793
|
const hook = _g.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
802
794
|
if (hook) hook.emit("signal:create", { signal: state2, name: debugName, getter: get, initial });
|
|
803
795
|
}
|
package/dist/browser.js
CHANGED
|
@@ -35,15 +35,15 @@ import {
|
|
|
35
35
|
visibility,
|
|
36
36
|
wakeLock,
|
|
37
37
|
windowSize
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-KE4KWRDY.js";
|
|
39
39
|
import "./chunk-H3SRKIYX.js";
|
|
40
40
|
import "./chunk-52XFPGSN.js";
|
|
41
41
|
import "./chunk-7ZHH77QA.js";
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-7VEC3UD2.js";
|
|
43
|
+
import "./chunk-5DXA2J44.js";
|
|
44
|
+
import "./chunk-HECVW343.js";
|
|
45
|
+
import "./chunk-7ALC7KGE.js";
|
|
46
|
+
import "./chunk-2WLZ6757.js";
|
|
47
47
|
export {
|
|
48
48
|
animationFrame,
|
|
49
49
|
battery,
|