@livestore/react 0.4.0-dev.3 → 0.4.0-dev.5

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.
@@ -47,29 +47,6 @@ exports[`useClientDocument > otel > should update the data based on component ke
47
47
  },
48
48
  {
49
49
  "_name": "LiveStore:commits",
50
- "children": [
51
- {
52
- "_name": "LiveStore:commit",
53
- "attributes": {
54
- "livestore.eventTags": [
55
- "UserInfoSet",
56
- ],
57
- "livestore.eventsCount": 1,
58
- },
59
- "children": [
60
- {
61
- "_name": "livestore.in-memory-db:execute",
62
- "attributes": {
63
- "sql.query": "
64
- INSERT INTO 'UserInfo' (id, value)
65
- VALUES (?, ?)
66
- ON CONFLICT (id) DO UPDATE SET value = json_set(value, ?, json(?))
67
- ",
68
- },
69
- },
70
- ],
71
- },
72
- ],
73
50
  },
74
51
  {
75
52
  "_name": "LiveStore:queries",
@@ -89,28 +66,6 @@ exports[`useClientDocument > otel > should update the data based on component ke
89
66
  "sql.rowsCount": 0,
90
67
  },
91
68
  },
92
- {
93
- "_name": "LiveStore:commit",
94
- "attributes": {
95
- "livestore.commitLabel": "UserInfo.set:u1",
96
- "livestore.eventTags": [
97
- "UserInfoSet",
98
- ],
99
- "livestore.eventsCount": 1,
100
- },
101
- "children": [
102
- {
103
- "_name": "livestore.in-memory-db:execute",
104
- "attributes": {
105
- "sql.query": "
106
- INSERT INTO 'UserInfo' (id, value)
107
- VALUES (?, ?)
108
- ON CONFLICT (id) DO UPDATE SET value = json_set(json_set(value, ?, json(?)), ?, json(?))
109
- ",
110
- },
111
- },
112
- ],
113
- },
114
69
  {
115
70
  "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
116
71
  "attributes": {
@@ -226,6 +181,88 @@ exports[`useClientDocument > otel > should update the data based on component ke
226
181
  }
227
182
  `;
228
183
 
184
+ exports[`useClientDocument > otel > should update the data based on component key strictMode={ strictMode: false } 2`] = `
185
+ [
186
+ {
187
+ "_name": "LiveStore:commit",
188
+ "attributes": {
189
+ "livestore.commitLabel": "UserInfo.set:u1",
190
+ "livestore.eventTags": "[
191
+ "UserInfoSet"
192
+ ]",
193
+ "livestore.eventsCount": 1,
194
+ },
195
+ "children": [
196
+ {
197
+ "_name": "client-session-sync-processor:push",
198
+ "attributes": {
199
+ "batchSize": 1,
200
+ "eventCounts": "{
201
+ "UserInfoSet": 1
202
+ }",
203
+ "mergeResultTag": "advance",
204
+ },
205
+ "children": [
206
+ {
207
+ "_name": "client-session-sync-processor:materialize-event",
208
+ "children": [
209
+ {
210
+ "_name": "livestore.in-memory-db:execute",
211
+ "attributes": {
212
+ "sql.query": "
213
+ INSERT INTO 'UserInfo' (id, value)
214
+ VALUES (?, ?)
215
+ ON CONFLICT (id) DO UPDATE SET value = json_set(json_set(value, ?, json(?)), ?, json(?))
216
+ ",
217
+ },
218
+ },
219
+ ],
220
+ },
221
+ ],
222
+ },
223
+ ],
224
+ },
225
+ {
226
+ "_name": "LiveStore:commit",
227
+ "attributes": {
228
+ "livestore.eventTags": "[
229
+ "UserInfoSet"
230
+ ]",
231
+ "livestore.eventsCount": 1,
232
+ },
233
+ "children": [
234
+ {
235
+ "_name": "client-session-sync-processor:push",
236
+ "attributes": {
237
+ "batchSize": 1,
238
+ "eventCounts": "{
239
+ "UserInfoSet": 1
240
+ }",
241
+ "mergeResultTag": "advance",
242
+ },
243
+ "children": [
244
+ {
245
+ "_name": "client-session-sync-processor:materialize-event",
246
+ "children": [
247
+ {
248
+ "_name": "livestore.in-memory-db:execute",
249
+ "attributes": {
250
+ "sql.query": "
251
+ INSERT INTO 'UserInfo' (id, value)
252
+ VALUES (?, ?)
253
+ ON CONFLICT (id) DO UPDATE SET value = json_set(value, ?, json(?))
254
+ ",
255
+ },
256
+ },
257
+ ],
258
+ },
259
+ ],
260
+ },
261
+ ],
262
+ },
263
+ ]
264
+ `;
265
+
229
266
  exports[`useClientDocument > otel > should update the data based on component key strictMode={ strictMode: true } 1`] = `
230
267
  {
231
268
  "_name": "createStore",
@@ -273,29 +310,6 @@ exports[`useClientDocument > otel > should update the data based on component ke
273
310
  },
274
311
  {
275
312
  "_name": "LiveStore:commits",
276
- "children": [
277
- {
278
- "_name": "LiveStore:commit",
279
- "attributes": {
280
- "livestore.eventTags": [
281
- "UserInfoSet",
282
- ],
283
- "livestore.eventsCount": 1,
284
- },
285
- "children": [
286
- {
287
- "_name": "livestore.in-memory-db:execute",
288
- "attributes": {
289
- "sql.query": "
290
- INSERT INTO 'UserInfo' (id, value)
291
- VALUES (?, ?)
292
- ON CONFLICT (id) DO UPDATE SET value = json_set(value, ?, json(?))
293
- ",
294
- },
295
- },
296
- ],
297
- },
298
- ],
299
313
  },
300
314
  {
301
315
  "_name": "LiveStore:queries",
@@ -315,28 +329,6 @@ exports[`useClientDocument > otel > should update the data based on component ke
315
329
  "sql.rowsCount": 0,
316
330
  },
317
331
  },
318
- {
319
- "_name": "LiveStore:commit",
320
- "attributes": {
321
- "livestore.commitLabel": "UserInfo.set:u1",
322
- "livestore.eventTags": [
323
- "UserInfoSet",
324
- ],
325
- "livestore.eventsCount": 1,
326
- },
327
- "children": [
328
- {
329
- "_name": "livestore.in-memory-db:execute",
330
- "attributes": {
331
- "sql.query": "
332
- INSERT INTO 'UserInfo' (id, value)
333
- VALUES (?, ?)
334
- ON CONFLICT (id) DO UPDATE SET value = json_set(json_set(value, ?, json(?)), ?, json(?))
335
- ",
336
- },
337
- },
338
- ],
339
- },
340
332
  {
341
333
  "_name": "db:SELECT * FROM 'UserInfo' WHERE id = ?",
342
334
  "attributes": {
@@ -390,6 +382,88 @@ exports[`useClientDocument > otel > should update the data based on component ke
390
382
  }
391
383
  `;
392
384
 
385
+ exports[`useClientDocument > otel > should update the data based on component key strictMode={ strictMode: true } 2`] = `
386
+ [
387
+ {
388
+ "_name": "LiveStore:commit",
389
+ "attributes": {
390
+ "livestore.commitLabel": "UserInfo.set:u1",
391
+ "livestore.eventTags": "[
392
+ "UserInfoSet"
393
+ ]",
394
+ "livestore.eventsCount": 1,
395
+ },
396
+ "children": [
397
+ {
398
+ "_name": "client-session-sync-processor:push",
399
+ "attributes": {
400
+ "batchSize": 1,
401
+ "eventCounts": "{
402
+ "UserInfoSet": 1
403
+ }",
404
+ "mergeResultTag": "advance",
405
+ },
406
+ "children": [
407
+ {
408
+ "_name": "client-session-sync-processor:materialize-event",
409
+ "children": [
410
+ {
411
+ "_name": "livestore.in-memory-db:execute",
412
+ "attributes": {
413
+ "sql.query": "
414
+ INSERT INTO 'UserInfo' (id, value)
415
+ VALUES (?, ?)
416
+ ON CONFLICT (id) DO UPDATE SET value = json_set(json_set(value, ?, json(?)), ?, json(?))
417
+ ",
418
+ },
419
+ },
420
+ ],
421
+ },
422
+ ],
423
+ },
424
+ ],
425
+ },
426
+ {
427
+ "_name": "LiveStore:commit",
428
+ "attributes": {
429
+ "livestore.eventTags": "[
430
+ "UserInfoSet"
431
+ ]",
432
+ "livestore.eventsCount": 1,
433
+ },
434
+ "children": [
435
+ {
436
+ "_name": "client-session-sync-processor:push",
437
+ "attributes": {
438
+ "batchSize": 1,
439
+ "eventCounts": "{
440
+ "UserInfoSet": 1
441
+ }",
442
+ "mergeResultTag": "advance",
443
+ },
444
+ "children": [
445
+ {
446
+ "_name": "client-session-sync-processor:materialize-event",
447
+ "children": [
448
+ {
449
+ "_name": "livestore.in-memory-db:execute",
450
+ "attributes": {
451
+ "sql.query": "
452
+ INSERT INTO 'UserInfo' (id, value)
453
+ VALUES (?, ?)
454
+ ON CONFLICT (id) DO UPDATE SET value = json_set(value, ?, json(?))
455
+ ",
456
+ },
457
+ },
458
+ ],
459
+ },
460
+ ],
461
+ },
462
+ ],
463
+ },
464
+ ]
465
+ `;
466
+
393
467
  exports[`useClientDocument > should update the data based on component key 1`] = `
