@happyvertical/smrt-svelte 0.57.41 → 0.57.43
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/AGENTS.md
CHANGED
|
@@ -145,6 +145,14 @@ prefix set and the shared name table — are stamped with the `modelContext`
|
|
|
145
145
|
they were taken against and reset when a host installs a new one; keep them in
|
|
146
146
|
step, or a prefix stays refused against a registry that never held its tools.
|
|
147
147
|
|
|
148
|
+
## Live collection lifecycle (#4508)
|
|
149
|
+
|
|
150
|
+
`liveCollection` absorbs TanStack loading failures, crashes, and sync-health
|
|
151
|
+
failures into SMRT's `error` status. Background sync failures retain the last
|
|
152
|
+
good rows and use the `sync-error` payload until recovery. Component unmount
|
|
153
|
+
releases its reader; explicit collection cleanup also stops active dependent
|
|
154
|
+
queries through smrt-web's owning lifecycle.
|
|
155
|
+
|
|
148
156
|
## Hooks
|
|
149
157
|
|
|
150
158
|
| Hook | Returns |
|
|
@@ -30,7 +30,7 @@ import { type SmrtWebCollection, type SmrtWebRow } from '@happyvertical/smrt-web
|
|
|
30
30
|
* - `loading` — the first load has not completed yet (also covers the engine's
|
|
31
31
|
* pre-start `idle` and post-teardown `cleaned-up` phases).
|
|
32
32
|
* - `ready` — data has arrived and the collection is live.
|
|
33
|
-
* - `error` — the
|
|
33
|
+
* - `error` — the first load, live synchronization, or query execution failed.
|
|
34
34
|
*/
|
|
35
35
|
export type LiveCollectionStatus = 'loading' | 'ready' | 'error';
|
|
36
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-collection.svelte.d.ts","sourceRoot":"","sources":["../../src/web/live-collection.svelte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AASjC;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,OAAO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kCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AACH,wBAAgB,cAAc,CAAC,KAAK,SAAS,MAAM,EACjD,MAAM,EAAE,iBAAiB,CAAC,KAAK,CAAC,EAChC,OAAO,GAAE,qBAA0B,GAClC,cAAc,CAAC,KAAK,CAAC,CAkEvB"}
|
|
@@ -147,10 +147,11 @@ export function liveCollection(handle, options = {}) {
|
|
|
147
147
|
// Project rows to plain DTOs reactively. `query.data` is a $state-backed
|
|
148
148
|
// reactive array; `$derived.by` recomputes the projection when it changes.
|
|
149
149
|
const rows = $derived.by(() => query.data.map((row) => toPlainRow(row)));
|
|
150
|
-
const
|
|
150
|
+
const hasReadError = $derived(query.isLoadingError || query.isCrashed || query.isSyncError);
|
|
151
|
+
const status = $derived(toLiveStatus(query.isReady, hasReadError));
|
|
151
152
|
// useLiveQuery does not surface an error object, only an error status; expose
|
|
152
153
|
// the status string as the error payload when the read has failed.
|
|
153
|
-
const error = $derived(query.
|
|
154
|
+
const error = $derived(hasReadError ? (query.isSyncError ? 'sync-error' : query.status) : null);
|
|
154
155
|
return {
|
|
155
156
|
get rows() {
|
|
156
157
|
return rows;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-svelte",
|
|
3
|
-
"version": "0.57.
|
|
3
|
+
"version": "0.57.43",
|
|
4
4
|
"smrtJsdoc": "strict",
|
|
5
5
|
"description": "Svelte 5 components for SMRT user management - auth, users, tenants, roles, permissions, groups",
|
|
6
6
|
"type": "module",
|
|
@@ -210,13 +210,13 @@
|
|
|
210
210
|
},
|
|
211
211
|
"dependencies": {
|
|
212
212
|
"@happyvertical/logger": "^0.111.0",
|
|
213
|
-
"@happyvertical/smrt-languages": "0.57.
|
|
214
|
-
"@happyvertical/smrt-mcp-apps": "0.57.
|
|
215
|
-
"@happyvertical/smrt-types": "0.57.
|
|
216
|
-
"@happyvertical/smrt-ui": "0.57.
|
|
217
|
-
"@happyvertical/smrt-web": "0.57.
|
|
218
|
-
"@tanstack/db": "^0.
|
|
219
|
-
"@tanstack/svelte-db": "^0.1
|
|
213
|
+
"@happyvertical/smrt-languages": "0.57.43",
|
|
214
|
+
"@happyvertical/smrt-mcp-apps": "0.57.43",
|
|
215
|
+
"@happyvertical/smrt-types": "0.57.43",
|
|
216
|
+
"@happyvertical/smrt-ui": "0.57.43",
|
|
217
|
+
"@happyvertical/smrt-web": "0.57.43",
|
|
218
|
+
"@tanstack/db": "^1.0.0-rc.1",
|
|
219
|
+
"@tanstack/svelte-db": "^1.0.0-rc.1",
|
|
220
220
|
"esm-env": "^1.2.2"
|
|
221
221
|
},
|
|
222
222
|
"peerDependencies": {
|
|
@@ -249,14 +249,14 @@
|
|
|
249
249
|
}
|
|
250
250
|
},
|
|
251
251
|
"devDependencies": {
|
|
252
|
-
"@happyvertical/smrt-agents": "0.57.
|
|
253
|
-
"@happyvertical/smrt-chat": "0.57.
|
|
254
|
-
"@happyvertical/smrt-content": "0.57.
|
|
255
|
-
"@happyvertical/smrt-core": "0.57.
|
|
256
|
-
"@happyvertical/smrt-reports": "0.57.
|
|
257
|
-
"@happyvertical/smrt-scanner": "0.57.
|
|
258
|
-
"@happyvertical/smrt-tenancy": "0.57.
|
|
259
|
-
"@happyvertical/smrt-users": "0.57.
|
|
252
|
+
"@happyvertical/smrt-agents": "0.57.43",
|
|
253
|
+
"@happyvertical/smrt-chat": "0.57.43",
|
|
254
|
+
"@happyvertical/smrt-content": "0.57.43",
|
|
255
|
+
"@happyvertical/smrt-core": "0.57.43",
|
|
256
|
+
"@happyvertical/smrt-reports": "0.57.43",
|
|
257
|
+
"@happyvertical/smrt-scanner": "0.57.43",
|
|
258
|
+
"@happyvertical/smrt-tenancy": "0.57.43",
|
|
259
|
+
"@happyvertical/smrt-users": "0.57.43",
|
|
260
260
|
"@happyvertical/speech": "^0.111.0",
|
|
261
261
|
"@sveltejs/package": "^2.5.8",
|
|
262
262
|
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|