sibujs 3.4.0 → 4.0.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/LICENSE +21 -21
- package/README.md +118 -15
- package/dist/browser.cjs +410 -101
- package/dist/browser.d.cts +50 -5
- package/dist/browser.d.ts +50 -5
- package/dist/browser.js +8 -6
- package/dist/build.cjs +777 -385
- package/dist/build.js +15 -15
- package/dist/cdn.global.js +11 -7
- package/dist/{chunk-JCO7AHNU.js → chunk-3EKJK5FZ.js} +73 -34
- package/dist/chunk-4MFZMLUU.js +147 -0
- package/dist/chunk-52XFPGSN.js +123 -0
- package/dist/chunk-5INI7D2L.js +194 -0
- package/dist/{chunk-OAVXAFAY.js → chunk-6LG2T7LO.js} +5 -5
- package/dist/{chunk-OOUQUCNN.js → chunk-ACBT6UZS.js} +57 -22
- package/dist/{chunk-F7HW2NI5.js → chunk-AW6HPJ3L.js} +1 -1
- package/dist/chunk-DHDZ7IVN.js +109 -0
- package/dist/{chunk-JNGGM2XE.js → chunk-DQVUBVNX.js} +16 -25
- package/dist/{chunk-AXFWGY32.js → chunk-DR7H6UGM.js} +232 -67
- package/dist/{chunk-WSGLJYFI.js → chunk-E62UADKL.js} +9 -3
- package/dist/{chunk-3Z2NGWQI.js → chunk-ES2GERY2.js} +1 -1
- package/dist/{chunk-S3V6ZXPI.js → chunk-EWEE7NBF.js} +115 -41
- package/dist/{chunk-3DVGCW7O.js → chunk-F64ZPCFE.js} +8 -8
- package/dist/{chunk-APFRCIRI.js → chunk-GCSGGA3Q.js} +295 -198
- package/dist/{chunk-EX77FXTT.js → chunk-HYCCIYNS.js} +228 -51
- package/dist/{chunk-ELXMRSVN.js → chunk-NF3LYCQH.js} +259 -124
- package/dist/chunk-O3QQ3XOL.js +61 -0
- package/dist/{chunk-BUKYCWHX.js → chunk-PBQEW5VW.js} +14 -10
- package/dist/{chunk-H5FI5WDP.js → chunk-RRIDJQ5C.js} +3 -3
- package/dist/{chunk-S3NFJO6L.js → chunk-TIRZCERI.js} +36 -5
- package/dist/{chunk-ODXVQ3CS.js → chunk-VFHIVEPF.js} +309 -188
- package/dist/chunk-VPP2FONR.js +142 -0
- package/dist/{chunk-KZBEVFXZ.js → chunk-W55YHPEP.js} +5 -3
- package/dist/{chunk-FKQG7FTY.js → chunk-WN6WDFCB.js} +4 -4
- package/dist/{chunk-CEBWDD63.js → chunk-WOOMUJFT.js} +228 -86
- package/dist/{chunk-ITWCTZYH.js → chunk-Z2CE42DB.js} +19 -25
- package/dist/{contracts-ey_Qh8ef.d.cts → contracts-Hg6ITAEF.d.cts} +6 -6
- package/dist/{contracts-ey_Qh8ef.d.ts → contracts-Hg6ITAEF.d.ts} +6 -6
- package/dist/{customElement-CPfIrbvg.d.ts → customElement-CKLoO63w.d.cts} +73 -11
- package/dist/{customElement-CPfIrbvg.d.cts → customElement-CKLoO63w.d.ts} +73 -11
- package/dist/data.cjs +483 -205
- package/dist/data.d.cts +139 -7
- package/dist/data.d.ts +139 -7
- package/dist/data.js +9 -9
- package/dist/devtools.cjs +222 -87
- package/dist/devtools.js +8 -8
- package/dist/dispose-4FZ6OFXR.js +19 -0
- package/dist/ecosystem.cjs +419 -175
- package/dist/ecosystem.js +11 -11
- package/dist/extras.cjs +1981 -765
- package/dist/extras.d.cts +7 -7
- package/dist/extras.d.ts +7 -7
- package/dist/extras.js +29 -26
- package/dist/index.cjs +784 -385
- package/dist/index.d.cts +299 -28
- package/dist/index.d.ts +299 -28
- package/dist/index.js +33 -18
- package/dist/motion.cjs +180 -50
- package/dist/motion.d.cts +26 -0
- package/dist/motion.d.ts +26 -0
- package/dist/motion.js +5 -5
- package/dist/patterns.cjs +437 -170
- package/dist/patterns.d.cts +60 -13
- package/dist/patterns.d.ts +60 -13
- package/dist/patterns.js +7 -7
- package/dist/performance.cjs +333 -148
- package/dist/performance.d.cts +55 -7
- package/dist/performance.d.ts +55 -7
- package/dist/performance.js +9 -9
- package/dist/plugins.cjs +1374 -576
- package/dist/plugins.d.cts +227 -9
- package/dist/plugins.d.ts +227 -9
- package/dist/plugins.js +613 -321
- package/dist/{ssr-D62yFwuw.d.cts → ssr-BiPRdZ6n.d.cts} +44 -15
- package/dist/{ssr-D62yFwuw.d.ts → ssr-BiPRdZ6n.d.ts} +44 -15
- package/dist/{ssr-2PPULEK2.js → ssr-JFP5535P.js} +5 -4
- package/dist/ssr.cjs +1104 -443
- package/dist/ssr.d.cts +230 -20
- package/dist/ssr.d.ts +230 -20
- package/dist/ssr.js +15 -12
- package/dist/{startup-0Qv6aosO.d.cts → startup-BMpaiMhP.d.cts} +1 -1
- package/dist/{startup-0Qv6aosO.d.ts → startup-BMpaiMhP.d.ts} +1 -1
- package/dist/testing.cjs +205 -63
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +8 -10
- package/dist/ui.cjs +640 -199
- package/dist/ui.d.cts +2 -2
- package/dist/ui.d.ts +2 -2
- package/dist/ui.js +10 -10
- package/dist/widgets.cjs +207 -82
- package/dist/widgets.js +9 -9
- package/package.json +12 -7
- package/dist/chunk-5VGSK6D2.js +0 -80
- package/dist/chunk-COY6PUD2.js +0 -34
- package/dist/chunk-K35BAR4P.js +0 -96
- package/dist/chunk-L3GAGWCC.js +0 -111
- package/dist/chunk-RT3IYFN2.js +0 -38
|
@@ -29,12 +29,29 @@ interface HydrationMismatch {
|
|
|
29
29
|
message: string;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* and
|
|
32
|
+
* Activates a server-rendered SibuJS application by building the live client
|
|
33
|
+
* tree and **replacing** the inert server-rendered subtree with it.
|
|
34
|
+
*
|
|
35
|
+
* SibuJS uses replacement hydration rather than DOM adoption: the server markup
|
|
36
|
+
* is discarded, not attached to. It is not the case that listeners and bindings
|
|
37
|
+
* are wired onto the existing server nodes — reactive bindings belong to the
|
|
38
|
+
* nodes `component()` produced, and adopting server nodes would leave the
|
|
39
|
+
* visible DOM permanently frozen.
|
|
40
|
+
*
|
|
41
|
+
* Consequences worth knowing before deploying SSR:
|
|
42
|
+
*
|
|
43
|
+
* - DOM node identity is not preserved.
|
|
44
|
+
* - Pre-hydration user input, checkbox state, and focus are discarded.
|
|
45
|
+
* - Conversely, partial-adoption mismatch bugs are avoided by this design —
|
|
46
|
+
* the client tree is always authoritative.
|
|
47
|
+
*
|
|
48
|
+
* Re-hydrating the same container disposes the previous client tree first.
|
|
34
49
|
*
|
|
35
50
|
* When `options.diagnostics` is true, the walker reports the first
|
|
36
51
|
* server/client mismatch it finds. This is a dev-mode tool — pass
|
|
37
52
|
* `diagnostics: false` (or omit it) in production.
|
|
53
|
+
*
|
|
54
|
+
* @see docs/architecture/hydration.md
|
|
38
55
|
*/
|
|
39
56
|
declare function hydrate(component: () => HTMLElement, container: HTMLElement, options?: HydrateOptions): void;
|
|
40
57
|
/**
|
|
@@ -58,10 +75,17 @@ type TrustedHTML = string & {
|
|
|
58
75
|
*/
|
|
59
76
|
declare function trustHTML(html: string): TrustedHTML;
|
|
60
77
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
78
|
+
* Should this meta entry be dropped entirely?
|
|
79
|
+
*
|
|
80
|
+
* Delegates to the SHARED meta-refresh policy. This used to be a private copy
|
|
81
|
+
* of four `includes()` checks that happened to match the client's private copy
|
|
82
|
+
* — two implementations of one rule, so a fix to either would silently diverge
|
|
83
|
+
* from the other. The exported name is kept for back-compat; the policy is no
|
|
84
|
+
* longer local.
|
|
85
|
+
*
|
|
86
|
+
* Returns true for a forbidden refresh directive AND for an entry carrying
|
|
87
|
+
* duplicate case-insensitive attribute names, since there the value validated
|
|
88
|
+
* would not be the value the browser ends up honouring.
|
|
65
89
|
*/
|
|
66
90
|
declare function isDangerousMetaRefresh(metaProps: Record<string, string>): boolean;
|
|
67
91
|
/**
|
|
@@ -100,19 +124,24 @@ declare function renderToStream(element: HTMLElement | DocumentFragment | Node):
|
|
|
100
124
|
*/
|
|
101
125
|
declare function collectStream(stream: AsyncGenerator<string> | AsyncIterable<string>): Promise<string>;
|
|
102
126
|
/**
|
|
103
|
-
* Renders a component tree to a Web ReadableStream<string
|
|
104
|
-
*
|
|
127
|
+
* Renders a component tree to a Web `ReadableStream<string>`.
|
|
128
|
+
*
|
|
105
129
|
* Uses pull-based backpressure — chunks are produced on demand.
|
|
130
|
+
*
|
|
131
|
+
* **Environment.** Supported on SibuJS's declared Node runtime (`>=22.3.0`) and
|
|
132
|
+
* on any other environment providing both the Web Streams API *and* a DOM
|
|
133
|
+
* implementation. Streaming SSR requires the same server DOM as every other
|
|
134
|
+
* SibuJS SSR API: this function takes real `Node` objects and walks them, so a
|
|
135
|
+
* DOM-less runtime cannot produce the input, let alone render it. Do not read
|
|
136
|
+
* "returns a Web stream" as "runs anywhere Web streams exist".
|
|
137
|
+
*
|
|
138
|
+
* **Semantics.** Suspense boundaries encountered during the walk are resolved
|
|
139
|
+
* as a batch before the affected chunk is emitted — the shell is not flushed
|
|
140
|
+
* ahead of individually-completing boundaries. See
|
|
141
|
+
* `docs/architecture/ssr.md` for the precise streaming and failure semantics.
|
|
106
142
|
*/
|
|
107
143
|
declare function renderToReadableStream(element: HTMLElement | DocumentFragment | Node): ReadableStream<string>;
|
|
108
144
|
declare function island(id: string, component: () => HTMLElement): HTMLElement;
|
|
109
|
-
/**
|
|
110
|
-
* Hydrate only elements marked as islands (`data-sibu-island`).
|
|
111
|
-
* Non-island content keeps its server-rendered HTML untouched.
|
|
112
|
-
*
|
|
113
|
-
* Security: uses `hasOwnProperty.call` to guard against prototype-pollution
|
|
114
|
-
* lookups (e.g. an island id of `__proto__` must not resolve to `Object.prototype`).
|
|
115
|
-
*/
|
|
116
145
|
declare function hydrateIslands(container: HTMLElement, islands: Record<string, () => HTMLElement>): void;
|
|
117
146
|
/**
|
|
118
147
|
* Progressively hydrate islands only when they enter the viewport.
|
|
@@ -29,12 +29,29 @@ interface HydrationMismatch {
|
|
|
29
29
|
message: string;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* and
|
|
32
|
+
* Activates a server-rendered SibuJS application by building the live client
|
|
33
|
+
* tree and **replacing** the inert server-rendered subtree with it.
|
|
34
|
+
*
|
|
35
|
+
* SibuJS uses replacement hydration rather than DOM adoption: the server markup
|
|
36
|
+
* is discarded, not attached to. It is not the case that listeners and bindings
|
|
37
|
+
* are wired onto the existing server nodes — reactive bindings belong to the
|
|
38
|
+
* nodes `component()` produced, and adopting server nodes would leave the
|
|
39
|
+
* visible DOM permanently frozen.
|
|
40
|
+
*
|
|
41
|
+
* Consequences worth knowing before deploying SSR:
|
|
42
|
+
*
|
|
43
|
+
* - DOM node identity is not preserved.
|
|
44
|
+
* - Pre-hydration user input, checkbox state, and focus are discarded.
|
|
45
|
+
* - Conversely, partial-adoption mismatch bugs are avoided by this design —
|
|
46
|
+
* the client tree is always authoritative.
|
|
47
|
+
*
|
|
48
|
+
* Re-hydrating the same container disposes the previous client tree first.
|
|
34
49
|
*
|
|
35
50
|
* When `options.diagnostics` is true, the walker reports the first
|
|
36
51
|
* server/client mismatch it finds. This is a dev-mode tool — pass
|
|
37
52
|
* `diagnostics: false` (or omit it) in production.
|
|
53
|
+
*
|
|
54
|
+
* @see docs/architecture/hydration.md
|
|
38
55
|
*/
|
|
39
56
|
declare function hydrate(component: () => HTMLElement, container: HTMLElement, options?: HydrateOptions): void;
|
|
40
57
|
/**
|
|
@@ -58,10 +75,17 @@ type TrustedHTML = string & {
|
|
|
58
75
|
*/
|
|
59
76
|
declare function trustHTML(html: string): TrustedHTML;
|
|
60
77
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
78
|
+
* Should this meta entry be dropped entirely?
|
|
79
|
+
*
|
|
80
|
+
* Delegates to the SHARED meta-refresh policy. This used to be a private copy
|
|
81
|
+
* of four `includes()` checks that happened to match the client's private copy
|
|
82
|
+
* — two implementations of one rule, so a fix to either would silently diverge
|
|
83
|
+
* from the other. The exported name is kept for back-compat; the policy is no
|
|
84
|
+
* longer local.
|
|
85
|
+
*
|
|
86
|
+
* Returns true for a forbidden refresh directive AND for an entry carrying
|
|
87
|
+
* duplicate case-insensitive attribute names, since there the value validated
|
|
88
|
+
* would not be the value the browser ends up honouring.
|
|
65
89
|
*/
|
|
66
90
|
declare function isDangerousMetaRefresh(metaProps: Record<string, string>): boolean;
|
|
67
91
|
/**
|
|
@@ -100,19 +124,24 @@ declare function renderToStream(element: HTMLElement | DocumentFragment | Node):
|
|
|
100
124
|
*/
|
|
101
125
|
declare function collectStream(stream: AsyncGenerator<string> | AsyncIterable<string>): Promise<string>;
|
|
102
126
|
/**
|
|
103
|
-
* Renders a component tree to a Web ReadableStream<string
|
|
104
|
-
*
|
|
127
|
+
* Renders a component tree to a Web `ReadableStream<string>`.
|
|
128
|
+
*
|
|
105
129
|
* Uses pull-based backpressure — chunks are produced on demand.
|
|
130
|
+
*
|
|
131
|
+
* **Environment.** Supported on SibuJS's declared Node runtime (`>=22.3.0`) and
|
|
132
|
+
* on any other environment providing both the Web Streams API *and* a DOM
|
|
133
|
+
* implementation. Streaming SSR requires the same server DOM as every other
|
|
134
|
+
* SibuJS SSR API: this function takes real `Node` objects and walks them, so a
|
|
135
|
+
* DOM-less runtime cannot produce the input, let alone render it. Do not read
|
|
136
|
+
* "returns a Web stream" as "runs anywhere Web streams exist".
|
|
137
|
+
*
|
|
138
|
+
* **Semantics.** Suspense boundaries encountered during the walk are resolved
|
|
139
|
+
* as a batch before the affected chunk is emitted — the shell is not flushed
|
|
140
|
+
* ahead of individually-completing boundaries. See
|
|
141
|
+
* `docs/architecture/ssr.md` for the precise streaming and failure semantics.
|
|
106
142
|
*/
|
|
107
143
|
declare function renderToReadableStream(element: HTMLElement | DocumentFragment | Node): ReadableStream<string>;
|
|
108
144
|
declare function island(id: string, component: () => HTMLElement): HTMLElement;
|
|
109
|
-
/**
|
|
110
|
-
* Hydrate only elements marked as islands (`data-sibu-island`).
|
|
111
|
-
* Non-island content keeps its server-rendered HTML untouched.
|
|
112
|
-
*
|
|
113
|
-
* Security: uses `hasOwnProperty.call` to guard against prototype-pollution
|
|
114
|
-
* lookups (e.g. an island id of `__proto__` must not resolve to `Object.prototype`).
|
|
115
|
-
*/
|
|
116
145
|
declare function hydrateIslands(container: HTMLElement, islands: Record<string, () => HTMLElement>): void;
|
|
117
146
|
/**
|
|
118
147
|
* Progressively hydrate islands only when they enter the viewport.
|
|
@@ -17,10 +17,11 @@ import {
|
|
|
17
17
|
ssrSuspense,
|
|
18
18
|
suspenseSwapScript,
|
|
19
19
|
trustHTML
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-HYCCIYNS.js";
|
|
21
|
+
import "./chunk-5INI7D2L.js";
|
|
22
|
+
import "./chunk-TIRZCERI.js";
|
|
23
|
+
import "./chunk-DHDZ7IVN.js";
|
|
24
|
+
import "./chunk-VPP2FONR.js";
|
|
24
25
|
export {
|
|
25
26
|
collectStream,
|
|
26
27
|
deserializeState,
|