394
468
  {
395
469
  "atoms": [
@@ -443,7 +517,7 @@ exports[`useClientDocument > should update the data based on component key 1`] =
443
517
  "refreshes": 1,
444
518
  "sub": [],
445
519
  "super": [
446
- "node-5",
520
+ "node-6",
447
521
  ],
448
522
  },
449
523
  {
@@ -464,10 +538,27 @@ exports[`useClientDocument > should update the data based on component key 1`] =
464
538
  "super": [],
465
539
  },
466
540
  {
467
- "_tag": "thunk",
541
+ "_tag": "ref",
468
542
  "id": "node-5",
469
543
  "isDestroyed": false,
470
544
  "isDirty": false,
545
+ "label": "tableRef:Kv",
546
+ "meta": {
547
+ "liveStoreRefType": "table",
548
+ },
549
+ "previousResult": {
550
+ "_tag": "Some",
551
+ "value": "null",
552
+ },
553
+ "refreshes": 0,
554
+ "sub": [],
555
+ "super": [],
556
+ },
557
+ {
558
+ "_tag": "thunk",
559
+ "id": "node-6",
560
+ "isDestroyed": false,
561
+ "isDirty": false,
471
562
  "label": "UserInfo.get:u1:results",
472
563
  "meta": {
473
564
  "liveStoreThunkType": "db.result",
@@ -481,7 +572,7 @@ exports[`useClientDocument > should update the data based on component key 1`] =
481
572
  "node-3",
482
573
  ],
483
574
  "super": [
484
- "node-6",
575
+ "node-7",
485
576
  ],
486
577
  },
487
578
  ],
