@torpor/view 1.2.6 → 1.3.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/dist/{Effect-DazmAdyC.d.mts → Effect-99HYQdzZ.d.mts} +50 -33
- package/dist/Effect-99HYQdzZ.d.mts.map +1 -0
- package/dist/{Effect-Dewn7MLc.d.cts → Effect-Bf8fz_zC.d.cts} +50 -33
- package/dist/Effect-Bf8fz_zC.d.cts.map +1 -0
- package/dist/compile.cjs +1498 -101
- package/dist/compile.d.cts +268 -1
- package/dist/compile.d.cts.map +1 -1
- package/dist/compile.d.mts +268 -1
- package/dist/compile.d.mts.map +1 -1
- package/dist/compile.mjs +1495 -102
- package/dist/compile.mjs.map +1 -1
- package/dist/dev.d.cts +1 -1
- package/dist/dev.d.mts +1 -1
- package/dist/{fromWebSocket-DrN-IduP.cjs → fromWebSocket-Cdoghvmh.cjs} +15 -0
- package/dist/{fromWebSocket-CFGoMkV2.mjs → fromWebSocket-ERhd9KZR.mjs} +11 -2
- package/dist/fromWebSocket-ERhd9KZR.mjs.map +1 -0
- package/dist/index.cjs +121 -75
- package/dist/index.d.cts +12 -6
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +12 -6
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +121 -75
- package/dist/index.mjs.map +1 -1
- package/dist/runtime.iife.js +1 -0
- package/dist/slotAutoClose-BbKfzpkz.cjs +177 -0
- package/dist/slotAutoClose-CgDkf8fM.mjs +156 -0
- package/dist/slotAutoClose-CgDkf8fM.mjs.map +1 -0
- package/dist/ssr.cjs +29 -1
- package/dist/ssr.d.cts +32 -1
- package/dist/ssr.d.cts.map +1 -1
- package/dist/ssr.d.mts +32 -1
- package/dist/ssr.d.mts.map +1 -1
- package/dist/ssr.mjs +25 -2
- package/dist/ssr.mjs.map +1 -1
- package/package.json +8 -5
- package/dist/Effect-DazmAdyC.d.mts.map +0 -1
- package/dist/Effect-Dewn7MLc.d.cts.map +0 -1
- package/dist/fromWebSocket-CFGoMkV2.mjs.map +0 -1
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import { t as Cleanup } from "./Cleanup-D0wvGW5d.mjs";
|
|
2
|
+
//#region src/types/AsyncSettle.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* The result of an `$async` computed's most recent generation-guarded settle —
|
|
5
|
+
* written exactly once per settled generation by the `.then` handlers in
|
|
6
|
+
* `$async` (and by hydration seeding), so it always reflects the last SETTLED
|
|
7
|
+
* run, never a superseded run's in-flight promise.
|
|
8
|
+
*
|
|
9
|
+
* `undefined` until the first settle. This one field replaces the three
|
|
10
|
+
* correlated fields it was previously spread across (`hasResolved` ⇔
|
|
11
|
+
* `settle !== undefined`; `lastErrored` ⇔ `settle?.ok === false`;
|
|
12
|
+
* `staleValue` ⇔ `settle.ok ? settle.value : undefined`), making impossible
|
|
13
|
+
* combinations (resolved but never settled, errored with a retained stale
|
|
14
|
+
* value) unrepresentable.
|
|
15
|
+
*/
|
|
16
|
+
type AsyncSettle = {
|
|
17
|
+
ok: true;
|
|
18
|
+
value: any;
|
|
19
|
+
} | {
|
|
20
|
+
ok: false;
|
|
21
|
+
error: any;
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
2
24
|
//#region src/types/constants.d.ts
|
|
3
25
|
/**
|
|
4
26
|
* The type of a Signal object.
|
|
@@ -150,21 +172,29 @@ interface Computed<T = any> {
|
|
|
150
172
|
*/
|
|
151
173
|
generation: number;
|
|
152
174
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
175
|
+
* The result of the most recent generation-guarded settle of an `$async`
|
|
176
|
+
* computed: `{ ok: true, value }` on resolve, `{ ok: false, error }` on
|
|
177
|
+
* rejection — or `undefined` until the first settle. Read side:
|
|
178
|
+
* - `settle !== undefined` ⇔ "has resolved before" — used by `$async` to
|
|
179
|
+
* capture `suspendQuiet`, and by the proxy get trap to distinguish a
|
|
180
|
+
* first load (throw `AwaitSuspend`) from a refresh (stale-while-
|
|
181
|
+
* revalidate). Monotonic — once set it stays set across subsequent
|
|
182
|
+
* re-suspends.
|
|
183
|
+
* - `settle.ok` ⇔ the last settle resolved. On `false`, a retry-after-
|
|
184
|
+
* error re-suspend must not hand the previous error to readers as
|
|
185
|
+
* "stale content" (it renders as a raw value, bypassing the error
|
|
186
|
+
* boundary).
|
|
187
|
+
* - `settle.value` on `ok === true` is the previously resolved value,
|
|
188
|
+
* retained across a refresh suspend for stale-while-revalidate
|
|
189
|
+
* (ASYNC.md → "Stale-while-revalidate") — read by `suspendRead` so
|
|
190
|
+
* readers keep displaying the old value instead of a placeholder while
|
|
191
|
+
* the new promise is in flight.
|
|
192
|
+
*
|
|
193
|
+
* Written only by `$async`'s settle handlers (and hydration seeding), so
|
|
194
|
+
* it is generation-safe by construction. Unused by plain `$cache`
|
|
195
|
+
* computeds (always `undefined`).
|
|
166
196
|
*/
|
|
167
|
-
|
|
197
|
+
settle: AsyncSettle | undefined;
|
|
168
198
|
/**
|
|
169
199
|
* True when the current suspend is a "bare refresh" — a re-fetch with no
|
|
170
200
|
* tracked dependency change, i.e. a silent `$refresh(fn, { silent: true })`
|
|
@@ -173,26 +203,13 @@ interface Computed<T = any> {
|
|
|
173
203
|
* matching Solid's stale-while-revalidate default.
|
|
174
204
|
*
|
|
175
205
|
* Captured at suspend time inside `$async`'s run: a suspend is quiet iff
|
|
176
|
-
* the computed has
|
|
177
|
-
* source-driven (`recalc === false`, i.e. not triggered by
|
|
178
|
-
* and not a loud `$refresh`). First loads are always loud
|
|
179
|
-
* is
|
|
180
|
-
* always loud (`recalc` is true).
|
|
206
|
+
* the computed has settled before (`settle !== undefined`) AND the run was
|
|
207
|
+
* NOT source-driven (`recalc === false`, i.e. not triggered by
|
|
208
|
+
* `checkComputed` and not a loud `$refresh`). First loads are always loud
|
|
209
|
+
* (`settle` is undefined); dependency-change refreshes and loud `$refresh`
|
|
210
|
+
* calls are always loud (`recalc` is true).
|
|
181
211
|
*/
|
|
182
212
|
suspendQuiet: boolean;
|
|
183
|
-
/**
|
|
184
|
-
* The previously resolved value, retained across a refresh suspend for
|
|
185
|
-
* stale-while-revalidate (ASYNC.md → "Stale-while-revalidate"). Maintained by `$async`'s
|
|
186
|
-
* generation-guarded settle handlers — set on resolve, cleared on
|
|
187
|
-
* rejection — so it always holds the last RESOLVED value, never a
|
|
188
|
-
* superseded run's in-flight promise (rapid prop changes would otherwise
|
|
189
|
-
* render "[object Promise]"). Read by `suspendRead` so readers keep
|
|
190
|
-
* displaying the old value instead of a placeholder while the new promise
|
|
191
|
-
* is in flight. `undefined` on first load (never resolved) and for plain
|
|
192
|
-
* `$cache` computeds (which never suspend, so `suspendRead` is never
|
|
193
|
-
* reached for them).
|
|
194
|
-
*/
|
|
195
|
-
staleValue: any;
|
|
196
213
|
/**
|
|
197
214
|
* A subscription to roll back to when recursively updating signal targets.
|
|
198
215
|
*/
|
|
@@ -378,4 +395,4 @@ interface Effect {
|
|
|
378
395
|
}
|
|
379
396
|
//#endregion
|
|
380
397
|
export { ProxySignal as i, Region as n, Computed as r, Effect as t };
|
|
381
|
-
//# sourceMappingURL=Effect-
|
|
398
|
+
//# sourceMappingURL=Effect-99HYQdzZ.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Effect-99HYQdzZ.d.mts","names":[],"sources":["../src/types/AsyncSettle.ts","../src/types/constants.ts","../src/types/ProxySignal.ts","../src/types/Subscription.ts","../src/types/Computed.ts","../src/types/ErrorBoundary.ts","../src/types/Region.ts","../src/types/Effect.ts"],"mappings":";;;;;;;;;;;;;;;KAaK;EAAgB;EAAU;;EAAiB;EAAW;;;;;;;cCV9C;;;;cAKA;;;;cAKA;;;;;;;UCNY;;;;EAIxB,aAAa;;;;EAKb,aAAa;;;;EAKb,oBAAoB;;;;EAKpB;;;;;;;;UClBwB;;;;EAIxB,QAAQ,cAAc;;;;EAKtB,QAAQ,WAAW;;;;;EAMnB,YAAY;;;;;EAMZ,YAAY;;;;;;;EAQZ,gBAAgB;;;;;;EAOhB;;;;;EAMA;;;;EAKA;;;;;;;;;UC9CwB,SAAS;;;;EAIjC,aAAa;;;;;;;;EASb;;;;EAKA,OAAO;;;;EAKP,WAAW;;;;EAKX,aAAa;;;;EAKb,aAAa;;;;;;;EAQb;;;;EAKA;;;;EAKA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;;;;;;;;;;;;;;;;;;EAyBA,QAAQ;;;;;;;;;;;;;;;EAgBR;;;;EAKA,UAAU;;;;EAKV;;;;;;;;;;UCrHwB;;;;;;EAMxB;;;;;EAMA;;;;;EAMA,QAAQ;;;;;;;;;EAUR,cAAc,cAAc;;;;UCnCJ;EACxB,WAAW;EACX,SAAS;EAET,gBAAgB;EAChB,YAAY;EACZ;;;;;EAMA,YAAY,IAAI;;;;EAKhB;;;;EAKA,SAAS;;;;;;;EAQT,gBAAgB;;;;;;;EAQhB;;;;;;EAOA;;;;;;;UCtCwB;;;;EAIxB,aAAa;;;;;EAMb,WAAW;;;;EAKX,SAAS;;;;EAKT,aAAa;EAKb,YAAY;;;;EAKZ;;;;;;EAOA;;;;EAKA;;;;;;;EAQA;;;;;;;;;;EAWA,iBAAiB,IAAI;;;;EAKrB;;;;;;EAOA,SAAS;;;;;;EAOT,gBAAgB,cAAc;;;;;;;;;EAU9B;;;;;;;;;;;;;;;;EAiBA"}
|
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import { t as Cleanup } from "./Cleanup-D0wvGW5d.cjs";
|
|
2
|
+
//#region src/types/AsyncSettle.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* The result of an `$async` computed's most recent generation-guarded settle —
|
|
5
|
+
* written exactly once per settled generation by the `.then` handlers in
|
|
6
|
+
* `$async` (and by hydration seeding), so it always reflects the last SETTLED
|
|
7
|
+
* run, never a superseded run's in-flight promise.
|
|
8
|
+
*
|
|
9
|
+
* `undefined` until the first settle. This one field replaces the three
|
|
10
|
+
* correlated fields it was previously spread across (`hasResolved` ⇔
|
|
11
|
+
* `settle !== undefined`; `lastErrored` ⇔ `settle?.ok === false`;
|
|
12
|
+
* `staleValue` ⇔ `settle.ok ? settle.value : undefined`), making impossible
|
|
13
|
+
* combinations (resolved but never settled, errored with a retained stale
|
|
14
|
+
* value) unrepresentable.
|
|
15
|
+
*/
|
|
16
|
+
type AsyncSettle = {
|
|
17
|
+
ok: true;
|
|
18
|
+
value: any;
|
|
19
|
+
} | {
|
|
20
|
+
ok: false;
|
|
21
|
+
error: any;
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
2
24
|
//#region src/types/constants.d.ts
|
|
3
25
|
/**
|
|
4
26
|
* The type of a Signal object.
|
|
@@ -150,21 +172,29 @@ interface Computed<T = any> {
|
|
|
150
172
|
*/
|
|
151
173
|
generation: number;
|
|
152
174
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
175
|
+
* The result of the most recent generation-guarded settle of an `$async`
|
|
176
|
+
* computed: `{ ok: true, value }` on resolve, `{ ok: false, error }` on
|
|
177
|
+
* rejection — or `undefined` until the first settle. Read side:
|
|
178
|
+
* - `settle !== undefined` ⇔ "has resolved before" — used by `$async` to
|
|
179
|
+
* capture `suspendQuiet`, and by the proxy get trap to distinguish a
|
|
180
|
+
* first load (throw `AwaitSuspend`) from a refresh (stale-while-
|
|
181
|
+
* revalidate). Monotonic — once set it stays set across subsequent
|
|
182
|
+
* re-suspends.
|
|
183
|
+
* - `settle.ok` ⇔ the last settle resolved. On `false`, a retry-after-
|
|
184
|
+
* error re-suspend must not hand the previous error to readers as
|
|
185
|
+
* "stale content" (it renders as a raw value, bypassing the error
|
|
186
|
+
* boundary).
|
|
187
|
+
* - `settle.value` on `ok === true` is the previously resolved value,
|
|
188
|
+
* retained across a refresh suspend for stale-while-revalidate
|
|
189
|
+
* (ASYNC.md → "Stale-while-revalidate") — read by `suspendRead` so
|
|
190
|
+
* readers keep displaying the old value instead of a placeholder while
|
|
191
|
+
* the new promise is in flight.
|
|
192
|
+
*
|
|
193
|
+
* Written only by `$async`'s settle handlers (and hydration seeding), so
|
|
194
|
+
* it is generation-safe by construction. Unused by plain `$cache`
|
|
195
|
+
* computeds (always `undefined`).
|
|
166
196
|
*/
|
|
167
|
-
|
|
197
|
+
settle: AsyncSettle | undefined;
|
|
168
198
|
/**
|
|
169
199
|
* True when the current suspend is a "bare refresh" — a re-fetch with no
|
|
170
200
|
* tracked dependency change, i.e. a silent `$refresh(fn, { silent: true })`
|
|
@@ -173,26 +203,13 @@ interface Computed<T = any> {
|
|
|
173
203
|
* matching Solid's stale-while-revalidate default.
|
|
174
204
|
*
|
|
175
205
|
* Captured at suspend time inside `$async`'s run: a suspend is quiet iff
|
|
176
|
-
* the computed has
|
|
177
|
-
* source-driven (`recalc === false`, i.e. not triggered by
|
|
178
|
-
* and not a loud `$refresh`). First loads are always loud
|
|
179
|
-
* is
|
|
180
|
-
* always loud (`recalc` is true).
|
|
206
|
+
* the computed has settled before (`settle !== undefined`) AND the run was
|
|
207
|
+
* NOT source-driven (`recalc === false`, i.e. not triggered by
|
|
208
|
+
* `checkComputed` and not a loud `$refresh`). First loads are always loud
|
|
209
|
+
* (`settle` is undefined); dependency-change refreshes and loud `$refresh`
|
|
210
|
+
* calls are always loud (`recalc` is true).
|
|
181
211
|
*/
|
|
182
212
|
suspendQuiet: boolean;
|
|
183
|
-
/**
|
|
184
|
-
* The previously resolved value, retained across a refresh suspend for
|
|
185
|
-
* stale-while-revalidate (ASYNC.md → "Stale-while-revalidate"). Maintained by `$async`'s
|
|
186
|
-
* generation-guarded settle handlers — set on resolve, cleared on
|
|
187
|
-
* rejection — so it always holds the last RESOLVED value, never a
|
|
188
|
-
* superseded run's in-flight promise (rapid prop changes would otherwise
|
|
189
|
-
* render "[object Promise]"). Read by `suspendRead` so readers keep
|
|
190
|
-
* displaying the old value instead of a placeholder while the new promise
|
|
191
|
-
* is in flight. `undefined` on first load (never resolved) and for plain
|
|
192
|
-
* `$cache` computeds (which never suspend, so `suspendRead` is never
|
|
193
|
-
* reached for them).
|
|
194
|
-
*/
|
|
195
|
-
staleValue: any;
|
|
196
213
|
/**
|
|
197
214
|
* A subscription to roll back to when recursively updating signal targets.
|
|
198
215
|
*/
|
|
@@ -378,4 +395,4 @@ interface Effect {
|
|
|
378
395
|
}
|
|
379
396
|
//#endregion
|
|
380
397
|
export { ProxySignal as i, Region as n, Computed as r, Effect as t };
|
|
381
|
-
//# sourceMappingURL=Effect-
|
|
398
|
+
//# sourceMappingURL=Effect-Bf8fz_zC.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Effect-Bf8fz_zC.d.cts","names":[],"sources":["../src/types/AsyncSettle.ts","../src/types/constants.ts","../src/types/ProxySignal.ts","../src/types/Subscription.ts","../src/types/Computed.ts","../src/types/ErrorBoundary.ts","../src/types/Region.ts","../src/types/Effect.ts"],"mappings":";;;;;;;;;;;;;;;KAaK;EAAgB;EAAU;;EAAiB;EAAW;;;;;;;cCV9C;;;;cAKA;;;;cAKA;;;;;;;UCNY;;;;EAIxB,aAAa;;;;EAKb,aAAa;;;;EAKb,oBAAoB;;;;EAKpB;;;;;;;;UClBwB;;;;EAIxB,QAAQ,cAAc;;;;EAKtB,QAAQ,WAAW;;;;;EAMnB,YAAY;;;;;EAMZ,YAAY;;;;;;;EAQZ,gBAAgB;;;;;;EAOhB;;;;;EAMA;;;;EAKA;;;;;;;;;UC9CwB,SAAS;;;;EAIjC,aAAa;;;;;;;;EASb;;;;EAKA,OAAO;;;;EAKP,WAAW;;;;EAKX,aAAa;;;;EAKb,aAAa;;;;;;;EAQb;;;;EAKA;;;;EAKA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;;;;;;;;;;;;;;;;;;EAyBA,QAAQ;;;;;;;;;;;;;;;EAgBR;;;;EAKA,UAAU;;;;EAKV;;;;;;;;;;UCrHwB;;;;;;EAMxB;;;;;EAMA;;;;;EAMA,QAAQ;;;;;;;;;EAUR,cAAc,cAAc;;;;UCnCJ;EACxB,WAAW;EACX,SAAS;EAET,gBAAgB;EAChB,YAAY;EACZ;;;;;EAMA,YAAY,IAAI;;;;EAKhB;;;;EAKA,SAAS;;;;;;;EAQT,gBAAgB;;;;;;;EAQhB;;;;;;EAOA;;;;;;;UCtCwB;;;;EAIxB,aAAa;;;;;EAMb,WAAW;;;;EAKX,SAAS;;;;EAKT,aAAa;EAKb,YAAY;;;;EAKZ;;;;;;EAOA;;;;EAKA;;;;;;;EAQA;;;;;;;;;;EAWA,iBAAiB,IAAI;;;;EAKrB;;;;;;EAOA,SAAS;;;;;;EAOT,gBAAgB,cAAc;;;;;;;;;EAU9B;;;;;;;;;;;;;;;;EAiBA"}
|