tinybase 6.1.1 → 6.1.2
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/@types/persisters/index.d.ts +2 -2
- package/@types/persisters/with-schemas/index.d.ts +2 -2
- package/@types/relationships/index.d.ts +2 -2
- package/@types/relationships/with-schemas/index.d.ts +2 -2
- package/@types/store/index.d.ts +1 -1
- package/@types/store/with-schemas/index.d.ts +1 -1
- package/@types/synchronizers/synchronizer-ws-server-durable-object/index.d.ts +1 -1
- package/@types/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.d.ts +1 -1
- package/package.json +224 -224
- package/readme.md +2 -2
- package/releases.md +1 -1
|
@@ -200,9 +200,9 @@ export type PersistedChanges<
|
|
|
200
200
|
* neither are present, the content will be loaded using the Persister's load
|
|
201
201
|
* method. Prior to v5.0, these parameters were callbacks and the overall type
|
|
202
202
|
* was non-generic.
|
|
203
|
-
* @param content If provided, this is a Content object from the
|
|
203
|
+
* @param content If provided, this is a Content object from the Persister
|
|
204
204
|
* that will be used to immediately wholesale update the Store.
|
|
205
|
-
* @param changes If provided, this is a Changes object from the
|
|
205
|
+
* @param changes If provided, this is a Changes object from the Persister
|
|
206
206
|
* that will be used to immediately incrementally update the Store. This takes
|
|
207
207
|
* priority over the content argument above if present.
|
|
208
208
|
* @category Creation
|
|
@@ -255,9 +255,9 @@ export type PersistedChanges<
|
|
|
255
255
|
* neither are present, the content will be loaded using the Persister's load
|
|
256
256
|
* method. Prior to v5.0, these parameters were callbacks and the overall type
|
|
257
257
|
* was non-generic.
|
|
258
|
-
* @param content If provided, this is a Content object from the
|
|
258
|
+
* @param content If provided, this is a Content object from the Persister
|
|
259
259
|
* that will be used to immediately wholesale update the Store.
|
|
260
|
-
* @param changes If provided, this is a Changes object from the
|
|
260
|
+
* @param changes If provided, this is a Changes object from the Persister
|
|
261
261
|
* that will be used to immediately incrementally update the Store. This takes
|
|
262
262
|
* priority over the content argument above if present.
|
|
263
263
|
* @category Creation
|
|
@@ -125,10 +125,10 @@ export type LocalRowIdsListener = (
|
|
|
125
125
|
*
|
|
126
126
|
* When called, a LinkedRowIdsListener is given a reference to the Relationships
|
|
127
127
|
* object, the Id of the Relationship that changed, and the Id of the first Row
|
|
128
|
-
* of the
|
|
128
|
+
* of the linked list whose members changed.
|
|
129
129
|
* @param relationships A reference to the Relationships object that changed.
|
|
130
130
|
* @param relationshipId The Id of the Relationship that changed.
|
|
131
|
-
* @param firstRowId The Id of the first Row of the
|
|
131
|
+
* @param firstRowId The Id of the first Row of the linked list whose
|
|
132
132
|
* members changed.
|
|
133
133
|
* @category Listener
|
|
134
134
|
* @since v1.0.0
|
|
@@ -182,10 +182,10 @@ export type LocalRowIdsListener<Schemas extends OptionalSchemas> = (
|
|
|
182
182
|
*
|
|
183
183
|
* When called, a LinkedRowIdsListener is given a reference to the Relationships
|
|
184
184
|
* object, the Id of the Relationship that changed, and the Id of the first Row
|
|
185
|
-
* of the
|
|
185
|
+
* of the linked list whose members changed.
|
|
186
186
|
* @param relationships A reference to the Relationships object that changed.
|
|
187
187
|
* @param relationshipId The Id of the Relationship that changed.
|
|
188
|
-
* @param firstRowId The Id of the first Row of the
|
|
188
|
+
* @param firstRowId The Id of the first Row of the linked list whose
|
|
189
189
|
* members changed.
|
|
190
190
|
* @category Listener
|
|
191
191
|
* @since v1.0.0
|
package/@types/store/index.d.ts
CHANGED
|
@@ -1389,7 +1389,7 @@ export type ChangedValues = {
|
|
|
1389
1389
|
* transaction, primarily used so that you can indicate whether the transaction
|
|
1390
1390
|
* should be rolled back.
|
|
1391
1391
|
*
|
|
1392
|
-
* It provides both the
|
|
1392
|
+
* It provides both the old and new Values in a two-part array. These
|
|
1393
1393
|
* describe the state of the changed Value in the Store at the _start_ of the
|
|
1394
1394
|
* transaction, and by the _end_ of the transaction.
|
|
1395
1395
|
*
|
|
@@ -2315,7 +2315,7 @@ export type ChangedValues<Schema extends OptionalValuesSchema> = {
|
|
|
2315
2315
|
* ];
|
|
2316
2316
|
* ```
|
|
2317
2317
|
*
|
|
2318
|
-
* It provides both the
|
|
2318
|
+
* It provides both the old and new Values in a two-part array. These
|
|
2319
2319
|
* describe the state of the changed Value in the Store at the _start_ of the
|
|
2320
2320
|
* transaction, and by the _end_ of the transaction.
|
|
2321
2321
|
*
|
|
@@ -213,7 +213,7 @@ export class WsServerDurableObject<Env = unknown> extends DurableObject<Env> {
|
|
|
213
213
|
*
|
|
214
214
|
* This is useful if you want to debug the synchronization process, though be
|
|
215
215
|
* aware that this method is called very frequently. It is called with the Id
|
|
216
|
-
* of the client the message came _from_, the
|
|
216
|
+
* of the client the message came _from_, the Id of the client the message
|
|
217
217
|
* is to be forwarded _to_, and the remainder of the message itself.
|
|
218
218
|
*
|
|
219
219
|
* Since this method is called often, it should be performant. The path Id is
|
|
@@ -233,7 +233,7 @@ export class WsServerDurableObject<
|
|
|
233
233
|
*
|
|
234
234
|
* This is useful if you want to debug the synchronization process, though be
|
|
235
235
|
* aware that this method is called very frequently. It is called with the Id
|
|
236
|
-
* of the client the message came _from_, the
|
|
236
|
+
* of the client the message came _from_, the Id of the client the message
|
|
237
237
|
* is to be forwarded _to_, and the remainder of the message itself.
|
|
238
238
|
*
|
|
239
239
|
* Since this method is called often, it should be performant. The path Id is
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinybase",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.2",
|
|
4
4
|
"author": "jamesgpearce",
|
|
5
5
|
"repository": "github:tinyplex/tinybase",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@automerge/automerge-repo": "^1.2.1",
|
|
25
|
-
"@cloudflare/workers-types": "^4.
|
|
25
|
+
"@cloudflare/workers-types": "^4.20250524.0",
|
|
26
26
|
"@electric-sql/pglite": "^0.2.17",
|
|
27
|
-
"@libsql/client": "^0.15.
|
|
27
|
+
"@libsql/client": "^0.15.7",
|
|
28
28
|
"@powersync/common": "^1.30.0",
|
|
29
29
|
"@sqlite.org/sqlite-wasm": "^3.49.2-build1",
|
|
30
30
|
"@vlcn.io/crsqlite-wasm": "^0.16.0",
|
|
31
|
-
"bun": "^1.2.
|
|
31
|
+
"bun": "^1.2.14",
|
|
32
32
|
"electric-sql": "^0.12.1",
|
|
33
33
|
"expo": "^53.0.9",
|
|
34
34
|
"expo-sqlite": "^15.2.10",
|
|
35
|
-
"partykit": "^0.0.
|
|
35
|
+
"partykit": "^0.0.115",
|
|
36
36
|
"partysocket": "^1.1.4",
|
|
37
|
-
"postgres": "^3.4.
|
|
37
|
+
"postgres": "^3.4.7",
|
|
38
38
|
"react": "^19.0.0",
|
|
39
39
|
"react-dom": "^19.0.0",
|
|
40
40
|
"sqlite3": "^5.1.7",
|
|
@@ -110,6 +110,54 @@
|
|
|
110
110
|
"with-schemas": [
|
|
111
111
|
"./@types/with-schemas/index.d.ts"
|
|
112
112
|
],
|
|
113
|
+
"store": [
|
|
114
|
+
"./@types/store/index.d.ts"
|
|
115
|
+
],
|
|
116
|
+
"store/with-schemas": [
|
|
117
|
+
"./@types/store/with-schemas/index.d.ts"
|
|
118
|
+
],
|
|
119
|
+
"indexes": [
|
|
120
|
+
"./@types/indexes/index.d.ts"
|
|
121
|
+
],
|
|
122
|
+
"indexes/with-schemas": [
|
|
123
|
+
"./@types/indexes/with-schemas/index.d.ts"
|
|
124
|
+
],
|
|
125
|
+
"metrics": [
|
|
126
|
+
"./@types/metrics/index.d.ts"
|
|
127
|
+
],
|
|
128
|
+
"metrics/with-schemas": [
|
|
129
|
+
"./@types/metrics/with-schemas/index.d.ts"
|
|
130
|
+
],
|
|
131
|
+
"relationships": [
|
|
132
|
+
"./@types/relationships/index.d.ts"
|
|
133
|
+
],
|
|
134
|
+
"relationships/with-schemas": [
|
|
135
|
+
"./@types/relationships/with-schemas/index.d.ts"
|
|
136
|
+
],
|
|
137
|
+
"queries": [
|
|
138
|
+
"./@types/queries/index.d.ts"
|
|
139
|
+
],
|
|
140
|
+
"queries/with-schemas": [
|
|
141
|
+
"./@types/queries/with-schemas/index.d.ts"
|
|
142
|
+
],
|
|
143
|
+
"checkpoints": [
|
|
144
|
+
"./@types/checkpoints/index.d.ts"
|
|
145
|
+
],
|
|
146
|
+
"checkpoints/with-schemas": [
|
|
147
|
+
"./@types/checkpoints/with-schemas/index.d.ts"
|
|
148
|
+
],
|
|
149
|
+
"mergeable-store": [
|
|
150
|
+
"./@types/mergeable-store/index.d.ts"
|
|
151
|
+
],
|
|
152
|
+
"mergeable-store/with-schemas": [
|
|
153
|
+
"./@types/mergeable-store/with-schemas/index.d.ts"
|
|
154
|
+
],
|
|
155
|
+
"common": [
|
|
156
|
+
"./@types/common/index.d.ts"
|
|
157
|
+
],
|
|
158
|
+
"common/with-schemas": [
|
|
159
|
+
"./@types/common/with-schemas/index.d.ts"
|
|
160
|
+
],
|
|
113
161
|
"ui-react": [
|
|
114
162
|
"./@types/ui-react/index.d.ts"
|
|
115
163
|
],
|
|
@@ -290,60 +338,60 @@
|
|
|
290
338
|
"synchronizers/synchronizer-broadcast-channel/with-schemas": [
|
|
291
339
|
"./@types/synchronizers/synchronizer-broadcast-channel/with-schemas/index.d.ts"
|
|
292
340
|
],
|
|
293
|
-
"
|
|
294
|
-
"./@types/
|
|
341
|
+
"min": [
|
|
342
|
+
"./@types/index.d.ts"
|
|
295
343
|
],
|
|
296
|
-
"
|
|
297
|
-
"./@types/
|
|
344
|
+
"min/with-schemas": [
|
|
345
|
+
"./@types/with-schemas/index.d.ts"
|
|
298
346
|
],
|
|
299
|
-
"
|
|
300
|
-
"./@types/
|
|
347
|
+
"min/store": [
|
|
348
|
+
"./@types/store/index.d.ts"
|
|
301
349
|
],
|
|
302
|
-
"
|
|
303
|
-
"./@types/
|
|
350
|
+
"min/store/with-schemas": [
|
|
351
|
+
"./@types/store/with-schemas/index.d.ts"
|
|
304
352
|
],
|
|
305
|
-
"indexes": [
|
|
353
|
+
"min/indexes": [
|
|
306
354
|
"./@types/indexes/index.d.ts"
|
|
307
355
|
],
|
|
308
|
-
"indexes/with-schemas": [
|
|
356
|
+
"min/indexes/with-schemas": [
|
|
309
357
|
"./@types/indexes/with-schemas/index.d.ts"
|
|
310
358
|
],
|
|
311
|
-
"
|
|
359
|
+
"min/metrics": [
|
|
360
|
+
"./@types/metrics/index.d.ts"
|
|
361
|
+
],
|
|
362
|
+
"min/metrics/with-schemas": [
|
|
363
|
+
"./@types/metrics/with-schemas/index.d.ts"
|
|
364
|
+
],
|
|
365
|
+
"min/relationships": [
|
|
312
366
|
"./@types/relationships/index.d.ts"
|
|
313
367
|
],
|
|
314
|
-
"relationships/with-schemas": [
|
|
368
|
+
"min/relationships/with-schemas": [
|
|
315
369
|
"./@types/relationships/with-schemas/index.d.ts"
|
|
316
370
|
],
|
|
317
|
-
"queries": [
|
|
371
|
+
"min/queries": [
|
|
318
372
|
"./@types/queries/index.d.ts"
|
|
319
373
|
],
|
|
320
|
-
"queries/with-schemas": [
|
|
374
|
+
"min/queries/with-schemas": [
|
|
321
375
|
"./@types/queries/with-schemas/index.d.ts"
|
|
322
376
|
],
|
|
323
|
-
"checkpoints": [
|
|
377
|
+
"min/checkpoints": [
|
|
324
378
|
"./@types/checkpoints/index.d.ts"
|
|
325
379
|
],
|
|
326
|
-
"checkpoints/with-schemas": [
|
|
380
|
+
"min/checkpoints/with-schemas": [
|
|
327
381
|
"./@types/checkpoints/with-schemas/index.d.ts"
|
|
328
382
|
],
|
|
329
|
-
"mergeable-store": [
|
|
383
|
+
"min/mergeable-store": [
|
|
330
384
|
"./@types/mergeable-store/index.d.ts"
|
|
331
385
|
],
|
|
332
|
-
"mergeable-store/with-schemas": [
|
|
386
|
+
"min/mergeable-store/with-schemas": [
|
|
333
387
|
"./@types/mergeable-store/with-schemas/index.d.ts"
|
|
334
388
|
],
|
|
335
|
-
"common": [
|
|
389
|
+
"min/common": [
|
|
336
390
|
"./@types/common/index.d.ts"
|
|
337
391
|
],
|
|
338
|
-
"common/with-schemas": [
|
|
392
|
+
"min/common/with-schemas": [
|
|
339
393
|
"./@types/common/with-schemas/index.d.ts"
|
|
340
394
|
],
|
|
341
|
-
"min": [
|
|
342
|
-
"./@types/index.d.ts"
|
|
343
|
-
],
|
|
344
|
-
"min/with-schemas": [
|
|
345
|
-
"./@types/with-schemas/index.d.ts"
|
|
346
|
-
],
|
|
347
395
|
"min/ui-react": [
|
|
348
396
|
"./@types/ui-react/index.d.ts"
|
|
349
397
|
],
|
|
@@ -523,54 +571,6 @@
|
|
|
523
571
|
],
|
|
524
572
|
"min/synchronizers/synchronizer-broadcast-channel/with-schemas": [
|
|
525
573
|
"./@types/synchronizers/synchronizer-broadcast-channel/with-schemas/index.d.ts"
|
|
526
|
-
],
|
|
527
|
-
"min/store": [
|
|
528
|
-
"./@types/store/index.d.ts"
|
|
529
|
-
],
|
|
530
|
-
"min/store/with-schemas": [
|
|
531
|
-
"./@types/store/with-schemas/index.d.ts"
|
|
532
|
-
],
|
|
533
|
-
"min/metrics": [
|
|
534
|
-
"./@types/metrics/index.d.ts"
|
|
535
|
-
],
|
|
536
|
-
"min/metrics/with-schemas": [
|
|
537
|
-
"./@types/metrics/with-schemas/index.d.ts"
|
|
538
|
-
],
|
|
539
|
-
"min/indexes": [
|
|
540
|
-
"./@types/indexes/index.d.ts"
|
|
541
|
-
],
|
|
542
|
-
"min/indexes/with-schemas": [
|
|
543
|
-
"./@types/indexes/with-schemas/index.d.ts"
|
|
544
|
-
],
|
|
545
|
-
"min/relationships": [
|
|
546
|
-
"./@types/relationships/index.d.ts"
|
|
547
|
-
],
|
|
548
|
-
"min/relationships/with-schemas": [
|
|
549
|
-
"./@types/relationships/with-schemas/index.d.ts"
|
|
550
|
-
],
|
|
551
|
-
"min/queries": [
|
|
552
|
-
"./@types/queries/index.d.ts"
|
|
553
|
-
],
|
|
554
|
-
"min/queries/with-schemas": [
|
|
555
|
-
"./@types/queries/with-schemas/index.d.ts"
|
|
556
|
-
],
|
|
557
|
-
"min/checkpoints": [
|
|
558
|
-
"./@types/checkpoints/index.d.ts"
|
|
559
|
-
],
|
|
560
|
-
"min/checkpoints/with-schemas": [
|
|
561
|
-
"./@types/checkpoints/with-schemas/index.d.ts"
|
|
562
|
-
],
|
|
563
|
-
"min/mergeable-store": [
|
|
564
|
-
"./@types/mergeable-store/index.d.ts"
|
|
565
|
-
],
|
|
566
|
-
"min/mergeable-store/with-schemas": [
|
|
567
|
-
"./@types/mergeable-store/with-schemas/index.d.ts"
|
|
568
|
-
],
|
|
569
|
-
"min/common": [
|
|
570
|
-
"./@types/common/index.d.ts"
|
|
571
|
-
],
|
|
572
|
-
"min/common/with-schemas": [
|
|
573
|
-
"./@types/common/with-schemas/index.d.ts"
|
|
574
574
|
]
|
|
575
575
|
}
|
|
576
576
|
},
|
|
@@ -587,6 +587,102 @@
|
|
|
587
587
|
"default": "./with-schemas/index.js"
|
|
588
588
|
}
|
|
589
589
|
},
|
|
590
|
+
"./store": {
|
|
591
|
+
"default": {
|
|
592
|
+
"types": "./@types/store/index.d.ts",
|
|
593
|
+
"default": "./store/index.js"
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
"./store/with-schemas": {
|
|
597
|
+
"default": {
|
|
598
|
+
"types": "./@types/store/with-schemas/index.d.ts",
|
|
599
|
+
"default": "./store/with-schemas/index.js"
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
"./indexes": {
|
|
603
|
+
"default": {
|
|
604
|
+
"types": "./@types/indexes/index.d.ts",
|
|
605
|
+
"default": "./indexes/index.js"
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
"./indexes/with-schemas": {
|
|
609
|
+
"default": {
|
|
610
|
+
"types": "./@types/indexes/with-schemas/index.d.ts",
|
|
611
|
+
"default": "./indexes/with-schemas/index.js"
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
"./metrics": {
|
|
615
|
+
"default": {
|
|
616
|
+
"types": "./@types/metrics/index.d.ts",
|
|
617
|
+
"default": "./metrics/index.js"
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
"./metrics/with-schemas": {
|
|
621
|
+
"default": {
|
|
622
|
+
"types": "./@types/metrics/with-schemas/index.d.ts",
|
|
623
|
+
"default": "./metrics/with-schemas/index.js"
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
"./relationships": {
|
|
627
|
+
"default": {
|
|
628
|
+
"types": "./@types/relationships/index.d.ts",
|
|
629
|
+
"default": "./relationships/index.js"
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
"./relationships/with-schemas": {
|
|
633
|
+
"default": {
|
|
634
|
+
"types": "./@types/relationships/with-schemas/index.d.ts",
|
|
635
|
+
"default": "./relationships/with-schemas/index.js"
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
"./queries": {
|
|
639
|
+
"default": {
|
|
640
|
+
"types": "./@types/queries/index.d.ts",
|
|
641
|
+
"default": "./queries/index.js"
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
"./queries/with-schemas": {
|
|
645
|
+
"default": {
|
|
646
|
+
"types": "./@types/queries/with-schemas/index.d.ts",
|
|
647
|
+
"default": "./queries/with-schemas/index.js"
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
"./checkpoints": {
|
|
651
|
+
"default": {
|
|
652
|
+
"types": "./@types/checkpoints/index.d.ts",
|
|
653
|
+
"default": "./checkpoints/index.js"
|
|
654
|
+
}
|
|
655
|
+
},
|
|
656
|
+
"./checkpoints/with-schemas": {
|
|
657
|
+
"default": {
|
|
658
|
+
"types": "./@types/checkpoints/with-schemas/index.d.ts",
|
|
659
|
+
"default": "./checkpoints/with-schemas/index.js"
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
"./mergeable-store": {
|
|
663
|
+
"default": {
|
|
664
|
+
"types": "./@types/mergeable-store/index.d.ts",
|
|
665
|
+
"default": "./mergeable-store/index.js"
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
"./mergeable-store/with-schemas": {
|
|
669
|
+
"default": {
|
|
670
|
+
"types": "./@types/mergeable-store/with-schemas/index.d.ts",
|
|
671
|
+
"default": "./mergeable-store/with-schemas/index.js"
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
"./common": {
|
|
675
|
+
"default": {
|
|
676
|
+
"types": "./@types/common/index.d.ts",
|
|
677
|
+
"default": "./common/index.js"
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
"./common/with-schemas": {
|
|
681
|
+
"default": {
|
|
682
|
+
"types": "./@types/common/with-schemas/index.d.ts",
|
|
683
|
+
"default": "./common/with-schemas/index.js"
|
|
684
|
+
}
|
|
685
|
+
},
|
|
590
686
|
"./ui-react": {
|
|
591
687
|
"default": {
|
|
592
688
|
"types": "./@types/ui-react/index.d.ts",
|
|
@@ -947,112 +1043,112 @@
|
|
|
947
1043
|
"default": "./synchronizers/synchronizer-broadcast-channel/with-schemas/index.js"
|
|
948
1044
|
}
|
|
949
1045
|
},
|
|
950
|
-
"./
|
|
1046
|
+
"./min": {
|
|
951
1047
|
"default": {
|
|
952
|
-
"types": "./@types/
|
|
953
|
-
"default": "./
|
|
1048
|
+
"types": "./@types/index.d.ts",
|
|
1049
|
+
"default": "./min/index.js"
|
|
954
1050
|
}
|
|
955
1051
|
},
|
|
956
|
-
"./
|
|
1052
|
+
"./min/with-schemas": {
|
|
957
1053
|
"default": {
|
|
958
|
-
"types": "./@types/
|
|
959
|
-
"default": "./
|
|
1054
|
+
"types": "./@types/with-schemas/index.d.ts",
|
|
1055
|
+
"default": "./min/with-schemas/index.js"
|
|
960
1056
|
}
|
|
961
1057
|
},
|
|
962
|
-
"./
|
|
1058
|
+
"./min/store": {
|
|
963
1059
|
"default": {
|
|
964
|
-
"types": "./@types/
|
|
965
|
-
"default": "./
|
|
1060
|
+
"types": "./@types/store/index.d.ts",
|
|
1061
|
+
"default": "./min/store/index.js"
|
|
966
1062
|
}
|
|
967
1063
|
},
|
|
968
|
-
"./
|
|
1064
|
+
"./min/store/with-schemas": {
|
|
969
1065
|
"default": {
|
|
970
|
-
"types": "./@types/
|
|
971
|
-
"default": "./
|
|
1066
|
+
"types": "./@types/store/with-schemas/index.d.ts",
|
|
1067
|
+
"default": "./min/store/with-schemas/index.js"
|
|
972
1068
|
}
|
|
973
1069
|
},
|
|
974
|
-
"./indexes": {
|
|
1070
|
+
"./min/indexes": {
|
|
975
1071
|
"default": {
|
|
976
1072
|
"types": "./@types/indexes/index.d.ts",
|
|
977
|
-
"default": "./indexes/index.js"
|
|
1073
|
+
"default": "./min/indexes/index.js"
|
|
978
1074
|
}
|
|
979
1075
|
},
|
|
980
|
-
"./indexes/with-schemas": {
|
|
1076
|
+
"./min/indexes/with-schemas": {
|
|
981
1077
|
"default": {
|
|
982
1078
|
"types": "./@types/indexes/with-schemas/index.d.ts",
|
|
983
|
-
"default": "./indexes/with-schemas/index.js"
|
|
1079
|
+
"default": "./min/indexes/with-schemas/index.js"
|
|
984
1080
|
}
|
|
985
1081
|
},
|
|
986
|
-
"./
|
|
1082
|
+
"./min/metrics": {
|
|
1083
|
+
"default": {
|
|
1084
|
+
"types": "./@types/metrics/index.d.ts",
|
|
1085
|
+
"default": "./min/metrics/index.js"
|
|
1086
|
+
}
|
|
1087
|
+
},
|
|
1088
|
+
"./min/metrics/with-schemas": {
|
|
1089
|
+
"default": {
|
|
1090
|
+
"types": "./@types/metrics/with-schemas/index.d.ts",
|
|
1091
|
+
"default": "./min/metrics/with-schemas/index.js"
|
|
1092
|
+
}
|
|
1093
|
+
},
|
|
1094
|
+
"./min/relationships": {
|
|
987
1095
|
"default": {
|
|
988
1096
|
"types": "./@types/relationships/index.d.ts",
|
|
989
|
-
"default": "./relationships/index.js"
|
|
1097
|
+
"default": "./min/relationships/index.js"
|
|
990
1098
|
}
|
|
991
1099
|
},
|
|
992
|
-
"./relationships/with-schemas": {
|
|
1100
|
+
"./min/relationships/with-schemas": {
|
|
993
1101
|
"default": {
|
|
994
1102
|
"types": "./@types/relationships/with-schemas/index.d.ts",
|
|
995
|
-
"default": "./relationships/with-schemas/index.js"
|
|
1103
|
+
"default": "./min/relationships/with-schemas/index.js"
|
|
996
1104
|
}
|
|
997
1105
|
},
|
|
998
|
-
"./queries": {
|
|
1106
|
+
"./min/queries": {
|
|
999
1107
|
"default": {
|
|
1000
1108
|
"types": "./@types/queries/index.d.ts",
|
|
1001
|
-
"default": "./queries/index.js"
|
|
1109
|
+
"default": "./min/queries/index.js"
|
|
1002
1110
|
}
|
|
1003
1111
|
},
|
|
1004
|
-
"./queries/with-schemas": {
|
|
1112
|
+
"./min/queries/with-schemas": {
|
|
1005
1113
|
"default": {
|
|
1006
1114
|
"types": "./@types/queries/with-schemas/index.d.ts",
|
|
1007
|
-
"default": "./queries/with-schemas/index.js"
|
|
1115
|
+
"default": "./min/queries/with-schemas/index.js"
|
|
1008
1116
|
}
|
|
1009
1117
|
},
|
|
1010
|
-
"./checkpoints": {
|
|
1118
|
+
"./min/checkpoints": {
|
|
1011
1119
|
"default": {
|
|
1012
1120
|
"types": "./@types/checkpoints/index.d.ts",
|
|
1013
|
-
"default": "./checkpoints/index.js"
|
|
1121
|
+
"default": "./min/checkpoints/index.js"
|
|
1014
1122
|
}
|
|
1015
1123
|
},
|
|
1016
|
-
"./checkpoints/with-schemas": {
|
|
1124
|
+
"./min/checkpoints/with-schemas": {
|
|
1017
1125
|
"default": {
|
|
1018
1126
|
"types": "./@types/checkpoints/with-schemas/index.d.ts",
|
|
1019
|
-
"default": "./checkpoints/with-schemas/index.js"
|
|
1127
|
+
"default": "./min/checkpoints/with-schemas/index.js"
|
|
1020
1128
|
}
|
|
1021
1129
|
},
|
|
1022
|
-
"./mergeable-store": {
|
|
1130
|
+
"./min/mergeable-store": {
|
|
1023
1131
|
"default": {
|
|
1024
1132
|
"types": "./@types/mergeable-store/index.d.ts",
|
|
1025
|
-
"default": "./mergeable-store/index.js"
|
|
1133
|
+
"default": "./min/mergeable-store/index.js"
|
|
1026
1134
|
}
|
|
1027
1135
|
},
|
|
1028
|
-
"./mergeable-store/with-schemas": {
|
|
1136
|
+
"./min/mergeable-store/with-schemas": {
|
|
1029
1137
|
"default": {
|
|
1030
1138
|
"types": "./@types/mergeable-store/with-schemas/index.d.ts",
|
|
1031
|
-
"default": "./mergeable-store/with-schemas/index.js"
|
|
1139
|
+
"default": "./min/mergeable-store/with-schemas/index.js"
|
|
1032
1140
|
}
|
|
1033
1141
|
},
|
|
1034
|
-
"./common": {
|
|
1142
|
+
"./min/common": {
|
|
1035
1143
|
"default": {
|
|
1036
1144
|
"types": "./@types/common/index.d.ts",
|
|
1037
|
-
"default": "./common/index.js"
|
|
1145
|
+
"default": "./min/common/index.js"
|
|
1038
1146
|
}
|
|
1039
1147
|
},
|
|
1040
|
-
"./common/with-schemas": {
|
|
1148
|
+
"./min/common/with-schemas": {
|
|
1041
1149
|
"default": {
|
|
1042
1150
|
"types": "./@types/common/with-schemas/index.d.ts",
|
|
1043
|
-
"default": "./common/with-schemas/index.js"
|
|
1044
|
-
}
|
|
1045
|
-
},
|
|
1046
|
-
"./min": {
|
|
1047
|
-
"default": {
|
|
1048
|
-
"types": "./@types/index.d.ts",
|
|
1049
|
-
"default": "./min/index.js"
|
|
1050
|
-
}
|
|
1051
|
-
},
|
|
1052
|
-
"./min/with-schemas": {
|
|
1053
|
-
"default": {
|
|
1054
|
-
"types": "./@types/with-schemas/index.d.ts",
|
|
1055
|
-
"default": "./min/with-schemas/index.js"
|
|
1151
|
+
"default": "./min/common/with-schemas/index.js"
|
|
1056
1152
|
}
|
|
1057
1153
|
},
|
|
1058
1154
|
"./min/ui-react": {
|
|
@@ -1414,102 +1510,6 @@
|
|
|
1414
1510
|
"types": "./@types/synchronizers/synchronizer-broadcast-channel/with-schemas/index.d.ts",
|
|
1415
1511
|
"default": "./min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js"
|
|
1416
1512
|
}
|
|
1417
|
-
},
|
|
1418
|
-
"./min/store": {
|
|
1419
|
-
"default": {
|
|
1420
|
-
"types": "./@types/store/index.d.ts",
|
|
1421
|
-
"default": "./min/store/index.js"
|
|
1422
|
-
}
|
|
1423
|
-
},
|
|
1424
|
-
"./min/store/with-schemas": {
|
|
1425
|
-
"default": {
|
|
1426
|
-
"types": "./@types/store/with-schemas/index.d.ts",
|
|
1427
|
-
"default": "./min/store/with-schemas/index.js"
|
|
1428
|
-
}
|
|
1429
|
-
},
|
|
1430
|
-
"./min/metrics": {
|
|
1431
|
-
"default": {
|
|
1432
|
-
"types": "./@types/metrics/index.d.ts",
|
|
1433
|
-
"default": "./min/metrics/index.js"
|
|
1434
|
-
}
|
|
1435
|
-
},
|
|
1436
|
-
"./min/metrics/with-schemas": {
|
|
1437
|
-
"default": {
|
|
1438
|
-
"types": "./@types/metrics/with-schemas/index.d.ts",
|
|
1439
|
-
"default": "./min/metrics/with-schemas/index.js"
|
|
1440
|
-
}
|
|
1441
|
-
},
|
|
1442
|
-
"./min/indexes": {
|
|
1443
|
-
"default": {
|
|
1444
|
-
"types": "./@types/indexes/index.d.ts",
|
|
1445
|
-
"default": "./min/indexes/index.js"
|
|
1446
|
-
}
|
|
1447
|
-
},
|
|
1448
|
-
"./min/indexes/with-schemas": {
|
|
1449
|
-
"default": {
|
|
1450
|
-
"types": "./@types/indexes/with-schemas/index.d.ts",
|
|
1451
|
-
"default": "./min/indexes/with-schemas/index.js"
|
|
1452
|
-
}
|
|
1453
|
-
},
|
|
1454
|
-
"./min/relationships": {
|
|
1455
|
-
"default": {
|
|
1456
|
-
"types": "./@types/relationships/index.d.ts",
|
|
1457
|
-
"default": "./min/relationships/index.js"
|
|
1458
|
-
}
|
|
1459
|
-
},
|
|
1460
|
-
"./min/relationships/with-schemas": {
|
|
1461
|
-
"default": {
|
|
1462
|
-
"types": "./@types/relationships/with-schemas/index.d.ts",
|
|
1463
|
-
"default": "./min/relationships/with-schemas/index.js"
|
|
1464
|
-
}
|
|
1465
|
-
},
|
|
1466
|
-
"./min/queries": {
|
|
1467
|
-
"default": {
|
|
1468
|
-
"types": "./@types/queries/index.d.ts",
|
|
1469
|
-
"default": "./min/queries/index.js"
|
|
1470
|
-
}
|
|
1471
|
-
},
|
|
1472
|
-
"./min/queries/with-schemas": {
|
|
1473
|
-
"default": {
|
|
1474
|
-
"types": "./@types/queries/with-schemas/index.d.ts",
|
|
1475
|
-
"default": "./min/queries/with-schemas/index.js"
|
|
1476
|
-
}
|
|
1477
|
-
},
|
|
1478
|
-
"./min/checkpoints": {
|
|
1479
|
-
"default": {
|
|
1480
|
-
"types": "./@types/checkpoints/index.d.ts",
|
|
1481
|
-
"default": "./min/checkpoints/index.js"
|
|
1482
|
-
}
|
|
1483
|
-
},
|
|
1484
|
-
"./min/checkpoints/with-schemas": {
|
|
1485
|
-
"default": {
|
|
1486
|
-
"types": "./@types/checkpoints/with-schemas/index.d.ts",
|
|
1487
|
-
"default": "./min/checkpoints/with-schemas/index.js"
|
|
1488
|
-
}
|
|
1489
|
-
},
|
|
1490
|
-
"./min/mergeable-store": {
|
|
1491
|
-
"default": {
|
|
1492
|
-
"types": "./@types/mergeable-store/index.d.ts",
|
|
1493
|
-
"default": "./min/mergeable-store/index.js"
|
|
1494
|
-
}
|
|
1495
|
-
},
|
|
1496
|
-
"./min/mergeable-store/with-schemas": {
|
|
1497
|
-
"default": {
|
|
1498
|
-
"types": "./@types/mergeable-store/with-schemas/index.d.ts",
|
|
1499
|
-
"default": "./min/mergeable-store/with-schemas/index.js"
|
|
1500
|
-
}
|
|
1501
|
-
},
|
|
1502
|
-
"./min/common": {
|
|
1503
|
-
"default": {
|
|
1504
|
-
"types": "./@types/common/index.d.ts",
|
|
1505
|
-
"default": "./min/common/index.js"
|
|
1506
|
-
}
|
|
1507
|
-
},
|
|
1508
|
-
"./min/common/with-schemas": {
|
|
1509
|
-
"default": {
|
|
1510
|
-
"types": "./@types/common/with-schemas/index.d.ts",
|
|
1511
|
-
"default": "./min/common/with-schemas/index.js"
|
|
1512
|
-
}
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
1515
1515
|
}
|
package/readme.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<link rel="preload" as="image" href="https://tinybase.org/react.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/indexeddb.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/cloudflare.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/postgresql.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/pglite.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/sqlite.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/bun.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/expo.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/electric.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/turso.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/powersync.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/partykit.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/yjs.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/crsqlite.png"><link rel="preload" as="image" href="https://tinybase.org/automerge.svg?asImg"><link rel="preload" as="image" href="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=GitHub&labelColor=%23d81b60&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/badge/Bluesky-Follow-blue?style=for-the-badge&logo=bluesky&logoColor=%23fff&color=%23333&labelColor=%230285FF"><link rel="preload" as="image" href="https://img.shields.io/badge/%2F%20Twitter-Follow-blue?style=for-the-badge&logo=x&logoColor=%23fff&color=%23333&labelColor=%23000"><link rel="preload" as="image" href="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&logo=discord&logoColor=%23fff&label=Discord&labelColor=%233131e8&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Ideas&labelColor=%23d81b60&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Issues&labelColor=%23d81b60&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&logo=jest&logoColor=%23fff&color=%23333&labelColor=%2387c305"><link rel="preload" as="image" href="https://img.shields.io/npm/v/tinybase?style=for-the-badge&logo=npm&logoColor=%23fff&labelColor=%23bd0005&color=%23333"><link rel="preload" as="image" href="https://tinybase.org/ui-react-dom.webp"><link rel="preload" as="image" href="https://tinybase.org/store-inspector.webp"><link rel="preload" as="image" href="https://github.com/cpojer.png?size=48"><link rel="preload" as="image" href="https://github.com/expo.png?size=48"><link rel="preload" as="image" href="https://github.com/beekeeb.png?size=48"><link rel="preload" as="image" href="https://github.com/cancelself.png?size=48"><link rel="preload" as="image" href="https://github.com/WonderPanda.png?size=48"><link rel="preload" as="image" href="https://github.com/arpitBhalla.png?size=48"><link rel="preload" as="image" href="https://github.com/behrends.png?size=48"><link rel="preload" as="image" href="https://github.com/betomoedano.png?size=48"><link rel="preload" as="image" href="https://github.com/brentvatne.png?size=48"><link rel="preload" as="image" href="https://github.com/byCedric.png?size=48"><link rel="preload" as="image" href="https://github.com/circadian-risk.png?size=48"><link rel="preload" as="image" href="https://github.com/cubecull.png?size=48"><link rel="preload" as="image" href="https://github.com/erwinkn.png?size=48"><link rel="preload" as="image" href="https://github.com/ezra-en.png?size=48"><link rel="preload" as="image" href="https://github.com/feychenie.png?size=48"><link rel="preload" as="image" href="https://github.com/flaming-codes.png?size=48"><link rel="preload" as="image" href="https://github.com/fostertheweb.png?size=48"><link rel="preload" as="image" href="https://github.com/Giulio987.png?size=48"><link rel="preload" as="image" href="https://github.com/hi-ogawa.png?size=48"><link rel="preload" as="image" href="https://github.com/itsdevcoffee.png?size=48"><link rel="preload" as="image" href="https://github.com/jbolda.png?size=48"><link rel="preload" as="image" href="https://github.com/Kayoo-asso.png?size=48"><link rel="preload" as="image" href="https://github.com/kotofurumiya.png?size=48"><link rel="preload" as="image" href="https://github.com/Kudo.png?size=48"><link rel="preload" as="image" href="https://github.com/learn-anything.png?size=48"><link rel="preload" as="image" href="https://github.com/lluc.png?size=48"><link rel="preload" as="image" href="https://github.com/marksteve.png?size=48"><link rel="preload" as="image" href="https://github.com/miking-the-viking.png?size=48"><link rel="preload" as="image" href="https://github.com/mjamesderocher.png?size=48"><link rel="preload" as="image" href="https://github.com/mouktardev.png?size=48"><link rel="preload" as="image" href="https://github.com/nickmessing.png?size=48"><link rel="preload" as="image" href="https://github.com/nikitavoloboev.png?size=48"><link rel="preload" as="image" href="https://github.com/nkzw-tech.png?size=48"><link rel="preload" as="image" href="https://github.com/palerdot.png?size=48"><link rel="preload" as="image" href="https://github.com/PorcoRosso85.png?size=48"><link rel="preload" as="image" href="https://github.com/primodiumxyz.png?size=48"><link rel="preload" as="image" href="https://github.com/shaneosullivan.png?size=48"><link rel="preload" as="image" href="https://github.com/sudo-self.png?size=48"><link rel="preload" as="image" href="https://github.com/SuperSonicHub1.png?size=48"><link rel="preload" as="image" href="https://github.com/threepointone.png?size=48"><link rel="preload" as="image" href="https://github.com/uptonking.png?size=48"><link rel="preload" as="image" href="https://github.com/ViktorZhurbin.png?size=48"><link rel="preload" as="image" href="https://github.com/wilkerlucio.png?size=48"><link rel="preload" as="image" href="https://tinybase.org/favicon.svg?asImg"><link rel="preload" as="image" href="https://tinywidgets.org/favicon.svg?asImg"><link rel="preload" as="image" href="https://tinytick.org/favicon.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/youtube.webp"><section id="hero"><h2 id="a-reactive-data-store-sync-engine">A <em>reactive</em> data store & <span><em>sync</em> engine</span>.</h2></section><p><a href="https://tinybase.org/guides/releases/#v6-1"><em>NEW!</em> v6.1 release</a></p><p><span id="one-with">Bun SQLite & subset persistence!</span></p><p><a class="start" href="https://tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://tinybase.org/demos/">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section><h2 id="it-s-reactive">It's <em>Reactive</em></h2><p>TinyBase lets you <a href="#register-granular-listeners">listen to changes</a> made to any part of your data. This means your app will be fast, since you only spend rendering cycles on things that change. The optional <a href="#call-hooks-to-bind-to-data">bindings to React</a> and <a href="#pre-built-reactive-components">pre-built components</a> let you easily build fully reactive UIs on top of TinyBase. You even get a built-in <a href="#set-checkpoints-for-an-undo-stack">undo stack</a>, and <a href="#an-inspector-for-your-data">developer tools</a>!</p></section><section><h2 id="it-s-database-like">It's <em>Database-Like</em></h2><p>Consumer app? Enterprise app? Or even a game? Model <a href="#start-with-a-simple-key-value-store">key-value data</a> and <a href="#level-up-to-use-tabular-data">tabular data</a> with optional typed <a href="#apply-schemas-to-tables-values">schematization</a>, whatever its data structures. There are built-in <a href="#create-indexes-for-fast-lookups">indexing</a>, <a href="#define-metrics-and-aggregations">metric aggregation</a>, and tabular <a href="#model-table-relationships">relationships</a> APIs - and a powerful <a href="#build-complex-queries-with-tinyql">query engine</a> to select, join, filter, and group data (reactively!) without SQL.</p></section><section><h2 id="it-synchronizes">It <em>Synchronizes</em></h2><p>TinyBase has <a href="#synchronize-between-devices">native CRDT</a> support, meaning that you can deterministically <a href="https://tinybase.org/guides/synchronization/">synchronize</a> and merge data across multiple sources, clients, and servers. And although TinyBase is an in-memory data store, you can easily <a href="#persist-to-storage-databases-more">persist</a> your data to file, <a href="https://tinybase.org/api/persister-browser">browser storage</a>, <a href="https://tinybase.org/api/persister-indexed-db">IndexedDB</a>, <a href="https://tinybase.org/guides/persistence/database-persistence/">SQLite or PostgreSQL databases</a>, and <a href="https://tinybase.org/guides/persistence/third-party-crdt-persistence/">more</a>.</p></section><section><h2 id="it-s-built-for-a-local-first-world">It's Built For A <em>Local-First</em> World</h2><p>TinyBase works anywhere that JavaScript does, but it's especially great for local-first apps: where data is stored locally on the user's device and that can be run offline. It's tiny by name, tiny by nature: just <a href="#did-we-say-tiny">5.4kB - 11.6kB</a> and with no dependencies - yet <a href="#well-tested-and-documented">100% tested</a>, <a href="https://tinybase.org/guides/the-basics/getting-started/">fully documented</a>, and of course, <a href="https://github.com/tinyplex/tinybase">open source</a>!</p></section><hr><section id="friends"><h2 id="tinybase-works-great-on-its-own-but-also-plays-well-with-friends">TinyBase works great on its own, but also plays well with friends.</h2><div><a href="https://tinybase.org/guides/building-uis/getting-started-with-ui-react"><img src="https://tinybase.org/react.svg?asImg" width="48"> React</a></div><div><a href="https://tinybase.org/api/persister-indexed-db/functions/creation/createindexeddbpersister"><img src="https://tinybase.org/indexeddb.svg?asImg" width="48"> IndexedDB</a></div><div><a href="https://tinybase.org/guides/integrations/cloudflare-durable-objects"><img src="https://tinybase.org/cloudflare.svg?asImg" width="48"> Cloudflare</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/postgresql.svg?asImg" width="48"> PostgreSQL</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/pglite.svg?asImg" width="48"> PGlite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/sqlite.svg?asImg" width="48"> SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/bun.svg?asImg" width="48"> Bun SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/expo.svg?asImg" width="48"> Expo SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/electric.svg?asImg" width="48"> ElectricSQL</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/turso.svg?asImg" width="48"> Turso</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/powersync.svg?asImg" width="48"> PowerSync</a></div><div><a href="https://tinybase.org/api/persister-partykit-client"><img src="https://tinybase.org/partykit.svg?asImg" width="48"> PartyKit</a></div><div><a href="https://tinybase.org/api/persister-yjs/functions/creation/createyjspersister"><img src="https://tinybase.org/yjs.svg?asImg" width="48"> YJS</a></div><div><a href="https://tinybase.org/api/persister-cr-sqlite-wasm"><img src="https://tinybase.org/crsqlite.png" width="48"> CR-SQLite</a></div><div><a href="https://tinybase.org/api/persister-automerge"><img src="https://tinybase.org/automerge.svg?asImg" width="48"> Automerge</a></div><p>(Baffled by all these logos? Check out our <a href="https://tinybase.org/guides/the-basics/architectural-options">architectural options</a> guide to make sense of it all!)</p></section><hr><section id="follow"><a href="https://github.com/tinyplex/tinybase" target="_blank"><img src="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=GitHub&labelColor=%23d81b60&color=%23333"> </a><a href="https://bsky.app/profile/tinybase.bsky.social"><img src="https://img.shields.io/badge/Bluesky-Follow-blue?style=for-the-badge&logo=bluesky&logoColor=%23fff&color=%23333&labelColor=%230285FF"> </a><a href="https://x.com/tinybasejs" target="_blank"><img src="https://img.shields.io/badge/%2F%20Twitter-Follow-blue?style=for-the-badge&logo=x&logoColor=%23fff&color=%23333&labelColor=%23000"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&logo=discord&logoColor=%23fff&label=Discord&labelColor=%233131e8&color=%23333"></a><br><a href="https://github.com/tinyplex/tinybase/discussions" target="_blank"><img src="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Ideas&labelColor=%23d81b60&color=%23333"> </a><a href="https://github.com/tinyplex/tinybase/issues" target="_blank"><img src="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Issues&labelColor=%23d81b60&color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&logo=jest&logoColor=%23fff&color=%23333&labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/6.1.0" target="_blank"><img src="https://img.shields.io/npm/v/tinybase?style=for-the-badge&logo=npm&logoColor=%23fff&labelColor=%23bd0005&color=%23333"></a></section><hr><section><h2 id="start-with-a-simple-key-value-store">Start with a simple key-value store.</h2><p>Creating a <a href="https://tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> requires just a simple call to the <a href="https://tinybase.org/api/store/functions/creation/createstore/"><code>createStore</code></a> function. Once you have one, you can easily set <a href="https://tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a> in it by unique <a href="https://tinybase.org/api/common/type-aliases/identity/id/"><code>Id</code></a>. And of course you can easily get them back out again.</p><p>Read more about using keyed value data in <a href="https://tinybase.org/guides/the-basics/">The Basics</a> guide.</p></section>
|
|
1
|
+
<link rel="preload" as="image" href="https://tinybase.org/react.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/indexeddb.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/cloudflare.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/postgresql.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/pglite.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/sqlite.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/bun.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/expo.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/electric.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/turso.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/powersync.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/partykit.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/yjs.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/crsqlite.png"><link rel="preload" as="image" href="https://tinybase.org/automerge.svg?asImg"><link rel="preload" as="image" href="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=GitHub&labelColor=%23d81b60&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/badge/Bluesky-Follow-blue?style=for-the-badge&logo=bluesky&logoColor=%23fff&color=%23333&labelColor=%230285FF"><link rel="preload" as="image" href="https://img.shields.io/badge/%2F%20Twitter-Follow-blue?style=for-the-badge&logo=x&logoColor=%23fff&color=%23333&labelColor=%23000"><link rel="preload" as="image" href="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&logo=discord&logoColor=%23fff&label=Discord&labelColor=%233131e8&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Ideas&labelColor=%23d81b60&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Issues&labelColor=%23d81b60&color=%23333"><link rel="preload" as="image" href="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&logo=jest&logoColor=%23fff&color=%23333&labelColor=%2387c305"><link rel="preload" as="image" href="https://img.shields.io/npm/v/tinybase?style=for-the-badge&logo=npm&logoColor=%23fff&labelColor=%23bd0005&color=%23333"><link rel="preload" as="image" href="https://tinybase.org/ui-react-dom.webp"><link rel="preload" as="image" href="https://tinybase.org/store-inspector.webp"><link rel="preload" as="image" href="https://github.com/cpojer.png?size=48"><link rel="preload" as="image" href="https://github.com/expo.png?size=48"><link rel="preload" as="image" href="https://github.com/beekeeb.png?size=48"><link rel="preload" as="image" href="https://github.com/cancelself.png?size=48"><link rel="preload" as="image" href="https://github.com/WonderPanda.png?size=48"><link rel="preload" as="image" href="https://github.com/arpitBhalla.png?size=48"><link rel="preload" as="image" href="https://github.com/behrends.png?size=48"><link rel="preload" as="image" href="https://github.com/betomoedano.png?size=48"><link rel="preload" as="image" href="https://github.com/brentvatne.png?size=48"><link rel="preload" as="image" href="https://github.com/byCedric.png?size=48"><link rel="preload" as="image" href="https://github.com/circadian-risk.png?size=48"><link rel="preload" as="image" href="https://github.com/cubecull.png?size=48"><link rel="preload" as="image" href="https://github.com/erwinkn.png?size=48"><link rel="preload" as="image" href="https://github.com/ezra-en.png?size=48"><link rel="preload" as="image" href="https://github.com/feychenie.png?size=48"><link rel="preload" as="image" href="https://github.com/flaming-codes.png?size=48"><link rel="preload" as="image" href="https://github.com/fostertheweb.png?size=48"><link rel="preload" as="image" href="https://github.com/Giulio987.png?size=48"><link rel="preload" as="image" href="https://github.com/hi-ogawa.png?size=48"><link rel="preload" as="image" href="https://github.com/itsdevcoffee.png?size=48"><link rel="preload" as="image" href="https://github.com/jbolda.png?size=48"><link rel="preload" as="image" href="https://github.com/Kayoo-asso.png?size=48"><link rel="preload" as="image" href="https://github.com/kotofurumiya.png?size=48"><link rel="preload" as="image" href="https://github.com/Kudo.png?size=48"><link rel="preload" as="image" href="https://github.com/learn-anything.png?size=48"><link rel="preload" as="image" href="https://github.com/lluc.png?size=48"><link rel="preload" as="image" href="https://github.com/marksteve.png?size=48"><link rel="preload" as="image" href="https://github.com/miking-the-viking.png?size=48"><link rel="preload" as="image" href="https://github.com/mjamesderocher.png?size=48"><link rel="preload" as="image" href="https://github.com/mouktardev.png?size=48"><link rel="preload" as="image" href="https://github.com/nickmessing.png?size=48"><link rel="preload" as="image" href="https://github.com/nikitavoloboev.png?size=48"><link rel="preload" as="image" href="https://github.com/nkzw-tech.png?size=48"><link rel="preload" as="image" href="https://github.com/palerdot.png?size=48"><link rel="preload" as="image" href="https://github.com/PorcoRosso85.png?size=48"><link rel="preload" as="image" href="https://github.com/primodiumxyz.png?size=48"><link rel="preload" as="image" href="https://github.com/shaneosullivan.png?size=48"><link rel="preload" as="image" href="https://github.com/sudo-self.png?size=48"><link rel="preload" as="image" href="https://github.com/SuperSonicHub1.png?size=48"><link rel="preload" as="image" href="https://github.com/threepointone.png?size=48"><link rel="preload" as="image" href="https://github.com/uptonking.png?size=48"><link rel="preload" as="image" href="https://github.com/ViktorZhurbin.png?size=48"><link rel="preload" as="image" href="https://github.com/wilkerlucio.png?size=48"><link rel="preload" as="image" href="https://tinybase.org/favicon.svg?asImg"><link rel="preload" as="image" href="https://tinywidgets.org/favicon.svg?asImg"><link rel="preload" as="image" href="https://tinytick.org/favicon.svg?asImg"><link rel="preload" as="image" href="https://tinybase.org/youtube.webp"><section id="hero"><h2 id="a-reactive-data-store-sync-engine">A <em>reactive</em> data store & <span><em>sync</em> engine</span></h2></section><p><a href="https://tinybase.org/guides/releases/#v6-1"><em>NEW!</em> v6.1 release</a></p><p><span id="one-with">Bun SQLite & subset persistence!</span></p><p><a class="start" href="https://tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://tinybase.org/demos/">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section><h2 id="it-s-reactive">It's <em>Reactive</em></h2><p>TinyBase lets you <a href="#register-granular-listeners">listen to changes</a> made to any part of your data. This means your app will be fast, since you only spend rendering cycles on things that change. The optional <a href="#call-hooks-to-bind-to-data">bindings to React</a> and <a href="#pre-built-reactive-components">pre-built components</a> let you easily build fully reactive UIs on top of TinyBase. You even get a built-in <a href="#set-checkpoints-for-an-undo-stack">undo stack</a>, and <a href="#an-inspector-for-your-data">developer tools</a>!</p></section><section><h2 id="it-s-database-like">It's <em>Database-Like</em></h2><p>Consumer app? Enterprise app? Or even a game? Model <a href="#start-with-a-simple-key-value-store">key-value data</a> and <a href="#level-up-to-use-tabular-data">tabular data</a> with optional typed <a href="#apply-schemas-to-tables-values">schematization</a>, whatever its data structures. There are built-in <a href="#create-indexes-for-fast-lookups">indexing</a>, <a href="#define-metrics-and-aggregations">metric aggregation</a>, and tabular <a href="#model-table-relationships">relationships</a> APIs - and a powerful <a href="#build-complex-queries-with-tinyql">query engine</a> to select, join, filter, and group data (reactively!) without SQL.</p></section><section><h2 id="it-synchronizes">It <em>Synchronizes</em></h2><p>TinyBase has <a href="#synchronize-between-devices">native CRDT</a> support, meaning that you can deterministically <a href="https://tinybase.org/guides/synchronization/">synchronize</a> and merge data across multiple sources, clients, and servers. And although TinyBase is an in-memory data store, you can easily <a href="#persist-to-storage-databases-more">persist</a> your data to file, <a href="https://tinybase.org/api/persister-browser">browser storage</a>, <a href="https://tinybase.org/api/persister-indexed-db">IndexedDB</a>, <a href="https://tinybase.org/guides/persistence/database-persistence/">SQLite or PostgreSQL databases</a>, and <a href="https://tinybase.org/guides/persistence/third-party-crdt-persistence/">more</a>.</p></section><section><h2 id="it-s-built-for-a-local-first-world">It's Built For A <em>Local-First</em> World</h2><p>TinyBase works anywhere that JavaScript does, but it's especially great for local-first apps: where data is stored locally on the user's device and that can be run offline. It's tiny by name, tiny by nature: just <a href="#did-we-say-tiny">5.4kB - 11.6kB</a> and with no dependencies - yet <a href="#well-tested-and-documented">100% tested</a>, <a href="https://tinybase.org/guides/the-basics/getting-started/">fully documented</a>, and of course, <a href="https://github.com/tinyplex/tinybase">open source</a>!</p></section><hr><section id="friends"><h2 id="tinybase-works-great-on-its-own-but-also-plays-well-with-friends">TinyBase works great on its own, but also plays well with friends.</h2><div><a href="https://tinybase.org/guides/building-uis/getting-started-with-ui-react"><img src="https://tinybase.org/react.svg?asImg" width="48"> React</a></div><div><a href="https://tinybase.org/api/persister-indexed-db/functions/creation/createindexeddbpersister"><img src="https://tinybase.org/indexeddb.svg?asImg" width="48"> IndexedDB</a></div><div><a href="https://tinybase.org/guides/integrations/cloudflare-durable-objects"><img src="https://tinybase.org/cloudflare.svg?asImg" width="48"> Cloudflare</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/postgresql.svg?asImg" width="48"> PostgreSQL</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/pglite.svg?asImg" width="48"> PGlite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/sqlite.svg?asImg" width="48"> SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/bun.svg?asImg" width="48"> Bun SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/expo.svg?asImg" width="48"> Expo SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/electric.svg?asImg" width="48"> ElectricSQL</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/turso.svg?asImg" width="48"> Turso</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img src="https://tinybase.org/powersync.svg?asImg" width="48"> PowerSync</a></div><div><a href="https://tinybase.org/api/persister-partykit-client"><img src="https://tinybase.org/partykit.svg?asImg" width="48"> PartyKit</a></div><div><a href="https://tinybase.org/api/persister-yjs/functions/creation/createyjspersister"><img src="https://tinybase.org/yjs.svg?asImg" width="48"> YJS</a></div><div><a href="https://tinybase.org/api/persister-cr-sqlite-wasm"><img src="https://tinybase.org/crsqlite.png" width="48"> CR-SQLite</a></div><div><a href="https://tinybase.org/api/persister-automerge"><img src="https://tinybase.org/automerge.svg?asImg" width="48"> Automerge</a></div><p>(Baffled by all these logos? Check out our <a href="https://tinybase.org/guides/the-basics/architectural-options">architectural options</a> guide to make sense of it all!)</p></section><hr><section id="follow"><a href="https://github.com/tinyplex/tinybase" target="_blank"><img src="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=GitHub&labelColor=%23d81b60&color=%23333"> </a><a href="https://bsky.app/profile/tinybase.bsky.social"><img src="https://img.shields.io/badge/Bluesky-Follow-blue?style=for-the-badge&logo=bluesky&logoColor=%23fff&color=%23333&labelColor=%230285FF"> </a><a href="https://x.com/tinybasejs" target="_blank"><img src="https://img.shields.io/badge/%2F%20Twitter-Follow-blue?style=for-the-badge&logo=x&logoColor=%23fff&color=%23333&labelColor=%23000"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&logo=discord&logoColor=%23fff&label=Discord&labelColor=%233131e8&color=%23333"></a><br><a href="https://github.com/tinyplex/tinybase/discussions" target="_blank"><img src="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Ideas&labelColor=%23d81b60&color=%23333"> </a><a href="https://github.com/tinyplex/tinybase/issues" target="_blank"><img src="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Issues&labelColor=%23d81b60&color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&logo=jest&logoColor=%23fff&color=%23333&labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/6.1.1" target="_blank"><img src="https://img.shields.io/npm/v/tinybase?style=for-the-badge&logo=npm&logoColor=%23fff&labelColor=%23bd0005&color=%23333"></a></section><hr><section><h2 id="start-with-a-simple-key-value-store">Start with a simple key-value store.</h2><p>Creating a <a href="https://tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> requires just a simple call to the <a href="https://tinybase.org/api/store/functions/creation/createstore/"><code>createStore</code></a> function. Once you have one, you can easily set <a href="https://tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a> in it by unique <a href="https://tinybase.org/api/common/type-aliases/identity/id/"><code>Id</code></a>. And of course you can easily get them back out again.</p><p>Read more about using keyed value data in <a href="https://tinybase.org/guides/the-basics/">The Basics</a> guide.</p></section>
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
4
|
import {createStore} from 'tinybase';
|
|
@@ -275,4 +275,4 @@ console.log(store.getCell('pets', 'felix', 'sold'));
|
|
|
275
275
|
// -> false
|
|
276
276
|
```
|
|
277
277
|
|
|
278
|
-
<section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://tinybase.org/api/store/"><code>store</code></a> module alone, you'll only add a gzipped <em>5.4kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>11.6kB</em>.</p><p>The optional <a href="https://tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just <em>5.2kB</em>, the ui-react-dom components are another <em>2.6kB</em>, and everything is super fast. Life is easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured and packaged in the <a href="https://tinybase.org/guides/how-tinybase-is-built/architecture/">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th> </th><th>Minified .js.gz</th><th>Source .js</th></tr><tr><th class="right"><a href="https://tinybase.org/api/store/">tinybase/store</a> (minimal)</th><td>5.4kB</td><td>53.6kB</td></tr><tr><th class="right">tinybase (complete)</th><td>11.6kB</td><td>120.7kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/ui-react/">ui-react</a></th><td>5.2kB</td><td>55.6kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/ui-react-dom/">ui-react-dom</a></th><td>2.6kB</td><td>21.1kB</td></tr></tbody></table></div><section><h2 id="well-tested-and-documented">Well tested and documented.</h2><p>TinyBase has <em>100.0%</em> test coverage, including the code throughout the documentation - even on this page! The guides, demos, and API examples are designed to make it as easy as possible for you to get your TinyBase-powered app up and running.</p><p>Read more about how TinyBase is tested in the Unit <a href="https://tinybase.org/guides/how-tinybase-is-built/testing/">Testing</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>Total</th><th>Tested</th><th>Coverage</th></tr><tr><th class="right">Lines</th><td>2,308</td><td>2,308</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>2,494</td><td>2,494</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>997</td><td>997</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>876</td><td>876</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">7,084</td></tr><tr><th class="right">Assertions</th><td colspan="3">32,843</td></tr></tbody></table></div><hr><section id="sponsors"><h2 id="proud-to-be-sponsored-by">Proud to be sponsored by:</h2><a href="https://github.com/cpojer" target="_blank"><img src="https://github.com/cpojer.png?size=48" title="cpojer" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img src="https://github.com/expo.png?size=48" title="expo" width="48" height="48"></a><a href="https://github.com/beekeeb" target="_blank"><img src="https://github.com/beekeeb.png?size=48" title="beekeeb" width="48" height="48"></a><a href="https://github.com/cancelself" target="_blank"><img src="https://github.com/cancelself.png?size=48" title="cancelself" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img src="https://github.com/WonderPanda.png?size=48" title="WonderPanda" width="48" height="48"></a><a href="https://github.com/arpitBhalla" target="_blank"><img src="https://github.com/arpitBhalla.png?size=48" title="arpitBhalla" width="48" height="48"></a></section><section id="users"><h2 id="excited-to-be-used-by">Excited to be used by:</h2><a href="https://github.com/behrends" target="_blank"><img src="https://github.com/behrends.png?size=48" title="behrends" width="48" height="48"></a><a href="https://github.com/betomoedano" target="_blank"><img src="https://github.com/betomoedano.png?size=48" title="betomoedano" width="48" height="48"></a><a href="https://github.com/brentvatne" target="_blank"><img src="https://github.com/brentvatne.png?size=48" title="brentvatne" width="48" height="48"></a><a href="https://github.com/byCedric" target="_blank"><img src="https://github.com/byCedric.png?size=48" title="byCedric" width="48" height="48"></a><a href="https://github.com/circadian-risk" target="_blank"><img src="https://github.com/circadian-risk.png?size=48" title="circadian-risk" width="48" height="48"></a><a href="https://github.com/cpojer" target="_blank"><img src="https://github.com/cpojer.png?size=48" title="cpojer" width="48" height="48"></a><a href="https://github.com/cubecull" target="_blank"><img src="https://github.com/cubecull.png?size=48" title="cubecull" width="48" height="48"></a><a href="https://github.com/erwinkn" target="_blank"><img src="https://github.com/erwinkn.png?size=48" title="erwinkn" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img src="https://github.com/expo.png?size=48" title="expo" width="48" height="48"></a><a href="https://github.com/ezra-en" target="_blank"><img src="https://github.com/ezra-en.png?size=48" title="ezra-en" width="48" height="48"></a><a href="https://github.com/feychenie" target="_blank"><img src="https://github.com/feychenie.png?size=48" title="feychenie" width="48" height="48"></a><a href="https://github.com/flaming-codes" target="_blank"><img src="https://github.com/flaming-codes.png?size=48" title="flaming-codes" width="48" height="48"></a><a href="https://github.com/fostertheweb" target="_blank"><img src="https://github.com/fostertheweb.png?size=48" title="fostertheweb" width="48" height="48"></a><a href="https://github.com/Giulio987" target="_blank"><img src="https://github.com/Giulio987.png?size=48" title="Giulio987" width="48" height="48"></a><a href="https://github.com/hi-ogawa" target="_blank"><img src="https://github.com/hi-ogawa.png?size=48" title="hi-ogawa" width="48" height="48"></a><a href="https://github.com/itsdevcoffee" target="_blank"><img src="https://github.com/itsdevcoffee.png?size=48" title="itsdevcoffee" width="48" height="48"></a><a href="https://github.com/jbolda" target="_blank"><img src="https://github.com/jbolda.png?size=48" title="jbolda" width="48" height="48"></a><a href="https://github.com/Kayoo-asso" target="_blank"><img src="https://github.com/Kayoo-asso.png?size=48" title="Kayoo-asso" width="48" height="48"></a><a href="https://github.com/kotofurumiya" target="_blank"><img src="https://github.com/kotofurumiya.png?size=48" title="kotofurumiya" width="48" height="48"></a><a href="https://github.com/Kudo" target="_blank"><img src="https://github.com/Kudo.png?size=48" title="Kudo" width="48" height="48"></a><a href="https://github.com/learn-anything" target="_blank"><img src="https://github.com/learn-anything.png?size=48" title="learn-anything" width="48" height="48"></a><a href="https://github.com/lluc" target="_blank"><img src="https://github.com/lluc.png?size=48" title="lluc" width="48" height="48"></a><a href="https://github.com/marksteve" target="_blank"><img src="https://github.com/marksteve.png?size=48" title="marksteve" width="48" height="48"></a><a href="https://github.com/miking-the-viking" target="_blank"><img src="https://github.com/miking-the-viking.png?size=48" title="miking-the-viking" width="48" height="48"></a><a href="https://github.com/mjamesderocher" target="_blank"><img src="https://github.com/mjamesderocher.png?size=48" title="mjamesderocher" width="48" height="48"></a><a href="https://github.com/mouktardev" target="_blank"><img src="https://github.com/mouktardev.png?size=48" title="mouktardev" width="48" height="48"></a><a href="https://github.com/nickmessing" target="_blank"><img src="https://github.com/nickmessing.png?size=48" title="nickmessing" width="48" height="48"></a><a href="https://github.com/nikitavoloboev" target="_blank"><img src="https://github.com/nikitavoloboev.png?size=48" title="nikitavoloboev" width="48" height="48"></a><a href="https://github.com/nkzw-tech" target="_blank"><img src="https://github.com/nkzw-tech.png?size=48" title="nkzw-tech" width="48" height="48"></a><a href="https://github.com/palerdot" target="_blank"><img src="https://github.com/palerdot.png?size=48" title="palerdot" width="48" height="48"></a><a href="https://github.com/PorcoRosso85" target="_blank"><img src="https://github.com/PorcoRosso85.png?size=48" title="PorcoRosso85" width="48" height="48"></a><a href="https://github.com/primodiumxyz" target="_blank"><img src="https://github.com/primodiumxyz.png?size=48" title="primodiumxyz" width="48" height="48"></a><a href="https://github.com/shaneosullivan" target="_blank"><img src="https://github.com/shaneosullivan.png?size=48" title="shaneosullivan" width="48" height="48"></a><a href="https://github.com/sudo-self" target="_blank"><img src="https://github.com/sudo-self.png?size=48" title="sudo-self" width="48" height="48"></a><a href="https://github.com/SuperSonicHub1" target="_blank"><img src="https://github.com/SuperSonicHub1.png?size=48" title="SuperSonicHub1" width="48" height="48"></a><a href="https://github.com/threepointone" target="_blank"><img src="https://github.com/threepointone.png?size=48" title="threepointone" width="48" height="48"></a><a href="https://github.com/uptonking" target="_blank"><img src="https://github.com/uptonking.png?size=48" title="uptonking" width="48" height="48"></a><a href="https://github.com/ViktorZhurbin" target="_blank"><img src="https://github.com/ViktorZhurbin.png?size=48" title="ViktorZhurbin" width="48" height="48"></a><a href="https://github.com/wilkerlucio" target="_blank"><img src="https://github.com/wilkerlucio.png?size=48" title="wilkerlucio" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img src="https://github.com/WonderPanda.png?size=48" title="WonderPanda" width="48" height="48"></a></section><hr><p><a class="start" href="https://tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://tinybase.org/demos/">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section id="family"><h2 id="meet-the-family">Meet the family</h2><p>TinyBase is part of a group of small libraries designed to help make rich client and local-first apps easier to build. Check out the others!</p><p><img src="https://tinybase.org/favicon.svg?asImg" width="48"><br><b>TinyBase</b><br>A reactive data store and sync engine.</p><p><a href="https://tinywidgets.org" target="_blank"><img src="https://tinywidgets.org/favicon.svg?asImg" width="48"><br><b>TinyWidgets</b></a><br>A collection of tiny, reusable, UI components.</p><p><a href="https://tinytick.org" target="_blank"><img src="https://tinytick.org/favicon.svg?asImg" width="48"><br><b>TinyTick</b></a><br>A tiny but very useful task orchestrator.</p></section><hr><section id="about"><h2 id="about">About</h2><p>Modern apps deserve better. Why trade reactive user experiences to be able to use relational data? Or sacrifice features for bundle size? And why does the cloud do all the work <a href="https://localfirstweb.dev/" target="_blank">anyway</a>?</p><p>Building TinyBase was originally an interesting exercise for <a rel="me" href="https://tripleodeon.com">me</a> in API design, minification, and documentation. But now it has taken on a life of its own, and has grown beyond my wildest expectations.</p><p>It could not have been built without these great <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#giants">projects</a> and <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#and-friends">friends</a>, and I hope you enjoy using it as much as I do building it!</p></section><section id="story"><h2 id="the-story">The story</h2><a href="https://youtu.be/hXL7OkW-Prk?t=1232" target="_blank"><img src="https://tinybase.org/youtube.webp"></a></section>
|
|
278
|
+
<section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://tinybase.org/api/store/"><code>store</code></a> module alone, you'll only add a gzipped <em>5.4kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>11.6kB</em>.</p><p>The optional <a href="https://tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just <em>5.2kB</em>, the ui-react-dom components are another <em>2.6kB</em>, and everything is super fast. Life is easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured and packaged in the <a href="https://tinybase.org/guides/how-tinybase-is-built/architecture/">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th> </th><th>Minified .js.gz</th><th>Source .js</th></tr><tr><th class="right"><a href="https://tinybase.org/api/store/">tinybase/store</a> (minimal)</th><td>5.4kB</td><td>53.6kB</td></tr><tr><th class="right">tinybase (complete)</th><td>11.6kB</td><td>120.7kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/ui-react/">ui-react</a></th><td>5.2kB</td><td>55.6kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/ui-react-dom/">ui-react-dom</a></th><td>2.6kB</td><td>21.1kB</td></tr></tbody></table></div><section><h2 id="well-tested-and-documented">Well tested and documented.</h2><p>TinyBase has <em>100.0%</em> test coverage, including the code throughout the documentation - even on this page! The guides, demos, and API examples are designed to make it as easy as possible for you to get your TinyBase-powered app up and running.</p><p>Read more about how TinyBase is tested in the Unit <a href="https://tinybase.org/guides/how-tinybase-is-built/testing/">Testing</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>Total</th><th>Tested</th><th>Coverage</th></tr><tr><th class="right">Lines</th><td>2,308</td><td>2,308</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>2,494</td><td>2,494</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>997</td><td>997</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>876</td><td>876</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">7,083</td></tr><tr><th class="right">Assertions</th><td colspan="3">32,844</td></tr></tbody></table></div><hr><section id="sponsors"><h2 id="proud-to-be-sponsored-by">Proud to be sponsored by:</h2><a href="https://github.com/cpojer" target="_blank"><img src="https://github.com/cpojer.png?size=48" title="cpojer" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img src="https://github.com/expo.png?size=48" title="expo" width="48" height="48"></a><a href="https://github.com/beekeeb" target="_blank"><img src="https://github.com/beekeeb.png?size=48" title="beekeeb" width="48" height="48"></a><a href="https://github.com/cancelself" target="_blank"><img src="https://github.com/cancelself.png?size=48" title="cancelself" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img src="https://github.com/WonderPanda.png?size=48" title="WonderPanda" width="48" height="48"></a><a href="https://github.com/arpitBhalla" target="_blank"><img src="https://github.com/arpitBhalla.png?size=48" title="arpitBhalla" width="48" height="48"></a></section><section id="users"><h2 id="excited-to-be-used-by">Excited to be used by:</h2><a href="https://github.com/behrends" target="_blank"><img src="https://github.com/behrends.png?size=48" title="behrends" width="48" height="48"></a><a href="https://github.com/betomoedano" target="_blank"><img src="https://github.com/betomoedano.png?size=48" title="betomoedano" width="48" height="48"></a><a href="https://github.com/brentvatne" target="_blank"><img src="https://github.com/brentvatne.png?size=48" title="brentvatne" width="48" height="48"></a><a href="https://github.com/byCedric" target="_blank"><img src="https://github.com/byCedric.png?size=48" title="byCedric" width="48" height="48"></a><a href="https://github.com/circadian-risk" target="_blank"><img src="https://github.com/circadian-risk.png?size=48" title="circadian-risk" width="48" height="48"></a><a href="https://github.com/cpojer" target="_blank"><img src="https://github.com/cpojer.png?size=48" title="cpojer" width="48" height="48"></a><a href="https://github.com/cubecull" target="_blank"><img src="https://github.com/cubecull.png?size=48" title="cubecull" width="48" height="48"></a><a href="https://github.com/erwinkn" target="_blank"><img src="https://github.com/erwinkn.png?size=48" title="erwinkn" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img src="https://github.com/expo.png?size=48" title="expo" width="48" height="48"></a><a href="https://github.com/ezra-en" target="_blank"><img src="https://github.com/ezra-en.png?size=48" title="ezra-en" width="48" height="48"></a><a href="https://github.com/feychenie" target="_blank"><img src="https://github.com/feychenie.png?size=48" title="feychenie" width="48" height="48"></a><a href="https://github.com/flaming-codes" target="_blank"><img src="https://github.com/flaming-codes.png?size=48" title="flaming-codes" width="48" height="48"></a><a href="https://github.com/fostertheweb" target="_blank"><img src="https://github.com/fostertheweb.png?size=48" title="fostertheweb" width="48" height="48"></a><a href="https://github.com/Giulio987" target="_blank"><img src="https://github.com/Giulio987.png?size=48" title="Giulio987" width="48" height="48"></a><a href="https://github.com/hi-ogawa" target="_blank"><img src="https://github.com/hi-ogawa.png?size=48" title="hi-ogawa" width="48" height="48"></a><a href="https://github.com/itsdevcoffee" target="_blank"><img src="https://github.com/itsdevcoffee.png?size=48" title="itsdevcoffee" width="48" height="48"></a><a href="https://github.com/jbolda" target="_blank"><img src="https://github.com/jbolda.png?size=48" title="jbolda" width="48" height="48"></a><a href="https://github.com/Kayoo-asso" target="_blank"><img src="https://github.com/Kayoo-asso.png?size=48" title="Kayoo-asso" width="48" height="48"></a><a href="https://github.com/kotofurumiya" target="_blank"><img src="https://github.com/kotofurumiya.png?size=48" title="kotofurumiya" width="48" height="48"></a><a href="https://github.com/Kudo" target="_blank"><img src="https://github.com/Kudo.png?size=48" title="Kudo" width="48" height="48"></a><a href="https://github.com/learn-anything" target="_blank"><img src="https://github.com/learn-anything.png?size=48" title="learn-anything" width="48" height="48"></a><a href="https://github.com/lluc" target="_blank"><img src="https://github.com/lluc.png?size=48" title="lluc" width="48" height="48"></a><a href="https://github.com/marksteve" target="_blank"><img src="https://github.com/marksteve.png?size=48" title="marksteve" width="48" height="48"></a><a href="https://github.com/miking-the-viking" target="_blank"><img src="https://github.com/miking-the-viking.png?size=48" title="miking-the-viking" width="48" height="48"></a><a href="https://github.com/mjamesderocher" target="_blank"><img src="https://github.com/mjamesderocher.png?size=48" title="mjamesderocher" width="48" height="48"></a><a href="https://github.com/mouktardev" target="_blank"><img src="https://github.com/mouktardev.png?size=48" title="mouktardev" width="48" height="48"></a><a href="https://github.com/nickmessing" target="_blank"><img src="https://github.com/nickmessing.png?size=48" title="nickmessing" width="48" height="48"></a><a href="https://github.com/nikitavoloboev" target="_blank"><img src="https://github.com/nikitavoloboev.png?size=48" title="nikitavoloboev" width="48" height="48"></a><a href="https://github.com/nkzw-tech" target="_blank"><img src="https://github.com/nkzw-tech.png?size=48" title="nkzw-tech" width="48" height="48"></a><a href="https://github.com/palerdot" target="_blank"><img src="https://github.com/palerdot.png?size=48" title="palerdot" width="48" height="48"></a><a href="https://github.com/PorcoRosso85" target="_blank"><img src="https://github.com/PorcoRosso85.png?size=48" title="PorcoRosso85" width="48" height="48"></a><a href="https://github.com/primodiumxyz" target="_blank"><img src="https://github.com/primodiumxyz.png?size=48" title="primodiumxyz" width="48" height="48"></a><a href="https://github.com/shaneosullivan" target="_blank"><img src="https://github.com/shaneosullivan.png?size=48" title="shaneosullivan" width="48" height="48"></a><a href="https://github.com/sudo-self" target="_blank"><img src="https://github.com/sudo-self.png?size=48" title="sudo-self" width="48" height="48"></a><a href="https://github.com/SuperSonicHub1" target="_blank"><img src="https://github.com/SuperSonicHub1.png?size=48" title="SuperSonicHub1" width="48" height="48"></a><a href="https://github.com/threepointone" target="_blank"><img src="https://github.com/threepointone.png?size=48" title="threepointone" width="48" height="48"></a><a href="https://github.com/uptonking" target="_blank"><img src="https://github.com/uptonking.png?size=48" title="uptonking" width="48" height="48"></a><a href="https://github.com/ViktorZhurbin" target="_blank"><img src="https://github.com/ViktorZhurbin.png?size=48" title="ViktorZhurbin" width="48" height="48"></a><a href="https://github.com/wilkerlucio" target="_blank"><img src="https://github.com/wilkerlucio.png?size=48" title="wilkerlucio" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img src="https://github.com/WonderPanda.png?size=48" title="WonderPanda" width="48" height="48"></a></section><hr><p><a class="start" href="https://tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://tinybase.org/demos/">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section id="family"><h2 id="meet-the-family">Meet the family</h2><p>TinyBase is part of a group of small libraries designed to help make rich client and local-first apps easier to build. Check out the others!</p><p><img src="https://tinybase.org/favicon.svg?asImg" width="48"><br><b>TinyBase</b><br>A reactive data store and sync engine.</p><p><a href="https://tinywidgets.org" target="_blank"><img src="https://tinywidgets.org/favicon.svg?asImg" width="48"><br><b>TinyWidgets</b></a><br>A collection of tiny, reusable, UI components.</p><p><a href="https://tinytick.org" target="_blank"><img src="https://tinytick.org/favicon.svg?asImg" width="48"><br><b>TinyTick</b></a><br>A tiny but very useful task orchestrator.</p></section><hr><section id="about"><h2 id="about">About</h2><p>Modern apps deserve better. Why trade reactive user experiences to be able to use relational data? Or sacrifice features for bundle size? And why does the cloud do all the work <a href="https://localfirstweb.dev/" target="_blank">anyway</a>?</p><p>Building TinyBase was originally an interesting exercise for <a rel="me" href="https://tripleodeon.com">me</a> in API design, minification, and documentation. But now it has taken on a life of its own, and has grown beyond my wildest expectations.</p><p>It could not have been built without these great <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#giants">projects</a> and <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#and-friends">friends</a>, and I hope you enjoy using it as much as I do building it!</p></section><section id="story"><h2 id="the-story">The story</h2><a href="https://youtu.be/hXL7OkW-Prk?t=1232" target="_blank"><img src="https://tinybase.org/youtube.webp"></a></section>
|
package/releases.md
CHANGED
|
@@ -84,7 +84,7 @@ export class MyDurableObject extends WsServerDurableObject {
|
|
|
84
84
|
}
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
<p>You can get started quickly with this architecture using the <a href="https://github.com/tinyplex/vite-tinybase-ts-react-sync-durable-object">new Vite template</a> that accompanies this release.</p><h2 id="server-reference-implementation">Server Reference Implementation</h2><p>Unrelated to Durable Objects, this release also includes the new <a href="https://tinybase.org/api/synchronizer-ws-server-simple/"><code>synchronizer-ws-server-simple</code></a> module that contains a simple server implementation called <a href="https://tinybase.org/api/synchronizer-ws-server-simple/interfaces/server/wsserversimple/"><code>WsServerSimple</code></a>. Without the complications of listeners, persistence, or statistics, this is more suitable to be used as a reference implementation for other server environments.</p><h2 id="architectural-guide">Architectural Guide</h2><p>To go with this release, we have added new documentation on ways in which you can use TinyBase in an app architecture. Check it out in the new <a href="https://tinybase.org/guides/the-basics/architectural-options/">Architectural Options</a> guide.</p><p>We've also started a new section of documentation for describing integrations, of which the <a href="https://tinybase.org/guides/integrations/cloudflare-durable-objects/">Cloudflare Durable Objects</a> guide, of course, is the first new entry!</p><hr><h1 id="v5-3">v5.3</h1><p>This release is focussed on a few API improvements and quality-of-life changes. These include:</p><h2 id="react-ssr-support">React SSR support</h2><p>Thanks to contributor <a href="https://github.com/muhajirdev">Muhammad Muhajir</a> for ensuring that TinyBase runs in server-side rendering environments!</p><h2 id="in-the-persisters-module">In the <a href="https://tinybase.org/api/persisters/"><code>persisters</code></a> module...</h2><p>All <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> objects now expose information about whether they are loading or saving. To access this <a href="https://tinybase.org/api/persisters/enumerations/lifecycle/status/"><code>Status</code></a>, use:</p><ul><li>The <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/methods/lifecycle/getstatus/"><code>getStatus</code></a> method, which will return 0 when it is idle, 1 when it is loading, and 2 when it is saving.</li><li>The <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/methods/listener/addstatuslistener/"><code>addStatusListener</code></a> method, which lets you add a <a href="https://tinybase.org/api/persisters/type-aliases/listener/statuslistener/"><code>StatusListener</code></a> function and which is called whenever the status changes.</li></ul><p>These make it possible to track background load and save activities, so that, for example, you can show a status-bar spinner of asynchronous persistence activity.</p><h2 id="in-the-synchronizers-module">In the <a href="https://tinybase.org/api/synchronizers/"><code>synchronizers</code></a> module...</h2><p>Synchronizers are a sub-class of <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a>, so all <a href="https://tinybase.org/api/synchronizers/interfaces/synchronizer/synchronizer/"><code>Synchronizer</code></a> objects now also have:</p><ul><li>The <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/methods/lifecycle/getstatus/"><code>getStatus</code></a> method, which will return 0 when it is idle, 1 when it is 'loading' (ie inbound syncing), and 2 when it is 'saving' (ie outbound syncing).</li><li>The <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/methods/listener/addstatuslistener/"><code>addStatusListener</code></a> method, which lets you add a <a href="https://tinybase.org/api/persisters/type-aliases/listener/statuslistener/"><code>StatusListener</code></a> function and which is called whenever the status changes.</li></ul><h2 id="in-the-ui-react-module">In the <a href="https://tinybase.org/api/ui-react/"><code>ui-react</code></a> module...</h2><p>There are corresponding hooks so that you can build these status changes into a React UI easily:</p><ul><li>The <a href="https://tinybase.org/api/ui-react/functions/persister-hooks/usepersisterstatus/"><code>usePersisterStatus</code></a> hook, which will return the status for an explicitly provided, or context-derived <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a>.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/persister-hooks/usepersisterstatuslistener/"><code>usePersisterStatusListener</code></a> hook, which lets you add your own <a href="https://tinybase.org/api/persisters/type-aliases/listener/statuslistener/"><code>StatusListener</code></a> function to a <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a>.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/persister-hooks/usepersister/"><code>usePersister</code></a> hook, which lets you get direct access to a <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> from within your UI.</li></ul><p>And correspondingly for Synchronizers:</p><ul><li>The <a href="https://tinybase.org/api/ui-react/functions/synchronizer-hooks/usesynchronizerstatus/"><code>useSynchronizerStatus</code></a> hook, which will return the status for an explicitly provided, or context-derived <a href="https://tinybase.org/api/synchronizers/interfaces/synchronizer/synchronizer/"><code>Synchronizer</code></a>.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/synchronizer-hooks/usesynchronizerstatuslistener/"><code>useSynchronizerStatusListener</code></a> hook, which lets you add your own <a href="https://tinybase.org/api/persisters/type-aliases/listener/statuslistener/"><code>StatusListener</code></a> function to a <a href="https://tinybase.org/api/synchronizers/interfaces/synchronizer/synchronizer/"><code>Synchronizer</code></a>.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/synchronizer-hooks/usesynchronizer/"><code>useSynchronizer</code></a> hook, which lets you get direct access to a <a href="https://tinybase.org/api/synchronizers/interfaces/synchronizer/synchronizer/"><code>Synchronizer</code></a> from within your UI.</li></ul><p>In addition, this module also now includes hooks for injecting objects into the Provider context scope imperatively, much like the existing <a href="https://tinybase.org/api/ui-react/functions/store-hooks/useprovidestore/"><code>useProvideStore</code></a> hook:</p><ul><li>The <a href="https://tinybase.org/api/ui-react/functions/metrics-hooks/useprovidemetrics/"><code>useProvideMetrics</code></a> hook, which lets you imperatively register <a href="https://tinybase.org/api/metrics/interfaces/metrics/metrics/"><code>Metrics</code></a> objects.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/other/useprovideindexes/"><code>useProvideIndexes</code></a> hook, which lets you register <a href="https://tinybase.org/api/indexes/interfaces/indexes/indexes/"><code>Indexes</code></a> objects.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/other/useproviderelationships/"><code>useProvideRelationships</code></a> hook, which lets you register <a href="https://tinybase.org/api/relationships/interfaces/relationships/relationships/"><code>Relationships</code></a> objects.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/other/useprovidequeries/"><code>useProvideQueries</code></a> hook, which lets you register <a href="https://tinybase.org/api/queries/interfaces/queries/queries/"><code>Queries</code></a> objects.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/other/useprovidecheckpoints/"><code>useProvideCheckpoints</code></a> hook, which lets you register <a href="https://tinybase.org/api/checkpoints/interfaces/checkpoints/checkpoints/"><code>Checkpoints</code></a> objects.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/other/useprovidepersister/"><code>useProvidePersister</code></a> hook, which lets you register <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> objects.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/other/useprovidesynchronizer/"><code>useProvideSynchronizer</code></a> hook, which lets you register <a href="https://tinybase.org/api/synchronizers/interfaces/synchronizer/synchronizer/"><code>Synchronizer</code></a> objects.</li></ul><p>All of these new methods have extensive documentation, each with examples to show how to use them.</p><p>Please provide feedback on this new release on GitHub!</p><hr><h1 id="v5-2">v5.2</h1><p>This release introduces new Persisters for... PostgreSQL! TinyBase now has two new <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> modules:</p><ul><li>The <a href="https://tinybase.org/api/persister-postgres/"><code>persister-postgres</code></a> module provides the <a href="https://tinybase.org/api/persister-postgres/interfaces/persister/postgrespersister/"><code>PostgresPersister</code></a>, which uses the excellent <a href="https://github.com/porsager/postgres"><code>postgres</code></a> module to bind to regular PostgreSQL databases, generally on a server.</li><li>The <a href="https://tinybase.org/api/persister-pglite/"><code>persister-pglite</code></a> module provides the <a href="https://tinybase.org/api/persister-pglite/interfaces/persister/pglitepersister/"><code>PglitePersister</code></a>, which uses the new and exciting <a href="https://github.com/electric-sql/pglite"><code>pglite</code></a> module for running PostgreSQL... in a browser!</li></ul><p>Conceptually, things behave in the same way as they do for the various SQLite persisters. Simply use the <a href="https://tinybase.org/api/persister-postgres/functions/creation/createpostgrespersister/"><code>createPostgresPersister</code></a> function (or the similar <a href="https://tinybase.org/api/persister-pglite/functions/creation/createpglitepersister/"><code>createPglitePersister</code></a> function) to persist your TinyBase data:</p>
|
|
87
|
+
<p>You can get started quickly with this architecture using the <a href="https://github.com/tinyplex/vite-tinybase-ts-react-sync-durable-object">new Vite template</a> that accompanies this release.</p><h2 id="server-reference-implementation">Server Reference Implementation</h2><p>Unrelated to Durable Objects, this release also includes the new <a href="https://tinybase.org/api/synchronizer-ws-server-simple/"><code>synchronizer-ws-server-simple</code></a> module that contains a simple server implementation called <a href="https://tinybase.org/api/synchronizer-ws-server-simple/interfaces/server/wsserversimple/"><code>WsServerSimple</code></a>. Without the complications of listeners, persistence, or statistics, this is more suitable to be used as a reference implementation for other server environments.</p><h2 id="architectural-guide">Architectural Guide</h2><p>To go with this release, we have added new documentation on ways in which you can use TinyBase in an app architecture. Check it out in the new <a href="https://tinybase.org/guides/the-basics/architectural-options/">Architectural Options</a> guide.</p><p>We've also started a new section of documentation for describing integrations, of which the <a href="https://tinybase.org/guides/integrations/cloudflare-durable-objects/">Cloudflare Durable Objects</a> guide, of course, is the first new entry!</p><hr><h1 id="v5-3">v5.3</h1><p>This release is focussed on a few API improvements and quality-of-life changes. These include:</p><h2 id="react-ssr-support">React SSR support</h2><p>Thanks to contributor <a href="https://github.com/muhajirdev">Muhammad Muhajir</a> for ensuring that TinyBase runs in server-side rendering environments!</p><h2 id="in-the-persisters-module">In the <a href="https://tinybase.org/api/persisters/"><code>persisters</code></a> module...</h2><p>All <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> objects now expose information about whether they are loading or saving. To access this <a href="https://tinybase.org/api/persisters/enumerations/lifecycle/status/"><code>Status</code></a>, use:</p><ul><li>The <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/methods/lifecycle/getstatus/"><code>getStatus</code></a> method, which will return 0 when it is idle, 1 when it is loading, and 2 when it is saving.</li><li>The <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/methods/listener/addstatuslistener/"><code>addStatusListener</code></a> method, which lets you add a <a href="https://tinybase.org/api/persisters/type-aliases/listener/statuslistener/"><code>StatusListener</code></a> function and which is called whenever the status changes.</li></ul><p>These make it possible to track background load and save activities, so that, for example, you can show a status-bar spinner of asynchronous persistence activity.</p><h2 id="in-the-synchronizers-module">In the <a href="https://tinybase.org/api/synchronizers/"><code>synchronizers</code></a> module...</h2><p>Synchronizers are a sub-class of <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a>, so all <a href="https://tinybase.org/api/synchronizers/interfaces/synchronizer/synchronizer/"><code>Synchronizer</code></a> objects now also have:</p><ul><li>The <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/methods/lifecycle/getstatus/"><code>getStatus</code></a> method, which will return 0 when it is idle, 1 when it is 'loading' (ie inbound syncing), and 2 when it is 'saving' (ie outbound syncing).</li><li>The <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/methods/listener/addstatuslistener/"><code>addStatusListener</code></a> method, which lets you add a <a href="https://tinybase.org/api/persisters/type-aliases/listener/statuslistener/"><code>StatusListener</code></a> function and which is called whenever the status changes.</li></ul><h2 id="in-the-ui-react-module">In the <a href="https://tinybase.org/api/ui-react/"><code>ui-react</code></a> module...</h2><p>There are corresponding hooks so that you can build these status changes into a React UI easily:</p><ul><li>The <a href="https://tinybase.org/api/ui-react/functions/persister-hooks/usepersisterstatus/"><code>usePersisterStatus</code></a> hook, which will return the status for an explicitly provided, or context-derived <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a>.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/persister-hooks/usepersisterstatuslistener/"><code>usePersisterStatusListener</code></a> hook, which lets you add your own <a href="https://tinybase.org/api/persisters/type-aliases/listener/statuslistener/"><code>StatusListener</code></a> function to a <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a>.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/persister-hooks/usepersister/"><code>usePersister</code></a> hook, which lets you get direct access to a <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> from within your UI.</li></ul><p>And correspondingly for Synchronizers:</p><ul><li>The <a href="https://tinybase.org/api/ui-react/functions/synchronizer-hooks/usesynchronizerstatus/"><code>useSynchronizerStatus</code></a> hook, which will return the status for an explicitly provided, or context-derived <a href="https://tinybase.org/api/synchronizers/interfaces/synchronizer/synchronizer/"><code>Synchronizer</code></a>.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/synchronizer-hooks/usesynchronizerstatuslistener/"><code>useSynchronizerStatusListener</code></a> hook, which lets you add your own <a href="https://tinybase.org/api/persisters/type-aliases/listener/statuslistener/"><code>StatusListener</code></a> function to a <a href="https://tinybase.org/api/synchronizers/interfaces/synchronizer/synchronizer/"><code>Synchronizer</code></a>.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/synchronizer-hooks/usesynchronizer/"><code>useSynchronizer</code></a> hook, which lets you get direct access to a <a href="https://tinybase.org/api/synchronizers/interfaces/synchronizer/synchronizer/"><code>Synchronizer</code></a> from within your UI.</li></ul><p>In addition, this module also now includes hooks for injecting objects into the Provider context scope imperatively, much like the existing <a href="https://tinybase.org/api/ui-react/functions/store-hooks/useprovidestore/"><code>useProvideStore</code></a> hook:</p><ul><li>The <a href="https://tinybase.org/api/ui-react/functions/metrics-hooks/useprovidemetrics/"><code>useProvideMetrics</code></a> hook, which lets you imperatively register <a href="https://tinybase.org/api/metrics/interfaces/metrics/metrics/"><code>Metrics</code></a> objects.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/indexes-hooks/useprovideindexes/"><code>useProvideIndexes</code></a> hook, which lets you register <a href="https://tinybase.org/api/indexes/interfaces/indexes/indexes/"><code>Indexes</code></a> objects.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/relationships-hooks/useproviderelationships/"><code>useProvideRelationships</code></a> hook, which lets you register <a href="https://tinybase.org/api/relationships/interfaces/relationships/relationships/"><code>Relationships</code></a> objects.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/queries-hooks/useprovidequeries/"><code>useProvideQueries</code></a> hook, which lets you register <a href="https://tinybase.org/api/queries/interfaces/queries/queries/"><code>Queries</code></a> objects.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/checkpoints-hooks/useprovidecheckpoints/"><code>useProvideCheckpoints</code></a> hook, which lets you register <a href="https://tinybase.org/api/checkpoints/interfaces/checkpoints/checkpoints/"><code>Checkpoints</code></a> objects.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/persister-hooks/useprovidepersister/"><code>useProvidePersister</code></a> hook, which lets you register <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> objects.</li><li>The <a href="https://tinybase.org/api/ui-react/functions/synchronizer-hooks/useprovidesynchronizer/"><code>useProvideSynchronizer</code></a> hook, which lets you register <a href="https://tinybase.org/api/synchronizers/interfaces/synchronizer/synchronizer/"><code>Synchronizer</code></a> objects.</li></ul><p>All of these new methods have extensive documentation, each with examples to show how to use them.</p><p>Please provide feedback on this new release on GitHub!</p><hr><h1 id="v5-2">v5.2</h1><p>This release introduces new Persisters for... PostgreSQL! TinyBase now has two new <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> modules:</p><ul><li>The <a href="https://tinybase.org/api/persister-postgres/"><code>persister-postgres</code></a> module provides the <a href="https://tinybase.org/api/persister-postgres/interfaces/persister/postgrespersister/"><code>PostgresPersister</code></a>, which uses the excellent <a href="https://github.com/porsager/postgres"><code>postgres</code></a> module to bind to regular PostgreSQL databases, generally on a server.</li><li>The <a href="https://tinybase.org/api/persister-pglite/"><code>persister-pglite</code></a> module provides the <a href="https://tinybase.org/api/persister-pglite/interfaces/persister/pglitepersister/"><code>PglitePersister</code></a>, which uses the new and exciting <a href="https://github.com/electric-sql/pglite"><code>pglite</code></a> module for running PostgreSQL... in a browser!</li></ul><p>Conceptually, things behave in the same way as they do for the various SQLite persisters. Simply use the <a href="https://tinybase.org/api/persister-postgres/functions/creation/createpostgrespersister/"><code>createPostgresPersister</code></a> function (or the similar <a href="https://tinybase.org/api/persister-pglite/functions/creation/createpglitepersister/"><code>createPglitePersister</code></a> function) to persist your TinyBase data:</p>
|
|
88
88
|
|
|
89
89
|
```js
|
|
90
90
|
import postgres from 'postgres';
|