@@ -489,12 +580,12 @@ exports[`useClientDocument > should update the data based on component key 1`] =
489
580
  "effects": [
490
581
  {
491
582
  "_tag": "effect",
492
- "id": "node-6",
583
+ "id": "node-7",
493
584
  "invocations": 1,
494
585
  "isDestroyed": false,
495
586
  "label": "subscribe:UserInfo.get:u1",
496
587
  "sub": [
497
- "node-5",
588
+ "node-6",
498
589
  ],
499
590
  },
500
591
  ],
@@ -554,7 +645,7 @@ exports[`useClientDocument > should update the data based on component key 2`] =
554
645
  "refreshes": 2,
555
646
  "sub": [],
556
647
  "super": [
557
- "node-7",
648
+ "node-8",
558
649
  ],
559
650
  },
560
651
  {
@@ -574,9 +665,26 @@ exports[`useClientDocument > should update the data based on component key 2`] =
574
665
  "sub": [],
575
666
  "super": [],
576
667
  },
668
+ {
669
+ "_tag": "ref",
670
+ "id": "node-5",
671
+ "isDestroyed": false,
672
+ "isDirty": false,
673
+ "label": "tableRef:Kv",
674
+ "meta": {
675
+ "liveStoreRefType": "table",
676
+ },
677
+ "previousResult": {
678
+ "_tag": "Some",
679
+ "value": "null",
680
+ },
681
+ "refreshes": 0,
682
+ "sub": [],
683
+ "super": [],
684
+ },
577
685
  {
578
686
  "_tag": "thunk",
579
- "id": "node-7",
687
+ "id": "node-8",
580
688
  "isDestroyed": false,
581
689
  "isDirty": false,
582
690
  "label": "UserInfo.get:u2:results",
@@ -592,7 +700,7 @@ exports[`useClientDocument > should update the data based on component key 2`] =
592
700
  "node-3",
593
701
  ],
594
702
  "super": [
595
- "node-8",
703
+ "node-9",
596
704
  ],
597
705
  },
598
706
  ],
@@ -600,12 +708,12 @@ exports[`useClientDocument > should update the data based on component key 2`] =
600
708
  "effects": [
601
709
  {
602
710
  "_tag": "effect",
603
- "id": "node-8",
711
+ "id": "node-9",
604
712
  "invocations": 1,
605
713
  "isDestroyed": false,
606
714
  "label": "subscribe:UserInfo.get:u2",
607
715
  "sub": [
608
- "node-7",
716
+ "node-8",
609
717
  ],
610
718
  },
611
719
  ],