@livestore/react 0.4.0-dev.9 → 0.5.0-dev.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 +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/StoreRegistryContext.d.ts +56 -0
- package/dist/StoreRegistryContext.d.ts.map +1 -0
- package/dist/StoreRegistryContext.js +61 -0
- package/dist/StoreRegistryContext.js.map +1 -0
- package/dist/__tests__/fixture.d.ts +12 -283
- package/dist/__tests__/fixture.d.ts.map +1 -1
- package/dist/__tests__/fixture.js +12 -86
- package/dist/__tests__/fixture.js.map +1 -1
- package/dist/experimental/components/LiveList.d.ts +4 -2
- package/dist/experimental/components/LiveList.d.ts.map +1 -1
- package/dist/experimental/components/LiveList.js +11 -9
- package/dist/experimental/components/LiveList.js.map +1 -1
- package/dist/mod.d.ts +8 -5
- package/dist/mod.d.ts.map +1 -1
- package/dist/mod.js +6 -4
- package/dist/mod.js.map +1 -1
- package/dist/useClientDocument.d.ts +12 -4
- package/dist/useClientDocument.d.ts.map +1 -1
- package/dist/useClientDocument.js +4 -18
- package/dist/useClientDocument.js.map +1 -1
- package/dist/useClientDocument.test.js +28 -20
- package/dist/useClientDocument.test.js.map +1 -1
- package/dist/useQuery.d.ts +29 -8
- package/dist/useQuery.d.ts.map +1 -1
- package/dist/useQuery.js +43 -70
- package/dist/useQuery.js.map +1 -1
- package/dist/useQuery.test.js +67 -23
- package/dist/useQuery.test.js.map +1 -1
- package/dist/useRcResource.d.ts +1 -1
- package/dist/useRcResource.d.ts.map +1 -1
- package/dist/useRcResource.js +42 -35
- package/dist/useRcResource.js.map +1 -1
- package/dist/useRcResource.test.js +73 -50
- package/dist/useRcResource.test.js.map +1 -1
- package/dist/useStore.d.ts +74 -7
- package/dist/useStore.d.ts.map +1 -1
- package/dist/useStore.js +82 -16
- package/dist/useStore.js.map +1 -1
- package/dist/useStore.test.d.ts +2 -0
- package/dist/useStore.test.d.ts.map +1 -0
- package/dist/useStore.test.js +242 -0
- package/dist/useStore.test.js.map +1 -0
- package/dist/useSyncStatus.d.ts +22 -0
- package/dist/useSyncStatus.d.ts.map +1 -0
- package/dist/useSyncStatus.js +28 -0
- package/dist/useSyncStatus.js.map +1 -0
- package/package.json +60 -27
- package/src/StoreRegistryContext.tsx +70 -0
- package/src/__snapshots__/useClientDocument.test.tsx.snap +152 -78
- package/src/__snapshots__/useQuery.test.tsx.snap +12 -12
- package/src/__tests__/fixture.tsx +32 -135
- package/src/experimental/components/LiveList.tsx +25 -11
- package/src/mod.ts +8 -12
- package/src/useClientDocument.test.tsx +38 -23
- package/src/useClientDocument.ts +19 -38
- package/src/useQuery.test.tsx +110 -23
- package/src/useQuery.ts +74 -89
- package/src/useRcResource.test.tsx +116 -59
- package/src/useRcResource.ts +52 -38
- package/src/useStore.test.tsx +357 -0
- package/src/useStore.ts +115 -22
- package/src/useSyncStatus.ts +34 -0
- package/dist/LiveStoreContext.d.ts +0 -13
- package/dist/LiveStoreContext.d.ts.map +0 -1
- package/dist/LiveStoreContext.js +0 -3
- package/dist/LiveStoreContext.js.map +0 -1
- package/dist/LiveStoreProvider.d.ts +0 -65
- package/dist/LiveStoreProvider.d.ts.map +0 -1
- package/dist/LiveStoreProvider.js +0 -221
- package/dist/LiveStoreProvider.js.map +0 -1
- package/dist/LiveStoreProvider.test.d.ts +0 -2
- package/dist/LiveStoreProvider.test.d.ts.map +0 -1
- package/dist/LiveStoreProvider.test.js +0 -117
- package/dist/LiveStoreProvider.test.js.map +0 -1
- package/dist/utils/stack-info.d.ts +0 -4
- package/dist/utils/stack-info.d.ts.map +0 -1
- package/dist/utils/stack-info.js +0 -10
- package/dist/utils/stack-info.js.map +0 -1
- package/src/LiveStoreContext.ts +0 -14
- package/src/LiveStoreProvider.test.tsx +0 -248
- package/src/LiveStoreProvider.tsx +0 -413
- package/src/ambient.d.ts +0 -1
- package/src/utils/stack-info.ts +0 -13
package/package.json
CHANGED
|
@@ -1,45 +1,78 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livestore/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-dev.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/livestorejs/livestore.git"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"package.json",
|
|
12
|
+
"src"
|
|
13
|
+
],
|
|
4
14
|
"type": "module",
|
|
5
15
|
"sideEffects": false,
|
|
6
16
|
"exports": {
|
|
7
17
|
".": "./dist/mod.js",
|
|
8
18
|
"./experimental": "./dist/experimental/mod.js"
|
|
9
19
|
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
10
23
|
"dependencies": {
|
|
11
24
|
"@opentelemetry/api": "1.9.0",
|
|
12
|
-
"@livestore/
|
|
13
|
-
"@livestore/livestore": "0.
|
|
14
|
-
"@livestore/utils": "0.
|
|
25
|
+
"@livestore/framework-toolkit": "^0.5.0-dev.0",
|
|
26
|
+
"@livestore/livestore": "^0.5.0-dev.0",
|
|
27
|
+
"@livestore/utils": "^0.5.0-dev.0",
|
|
28
|
+
"@livestore/common": "^0.5.0-dev.0"
|
|
15
29
|
},
|
|
16
30
|
"devDependencies": {
|
|
17
|
-
"@opentelemetry/sdk-trace-base": "
|
|
18
|
-
"@testing-library/dom": "
|
|
19
|
-
"@testing-library/react": "
|
|
20
|
-
"@types/react": "19.
|
|
21
|
-
"@types/react-dom": "19.
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"react
|
|
25
|
-
"react-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"@livestore/
|
|
31
|
+
"@opentelemetry/sdk-trace-base": "2.2.0",
|
|
32
|
+
"@testing-library/dom": "10.4.1",
|
|
33
|
+
"@testing-library/react": "16.3.1",
|
|
34
|
+
"@types/react": "19.2.7",
|
|
35
|
+
"@types/react-dom": "19.2.3",
|
|
36
|
+
"@types/react-window": "1.8.8",
|
|
37
|
+
"jsdom": "26.1.0",
|
|
38
|
+
"react": "19.2.3",
|
|
39
|
+
"react-dom": "19.2.3",
|
|
40
|
+
"react-window": "1.8.11",
|
|
41
|
+
"typescript": "6.0.3",
|
|
42
|
+
"vite": "7.3.1",
|
|
43
|
+
"vitest": "4.1.9",
|
|
44
|
+
"@livestore/utils-dev": "^0.5.0-dev.0",
|
|
45
|
+
"@livestore/adapter-web": "^0.5.0-dev.0"
|
|
31
46
|
},
|
|
32
|
-
"files": [
|
|
33
|
-
"package.json",
|
|
34
|
-
"src",
|
|
35
|
-
"dist"
|
|
36
|
-
],
|
|
37
|
-
"license": "Apache-2.0",
|
|
38
47
|
"peerDependencies": {
|
|
39
|
-
"
|
|
48
|
+
"@effect/opentelemetry": "^4.0.0-rc.111",
|
|
49
|
+
"@effect/platform-browser": "^4.0.0-rc.111",
|
|
50
|
+
"@effect/platform-bun": "^4.0.0-rc.111",
|
|
51
|
+
"@effect/platform-node": "^4.0.0-rc.111",
|
|
52
|
+
"@effect/platform-node-shared": "^4.0.0-rc.111",
|
|
53
|
+
"@effect/vitest": "^4.0.0-rc.111",
|
|
54
|
+
"@opentelemetry/api": "^1.9.0",
|
|
55
|
+
"@opentelemetry/resources": "^2.2.0",
|
|
56
|
+
"@standard-schema/spec": "^1.1.0",
|
|
57
|
+
"effect": "^4.0.0-rc.111",
|
|
58
|
+
"react": "^19.0.0"
|
|
40
59
|
},
|
|
41
|
-
"
|
|
42
|
-
"
|
|
60
|
+
"$genie": {
|
|
61
|
+
"source": "package.json.genie.ts",
|
|
62
|
+
"warning": "DO NOT EDIT - changes will be overwritten",
|
|
63
|
+
"workspaceClosureDirs": [
|
|
64
|
+
"packages/@livestore/adapter-web",
|
|
65
|
+
"packages/@livestore/common",
|
|
66
|
+
"packages/@livestore/common-cf",
|
|
67
|
+
"packages/@livestore/framework-toolkit",
|
|
68
|
+
"packages/@livestore/livestore",
|
|
69
|
+
"packages/@livestore/react",
|
|
70
|
+
"packages/@livestore/sqlite-wasm",
|
|
71
|
+
"packages/@livestore/utils",
|
|
72
|
+
"packages/@livestore/utils-dev",
|
|
73
|
+
"packages/@livestore/wa-sqlite",
|
|
74
|
+
"packages/@livestore/webmesh"
|
|
75
|
+
]
|
|
43
76
|
},
|
|
44
77
|
"scripts": {
|
|
45
78
|
"build": "tsc",
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
|
|
3
|
+
import type { StoreRegistry } from '@livestore/livestore'
|
|
4
|
+
|
|
5
|
+
export const StoreRegistryContext = React.createContext<StoreRegistry | undefined>(undefined)
|
|
6
|
+
|
|
7
|
+
export type StoreRegistryProviderProps = {
|
|
8
|
+
storeRegistry: StoreRegistry
|
|
9
|
+
children: React.ReactNode
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* React context provider that makes a {@link StoreRegistry} available to descendant components.
|
|
14
|
+
*
|
|
15
|
+
* Wrap your application (or a subtree) with this provider to enable {@link useStore} and
|
|
16
|
+
* {@link useStoreRegistry} hooks within that tree.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import { StoreRegistry } from '@livestore/livestore'
|
|
21
|
+
* import { StoreRegistryProvider } from '@livestore/react'
|
|
22
|
+
* import { unstable_batchedUpdates as batchUpdates } from 'react-dom'
|
|
23
|
+
*
|
|
24
|
+
* const storeRegistry = new StoreRegistry({
|
|
25
|
+
* defaultOptions: { batchUpdates }
|
|
26
|
+
* })
|
|
27
|
+
*
|
|
28
|
+
* function App() {
|
|
29
|
+
* return (
|
|
30
|
+
* <StoreRegistryProvider storeRegistry={storeRegistry}>
|
|
31
|
+
* <MyComponent />
|
|
32
|
+
* </StoreRegistryProvider>
|
|
33
|
+
* )
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export const StoreRegistryProvider = ({ storeRegistry, children }: StoreRegistryProviderProps): React.JSX.Element => {
|
|
38
|
+
return <StoreRegistryContext value={storeRegistry}>{children}</StoreRegistryContext>
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Hook to access the {@link StoreRegistry} from context. Useful for advanced operations like preloading.
|
|
43
|
+
*
|
|
44
|
+
* @param override - Optional registry to use instead of the context value.
|
|
45
|
+
* When provided, skips context lookup entirely.
|
|
46
|
+
* @returns The registry provided by the nearest {@link StoreRegistryProvider} ancestor, or the `override` if provided.
|
|
47
|
+
* @throws Error if called outside a {@link StoreRegistryProvider} and no override is provided
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* function PreloadButton({ issueId }: { issueId: string }) {
|
|
52
|
+
* const storeRegistry = useStoreRegistry()
|
|
53
|
+
*
|
|
54
|
+
* const handleMouseEnter = () => {
|
|
55
|
+
* storeRegistry.preload(issueStoreOptions(issueId))
|
|
56
|
+
* }
|
|
57
|
+
*
|
|
58
|
+
* return <button onMouseEnter={handleMouseEnter}>View Issue</button>
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export const useStoreRegistry = (override?: StoreRegistry) => {
|
|
63
|
+
if (override !== undefined) return override
|
|
64
|
+
|
|
65
|
+
const storeRegistry = React.use(StoreRegistryContext)
|
|
66
|
+
|
|
67
|
+
if (storeRegistry == null) throw new Error('useStoreRegistry() must be used within <StoreRegistryProvider>')
|
|
68
|
+
|
|
69
|
+
return storeRegistry
|
|
70
|
+
}
|
|
@@ -8,6 +8,9 @@ exports[`useClientDocument > otel > should update the data based on component ke
|
|
|
8
8
|
"storeId": "default",
|
|
9
9
|
},
|
|
10
10
|
"children": [
|
|
11
|
+
{
|
|
12
|
+
"_name": "makeClientSessionSyncProcessor",
|
|
13
|
+
},
|
|
11
14
|
{
|
|
12
15
|
"_name": "livestore.in-memory-db:execute",
|
|
13
16
|
"attributes": {
|
|
@@ -21,29 +24,25 @@ exports[`useClientDocument > otel > should update the data based on component ke
|
|
|
21
24
|
},
|
|
22
25
|
},
|
|
23
26
|
{
|
|
24
|
-
"_name": "
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"_name": "LiveStore:sync",
|
|
27
|
+
"_name": "client-session-sync-processor:boot",
|
|
28
|
+
"children": [
|
|
29
|
+
{
|
|
30
|
+
"_name": "client-session-sync-processor:pull",
|
|
31
|
+
"attributes": {
|
|
32
|
+
"span.label": "⚠︎ Interrupted",
|
|
33
|
+
"status.interrupted": true,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"_name": "@livestore/common:LeaderSyncProcessor:push",
|
|
38
|
+
"attributes": {
|
|
39
|
+
"batch": "undefined",
|
|
40
|
+
"batchSize": 1,
|
|
41
|
+
"span.label": "⚠︎ Interrupted",
|
|
42
|
+
"status.interrupted": true,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
],
|
|
47
46
|
},
|
|
48
47
|
{
|
|
49
48
|
"_name": "LiveStore:commits",
|
|
@@ -194,14 +193,10 @@ exports[`useClientDocument > otel > should update the data based on component ke
|
|
|
194
193
|
},
|
|
195
194
|
"children": [
|
|
196
195
|
{
|
|
197
|
-
"_name": "client-session-sync-processor:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
"UserInfoSet": 1
|
|
202
|
-
}",
|
|
203
|
-
"mergeResultTag": "advance",
|
|
204
|
-
},
|
|
196
|
+
"_name": "client-session-sync-processor:encode-events",
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"_name": "client-session-sync-processor:materialize-events",
|
|
205
200
|
"children": [
|
|
206
201
|
{
|
|
207
202
|
"_name": "client-session-sync-processor:materialize-event",
|
|
@@ -216,10 +211,33 @@ exports[`useClientDocument > otel > should update the data based on component ke
|
|
|
216
211
|
",
|
|
217
212
|
},
|
|
218
213
|
},
|
|
214
|
+
{
|
|
215
|
+
"_name": "@livestore/common:execSql",
|
|
216
|
+
"attributes": {
|
|
217
|
+
"bindValueKeys": "[
|
|
218
|
+
"$id",
|
|
219
|
+
"$seqNumGlobal",
|
|
220
|
+
"$seqNumClient",
|
|
221
|
+
"$seqNumRebaseGeneration"
|
|
222
|
+
]",
|
|
223
|
+
"span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
224
|
+
"sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
225
|
+
},
|
|
226
|
+
},
|
|
219
227
|
],
|
|
220
228
|
},
|
|
221
229
|
],
|
|
222
230
|
},
|
|
231
|
+
{
|
|
232
|
+
"_name": "client-session-sync-processor:push",
|
|
233
|
+
"attributes": {
|
|
234
|
+
"batchSize": 1,
|
|
235
|
+
"eventCounts": "{
|
|
236
|
+
"UserInfoSet": 1
|
|
237
|
+
}",
|
|
238
|
+
"mergeResultTag": "advance",
|
|
239
|
+
},
|
|
240
|
+
},
|
|
223
241
|
],
|
|
224
242
|
},
|
|
225
243
|
{
|
|
@@ -232,14 +250,10 @@ exports[`useClientDocument > otel > should update the data based on component ke
|
|
|
232
250
|
},
|
|
233
251
|
"children": [
|
|
234
252
|
{
|
|
235
|
-
"_name": "client-session-sync-processor:
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
"UserInfoSet": 1
|
|
240
|
-
}",
|
|
241
|
-
"mergeResultTag": "advance",
|
|
242
|
-
},
|
|
253
|
+
"_name": "client-session-sync-processor:encode-events",
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"_name": "client-session-sync-processor:materialize-events",
|
|
243
257
|
"children": [
|
|
244
258
|
{
|
|
245
259
|
"_name": "client-session-sync-processor:materialize-event",
|
|
@@ -254,10 +268,33 @@ exports[`useClientDocument > otel > should update the data based on component ke
|
|
|
254
268
|
",
|
|
255
269
|
},
|
|
256
270
|
},
|
|
271
|
+
{
|
|
272
|
+
"_name": "@livestore/common:execSql",
|
|
273
|
+
"attributes": {
|
|
274
|
+
"bindValueKeys": "[
|
|
275
|
+
"$id",
|
|
276
|
+
"$seqNumGlobal",
|
|
277
|
+
"$seqNumClient",
|
|
278
|
+
"$seqNumRebaseGeneration"
|
|
279
|
+
]",
|
|
280
|
+
"span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
281
|
+
"sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
282
|
+
},
|
|
283
|
+
},
|
|
257
284
|
],
|
|
258
285
|
},
|
|
259
286
|
],
|
|
260
287
|
},
|
|
288
|
+
{
|
|
289
|
+
"_name": "client-session-sync-processor:push",
|
|
290
|
+
"attributes": {
|
|
291
|
+
"batchSize": 1,
|
|
292
|
+
"eventCounts": "{
|
|
293
|
+
"UserInfoSet": 1
|
|
294
|
+
}",
|
|
295
|
+
"mergeResultTag": "advance",
|
|
296
|
+
},
|
|
297
|
+
},
|
|
261
298
|
],
|
|
262
299
|
},
|
|
263
300
|
]
|
|
@@ -271,6 +308,9 @@ exports[`useClientDocument > otel > should update the data based on component ke
|
|
|
271
308
|
"storeId": "default",
|
|
272
309
|
},
|
|
273
310
|
"children": [
|
|
311
|
+
{
|
|
312
|
+
"_name": "makeClientSessionSyncProcessor",
|
|
313
|
+
},
|
|
274
314
|
{
|
|
275
315
|
"_name": "livestore.in-memory-db:execute",
|
|
276
316
|
"attributes": {
|
|
@@ -284,29 +324,25 @@ exports[`useClientDocument > otel > should update the data based on component ke
|
|
|
284
324
|
},
|
|
285
325
|
},
|
|
286
326
|
{
|
|
287
|
-
"_name": "
|
|
288
|
-
"
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
"_name": "LiveStore:sync",
|
|
327
|
+
"_name": "client-session-sync-processor:boot",
|
|
328
|
+
"children": [
|
|
329
|
+
{
|
|
330
|
+
"_name": "client-session-sync-processor:pull",
|
|
331
|
+
"attributes": {
|
|
332
|
+
"span.label": "⚠︎ Interrupted",
|
|
333
|
+
"status.interrupted": true,
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"_name": "@livestore/common:LeaderSyncProcessor:push",
|
|
338
|
+
"attributes": {
|
|
339
|
+
"batch": "undefined",
|
|
340
|
+
"batchSize": 1,
|
|
341
|
+
"span.label": "⚠︎ Interrupted",
|
|
342
|
+
"status.interrupted": true,
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
],
|
|
310
346
|
},
|
|
311
347
|
{
|
|
312
348
|
"_name": "LiveStore:commits",
|
|
@@ -395,14 +431,10 @@ exports[`useClientDocument > otel > should update the data based on component ke
|
|
|
395
431
|
},
|
|
396
432
|
"children": [
|
|
397
433
|
{
|
|
398
|
-
"_name": "client-session-sync-processor:
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
"UserInfoSet": 1
|
|
403
|
-
}",
|
|
404
|
-
"mergeResultTag": "advance",
|
|
405
|
-
},
|
|
434
|
+
"_name": "client-session-sync-processor:encode-events",
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"_name": "client-session-sync-processor:materialize-events",
|
|
406
438
|
"children": [
|
|
407
439
|
{
|
|
408
440
|
"_name": "client-session-sync-processor:materialize-event",
|
|
@@ -417,10 +449,33 @@ exports[`useClientDocument > otel > should update the data based on component ke
|
|
|
417
449
|
",
|
|
418
450
|
},
|
|
419
451
|
},
|
|
452
|
+
{
|
|
453
|
+
"_name": "@livestore/common:execSql",
|
|
454
|
+
"attributes": {
|
|
455
|
+
"bindValueKeys": "[
|
|
456
|
+
"$id",
|
|
457
|
+
"$seqNumGlobal",
|
|
458
|
+
"$seqNumClient",
|
|
459
|
+
"$seqNumRebaseGeneration"
|
|
460
|
+
]",
|
|
461
|
+
"span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
462
|
+
"sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
463
|
+
},
|
|
464
|
+
},
|
|
420
465
|
],
|
|
421
466
|
},
|
|
422
467
|
],
|
|
423
468
|
},
|
|
469
|
+
{
|
|
470
|
+
"_name": "client-session-sync-processor:push",
|
|
471
|
+
"attributes": {
|
|
472
|
+
"batchSize": 1,
|
|
473
|
+
"eventCounts": "{
|
|
474
|
+
"UserInfoSet": 1
|
|
475
|
+
}",
|
|
476
|
+
"mergeResultTag": "advance",
|
|
477
|
+
},
|
|
478
|
+
},
|
|
424
479
|
],
|
|
425
480
|
},
|
|
426
481
|
{
|
|
@@ -433,14 +488,10 @@ exports[`useClientDocument > otel > should update the data based on component ke
|
|
|
433
488
|
},
|
|
434
489
|
"children": [
|
|
435
490
|
{
|
|
436
|
-
"_name": "client-session-sync-processor:
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
"UserInfoSet": 1
|
|
441
|
-
}",
|
|
442
|
-
"mergeResultTag": "advance",
|
|
443
|
-
},
|
|
491
|
+
"_name": "client-session-sync-processor:encode-events",
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"_name": "client-session-sync-processor:materialize-events",
|
|
444
495
|
"children": [
|
|
445
496
|
{
|
|
446
497
|
"_name": "client-session-sync-processor:materialize-event",
|
|
@@ -455,10 +506,33 @@ exports[`useClientDocument > otel > should update the data based on component ke
|
|
|
455
506
|
",
|
|
456
507
|
},
|
|
457
508
|
},
|
|
509
|
+
{
|
|
510
|
+
"_name": "@livestore/common:execSql",
|
|
511
|
+
"attributes": {
|
|
512
|
+
"bindValueKeys": "[
|
|
513
|
+
"$id",
|
|
514
|
+
"$seqNumGlobal",
|
|
515
|
+
"$seqNumClient",
|
|
516
|
+
"$seqNumRebaseGeneration"
|
|
517
|
+
]",
|
|
518
|
+
"span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
519
|
+
"sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
520
|
+
},
|
|
521
|
+
},
|
|
458
522
|
],
|
|
459
523
|
},
|
|
460
524
|
],
|
|
461
525
|
},
|
|
526
|
+
{
|
|
527
|
+
"_name": "client-session-sync-processor:push",
|
|
528
|
+
"attributes": {
|
|
529
|
+
"batchSize": 1,
|
|
530
|
+
"eventCounts": "{
|
|
531
|
+
"UserInfoSet": 1
|
|
532
|
+
}",
|
|
533
|
+
"mergeResultTag": "advance",
|
|
534
|
+
},
|
|
535
|
+
},
|
|
462
536
|
],
|
|
463
537
|
},
|
|
464
538
|
]
|
|
@@ -101,7 +101,7 @@ exports[`useQuery (strictMode={ strictMode: false }) > filtered dependency query
|
|
|
101
101
|
},
|
|
102
102
|
"previousResult": {
|
|
103
103
|
"_tag": "Some",
|
|
104
|
-
"value": "{"query":"SELECT * FROM 'todos' WHERE id = ?","bindValues":["t1"],"queriedTables":{}}",
|
|
104
|
+
"value": "{"query":"SELECT * FROM 'todos' WHERE \\"id\\" = ?","bindValues":["t1"],"queriedTables":{}}",
|
|
105
105
|
},
|
|
106
106
|
"recomputations": 1,
|
|
107
107
|
"sub": [
|
|
@@ -158,7 +158,7 @@ exports[`useQuery (strictMode={ strictMode: false }) > filtered dependency query
|
|
|
158
158
|
"id": "node-9",
|
|
159
159
|
"invocations": 1,
|
|
160
160
|
"isDestroyed": false,
|
|
161
|
-
"label": "subscribe:SELECT * FROM 'todos' WHERE id = ?",
|
|
161
|
+
"label": "subscribe:SELECT * FROM 'todos' WHERE "id" = ?",
|
|
162
162
|
"sub": [
|
|
163
163
|
"node-7",
|
|
164
164
|
],
|
|
@@ -268,7 +268,7 @@ exports[`useQuery (strictMode={ strictMode: false }) > filtered dependency query
|
|
|
268
268
|
},
|
|
269
269
|
"previousResult": {
|
|
270
270
|
"_tag": "Some",
|
|
271
|
-
"value": "{"query":"SELECT * FROM 'todos' WHERE id = ?","bindValues":["t1"],"queriedTables":{}}",
|
|
271
|
+
"value": "{"query":"SELECT * FROM 'todos' WHERE \\"id\\" = ?","bindValues":["t1"],"queriedTables":{}}",
|
|
272
272
|
},
|
|
273
273
|
"recomputations": 1,
|
|
274
274
|
"sub": [
|
|
@@ -325,7 +325,7 @@ exports[`useQuery (strictMode={ strictMode: false }) > filtered dependency query
|
|
|
325
325
|
"id": "node-9",
|
|
326
326
|
"invocations": 2,
|
|
327
327
|
"isDestroyed": false,
|
|
328
|
-
"label": "subscribe:SELECT * FROM 'todos' WHERE id = ?",
|
|
328
|
+
"label": "subscribe:SELECT * FROM 'todos' WHERE "id" = ?",
|
|
329
329
|
"sub": [
|
|
330
330
|
"node-7",
|
|
331
331
|
],
|
|
@@ -435,7 +435,7 @@ exports[`useQuery (strictMode={ strictMode: false }) > filtered dependency query
|
|
|
435
435
|
},
|
|
436
436
|
"previousResult": {
|
|
437
437
|
"_tag": "Some",
|
|
438
|
-
"value": "{"query":"SELECT * FROM 'todos' WHERE id = ?","bindValues":["t2"],"queriedTables":{}}",
|
|
438
|
+
"value": "{"query":"SELECT * FROM 'todos' WHERE \\"id\\" = ?","bindValues":["t2"],"queriedTables":{}}",
|
|
439
439
|
},
|
|
440
440
|
"recomputations": 2,
|
|
441
441
|
"sub": [
|
|
@@ -492,7 +492,7 @@ exports[`useQuery (strictMode={ strictMode: false }) > filtered dependency query
|
|
|
492
492
|
"id": "node-9",
|
|
493
493
|
"invocations": 3,
|
|
494
494
|
"isDestroyed": false,
|
|
495
|
-
"label": "subscribe:SELECT * FROM 'todos' WHERE id = ?",
|
|
495
|
+
"label": "subscribe:SELECT * FROM 'todos' WHERE "id" = ?",
|
|
496
496
|
"sub": [
|
|
497
497
|
"node-7",
|
|
498
498
|
],
|
|
@@ -1242,7 +1242,7 @@ exports[`useQuery (strictMode={ strictMode: true }) > filtered dependency query
|
|
|
1242
1242
|
},
|
|
1243
1243
|
"previousResult": {
|
|
1244
1244
|
"_tag": "Some",
|
|
1245
|
-
"value": "{"query":"SELECT * FROM 'todos' WHERE id = ?","bindValues":["t1"],"queriedTables":{}}",
|
|
1245
|
+
"value": "{"query":"SELECT * FROM 'todos' WHERE \\"id\\" = ?","bindValues":["t1"],"queriedTables":{}}",
|
|
1246
1246
|
},
|
|
1247
1247
|
"recomputations": 1,
|
|
1248
1248
|
"sub": [
|
|
@@ -1299,7 +1299,7 @@ exports[`useQuery (strictMode={ strictMode: true }) > filtered dependency query
|
|
|
1299
1299
|
"id": "node-9",
|
|
1300
1300
|
"invocations": 1,
|
|
1301
1301
|
"isDestroyed": false,
|
|
1302
|
-
"label": "subscribe:SELECT * FROM 'todos' WHERE id = ?",
|
|
1302
|
+
"label": "subscribe:SELECT * FROM 'todos' WHERE "id" = ?",
|
|
1303
1303
|
"sub": [
|
|
1304
1304
|
"node-7",
|
|
1305
1305
|
],
|
|
@@ -1409,7 +1409,7 @@ exports[`useQuery (strictMode={ strictMode: true }) > filtered dependency query
|
|
|
1409
1409
|
},
|
|
1410
1410
|
"previousResult": {
|
|
1411
1411
|
"_tag": "Some",
|
|
1412
|
-
"value": "{"query":"SELECT * FROM 'todos' WHERE id = ?","bindValues":["t1"],"queriedTables":{}}",
|
|
1412
|
+
"value": "{"query":"SELECT * FROM 'todos' WHERE \\"id\\" = ?","bindValues":["t1"],"queriedTables":{}}",
|
|
1413
1413
|
},
|
|
1414
1414
|
"recomputations": 1,
|
|
1415
1415
|
"sub": [
|
|
@@ -1466,7 +1466,7 @@ exports[`useQuery (strictMode={ strictMode: true }) > filtered dependency query
|
|
|
1466
1466
|
"id": "node-9",
|
|
1467
1467
|
"invocations": 2,
|
|
1468
1468
|
"isDestroyed": false,
|
|
1469
|
-
"label": "subscribe:SELECT * FROM 'todos' WHERE id = ?",
|
|
1469
|
+
"label": "subscribe:SELECT * FROM 'todos' WHERE "id" = ?",
|
|
1470
1470
|
"sub": [
|
|
1471
1471
|
"node-7",
|
|
1472
1472
|
],
|
|
@@ -1576,7 +1576,7 @@ exports[`useQuery (strictMode={ strictMode: true }) > filtered dependency query
|
|
|
1576
1576
|
},
|
|
1577
1577
|
"previousResult": {
|
|
1578
1578
|
"_tag": "Some",
|
|
1579
|
-
"value": "{"query":"SELECT * FROM 'todos' WHERE id = ?","bindValues":["t2"],"queriedTables":{}}",
|
|
1579
|
+
"value": "{"query":"SELECT * FROM 'todos' WHERE \\"id\\" = ?","bindValues":["t2"],"queriedTables":{}}",
|
|
1580
1580
|
},
|
|
1581
1581
|
"recomputations": 2,
|
|
1582
1582
|
"sub": [
|
|
@@ -1633,7 +1633,7 @@ exports[`useQuery (strictMode={ strictMode: true }) > filtered dependency query
|
|
|
1633
1633
|
"id": "node-9",
|
|
1634
1634
|
"invocations": 3,
|
|
1635
1635
|
"isDestroyed": false,
|
|
1636
|
-
"label": "subscribe:SELECT * FROM 'todos' WHERE id = ?",
|
|
1636
|
+
"label": "subscribe:SELECT * FROM 'todos' WHERE "id" = ?",
|
|
1637
1637
|
"sub": [
|
|
1638
1638
|
"node-7",
|
|
1639
1639
|
],
|