tinybase 4.7.1 → 4.7.3

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.
@@ -10,8 +10,8 @@
10
10
  * @module checkpoints
11
11
  */
12
12
 
13
- import {Id, IdOrNull, Ids} from './common.d';
14
- import {Store} from './store.d';
13
+ import {Id, IdOrNull, Ids} from './common.d.ts';
14
+ import {Store} from './store.d.ts';
15
15
 
16
16
  /**
17
17
  * The CheckpointIds type is a representation of the list of checkpoint Ids
@@ -10,8 +10,8 @@
10
10
  * @module indexes
11
11
  */
12
12
 
13
- import {GetCell, RowCallback, Store} from './store.d';
14
- import {Id, IdOrNull, Ids, SortKey} from './common.d';
13
+ import {GetCell, RowCallback, Store} from './store.d.ts';
14
+ import {Id, IdOrNull, Ids, SortKey} from './common.d.ts';
15
15
 
16
16
  /**
17
17
  * The Index type represents the concept of a map of Slice objects, keyed by Id.
@@ -10,8 +10,8 @@
10
10
  * @module metrics
11
11
  */
12
12
 
13
- import {GetCell, Store} from './store.d';
14
- import {Id, IdOrNull, Ids} from './common.d';
13
+ import {GetCell, Store} from './store.d.ts';
14
+ import {Id, IdOrNull, Ids} from './common.d.ts';
15
15
 
16
16
  /**
17
17
  * The Metric type is simply an alias, but represents a number formed by
@@ -11,8 +11,8 @@
11
11
  * @since v4.0.0
12
12
  */
13
13
 
14
- import {Persister} from '../persisters.d';
15
- import {Store} from '../store.d';
14
+ import {Persister} from '../persisters.d.ts';
15
+ import {Store} from '../store.d.ts';
16
16
  import {Doc as YDoc} from 'yjs';
17
17
 
18
18
  /**
@@ -39,8 +39,8 @@
39
39
  * @module persisters
40
40
  */
41
41
 
42
- import {GetTransactionChanges, Store, Tables, Values} from './store.d';
43
- import {Id} from './common.d';
42
+ import {GetTransactionChanges, Store, Tables, Values} from './store.d.ts';
43
+ import {Id} from './common.d.ts';
44
44
 
45
45
  /**
46
46
  * The PersisterStats type describes the number of times a Persister object has
@@ -11,8 +11,8 @@
11
11
  * @since v2.0.0
12
12
  */
13
13
 
14
- import {Cell, CellOrUndefined, GetCell, GetIdChanges, Store} from './store.d';
15
- import {Id, IdOrNull, Ids} from './common.d';
14
+ import {Cell, CellOrUndefined, GetCell, GetIdChanges, Store} from './store.d.ts';
15
+ import {Id, IdOrNull, Ids} from './common.d.ts';
16
16
 
17
17
  /**
18
18
  * The ResultTable type is the data structure representing the results of a
@@ -10,8 +10,8 @@
10
10
  * @module relationships
11
11
  */
12
12
 
13
- import {GetCell, RowCallback, Store} from './store.d';
14
- import {Id, IdOrNull, Ids} from './common.d';
13
+ import {GetCell, RowCallback, Store} from './store.d.ts';
14
+ import {Id, IdOrNull, Ids} from './common.d.ts';
15
15
 
16
16
  /**
17
17
  * The Relationship type represents the concept of a map that connects one Row
@@ -10,7 +10,7 @@
10
10
  * @module store
11
11
  */
12
12
 
13
- import {Id, IdOrNull, Ids, Json} from './common.d';
13
+ import {Id, IdOrNull, Ids, Json} from './common.d.ts';
14
14
 
15
15
  /**
16
16
  * The TablesSchema type describes the tabular structure of a Store in terms of
@@ -3,11 +3,11 @@
3
3
  * @packageDocumentation
4
4
  */
5
5
 
6
- export * from './checkpoints.d';
7
- export * from './common.d';
8
- export * from './indexes.d';
9
- export * from './metrics.d';
10
- export * from './persisters.d';
11
- export * from './queries.d';
12
- export * from './relationships.d';
13
- export * from './store.d';
6
+ export * from './checkpoints.d.ts';
7
+ export * from './common.d.ts';
8
+ export * from './indexes.d.ts';
9
+ export * from './metrics.d.ts';
10
+ export * from './persisters.d.ts';
11
+ export * from './queries.d.ts';
12
+ export * from './relationships.d.ts';
13
+ export * from './store.d.ts';
@@ -9,8 +9,8 @@
9
9
  * @since v2.2.0
10
10
  */
11
11
 
12
- import {Store, TablesSchema, ValuesSchema} from './store.d';
13
- import {Id} from './common.d';
12
+ import {Store, TablesSchema, ValuesSchema} from './store.d.ts';
13
+ import {Id} from './common.d.ts';
14
14
 
15
15
  /**
16
16
  * The StoreStats type describes a set of statistics about the Store, and
@@ -22,7 +22,7 @@
22
22
  * @module ui-react
23
23
  */
24
24
 
25
- import {Callback, Id, IdOrNull, Ids, ParameterizedCallback} from './common.d';
25
+ import {Callback, Id, IdOrNull, Ids, ParameterizedCallback} from './common.d.ts';
26
26
  import {
27
27
  Cell,
28
28
  CellIdsListener,
@@ -56,22 +56,22 @@ import {
56
56
  ValueOrUndefined,
57
57
  Values,
58
58
  ValuesListener,
59
- } from './store.d';
59
+ } from './store.d.ts';
60
60
  import {
61
61
  CheckpointIds,
62
62
  CheckpointIdsListener,
63
63
  CheckpointListener,
64
64
  Checkpoints,
65
- } from './checkpoints.d';
65
+ } from './checkpoints.d.ts';
66
66
  import {ComponentType, ReactElement} from 'react';
67
- import {Indexes, SliceIdsListener, SliceRowIdsListener} from './indexes.d';
67
+ import {Indexes, SliceIdsListener, SliceRowIdsListener} from './indexes.d.ts';
68
68
  import {
69
69
  LinkedRowIdsListener,
70
70
  LocalRowIdsListener,
71
71
  Relationships,
72
72
  RemoteRowIdListener,
73
- } from './relationships.d';
74
- import {MetricListener, Metrics} from './metrics.d';
73
+ } from './relationships.d.ts';
74
+ import {MetricListener, Metrics} from './metrics.d.ts';
75
75
  import {
76
76
  Queries,
77
77
  ResultCellIdsListener,
@@ -82,8 +82,8 @@ import {
82
82
  ResultSortedRowIdsListener,
83
83
  ResultTableCellIdsListener,
84
84
  ResultTableListener,
85
- } from './queries.d';
86
- import {Persister} from './persisters.d';
85
+ } from './queries.d.ts';
86
+ import {Persister} from './persisters.d.ts';
87
87
 
88
88
  /**
89
89
  * The StoreOrStoreId type is used when you need to refer to a Store in a React
@@ -10,8 +10,8 @@
10
10
  * @module checkpoints
11
11
  */
12
12
 
13
- import {Id, IdOrNull, Ids} from './common.d';
14
- import {OptionalSchemas, Store} from './store.d';
13
+ import {Id, IdOrNull, Ids} from './common.d.ts';
14
+ import {OptionalSchemas, Store} from './store.d.ts';
15
15
 
16
16
  /**
17
17
  * The CheckpointIds type is a representation of the list of checkpoint Ids
@@ -17,8 +17,8 @@ import {
17
17
  OptionalTablesSchema,
18
18
  RowCallback,
19
19
  Store,
20
- } from './store.d';
21
- import {Id, IdOrNull, Ids, SortKey} from './common.d';
20
+ } from './store.d.ts';
21
+ import {Id, IdOrNull, Ids, SortKey} from './common.d.ts';
22
22
 
23
23
  /**
24
24
  * The Index type represents the concept of a map of Slice objects, keyed by Id.
@@ -11,8 +11,8 @@
11
11
  */
12
12
 
13
13
  import {CellIdFromSchema, TableIdFromSchema} from './internal/store';
14
- import {GetCell, OptionalSchemas, Store} from './store.d';
15
- import {Id, IdOrNull, Ids} from './common.d';
14
+ import {GetCell, OptionalSchemas, Store} from './store.d.ts';
15
+ import {Id, IdOrNull, Ids} from './common.d.ts';
16
16
 
17
17
  /**
18
18
  * The Metric type is simply an alias, but represents a number formed by
@@ -11,8 +11,8 @@
11
11
  * @since v4.0.0
12
12
  */
13
13
 
14
- import {OptionalSchemas, Store} from '../store.d';
15
- import {Persister} from '../persisters.d';
14
+ import {OptionalSchemas, Store} from '../store.d.ts';
15
+ import {Persister} from '../persisters.d.ts';
16
16
  import {Doc as YDoc} from 'yjs';
17
17
 
18
18
  /**
@@ -46,7 +46,7 @@ import {
46
46
  Store,
47
47
  Tables,
48
48
  Values,
49
- } from './store.d';
49
+ } from './store.d.ts';
50
50
  import {TableIdFromSchema} from './internal/store';
51
51
 
52
52
  /**
@@ -19,11 +19,11 @@ import {
19
19
  OptionalSchemas,
20
20
  OptionalTablesSchema,
21
21
  Store,
22
- } from './store.d';
22
+ } from './store.d.ts';
23
23
  import {CellIdFromSchema, TableIdFromSchema} from './internal/store';
24
24
  import {GetResultCell, JoinedCellIdOrId} from './internal/queries';
25
- import {Id, IdOrNull, Ids} from './common.d';
26
- import {GetIdChanges} from '../store.d';
25
+ import {Id, IdOrNull, Ids} from './common.d.ts';
26
+ import {GetIdChanges} from '../store.d.ts';
27
27
 
28
28
  /**
29
29
  * The ResultTable type is the data structure representing the results of a
@@ -17,8 +17,8 @@ import {
17
17
  OptionalTablesSchema,
18
18
  RowCallback,
19
19
  Store,
20
- } from './store.d';
21
- import {Id, IdOrNull, Ids} from './common.d';
20
+ } from './store.d.ts';
21
+ import {Id, IdOrNull, Ids} from './common.d.ts';
22
22
 
23
23
  /**
24
24
  * The Relationship type represents the concept of a map that connects one Row
@@ -21,7 +21,7 @@ import {
21
21
  Truncate,
22
22
  ValueIdFromSchema,
23
23
  } from './internal/store';
24
- import {Id, IdOrNull, Ids, Json} from './common.d';
24
+ import {Id, IdOrNull, Ids, Json} from './common.d.ts';
25
25
 
26
26
  /**
27
27
  * The TablesSchema type describes the tabular structure of a Store in terms of
@@ -3,11 +3,11 @@
3
3
  * @packageDocumentation
4
4
  */
5
5
 
6
- export * from './checkpoints.d';
7
- export * from './common.d';
8
- export * from './indexes.d';
9
- export * from './metrics.d';
10
- export * from './persisters.d';
11
- export * from './queries.d';
12
- export * from './relationships.d';
13
- export * from './store.d';
6
+ export * from './checkpoints.d.ts';
7
+ export * from './common.d.ts';
8
+ export * from './indexes.d.ts';
9
+ export * from './metrics.d.ts';
10
+ export * from './persisters.d.ts';
11
+ export * from './queries.d.ts';
12
+ export * from './relationships.d.ts';
13
+ export * from './store.d.ts';
@@ -9,8 +9,8 @@
9
9
  * @since v2.2.0
10
10
  */
11
11
 
12
- import {OptionalSchemas, Store} from './store.d';
13
- import {Id} from './common.d';
12
+ import {OptionalSchemas, Store} from './store.d.ts';
13
+ import {Id} from './common.d.ts';
14
14
 
15
15
  /**
16
16
  * The StoreStats type describes a set of statistics about the Store, and
@@ -64,7 +64,7 @@ import {
64
64
  ValueProps,
65
65
  ValuesProps,
66
66
  } from './internal/ui-react';
67
- import {Callback, Id, IdOrNull, Ids, ParameterizedCallback} from './common.d';
67
+ import {Callback, Id, IdOrNull, Ids, ParameterizedCallback} from './common.d.ts';
68
68
  import {
69
69
  Cell,
70
70
  CellIdsListener,
@@ -98,21 +98,21 @@ import {
98
98
  ValueListener,
99
99
  Values,
100
100
  ValuesListener,
101
- } from './store.d';
101
+ } from './store.d.ts';
102
102
  import {
103
103
  CheckpointIds,
104
104
  CheckpointIdsListener,
105
105
  CheckpointListener,
106
106
  Checkpoints,
107
- } from './checkpoints.d';
108
- import {Indexes, SliceIdsListener, SliceRowIdsListener} from './indexes.d';
107
+ } from './checkpoints.d.ts';
108
+ import {Indexes, SliceIdsListener, SliceRowIdsListener} from './indexes.d.ts';
109
109
  import {
110
110
  LinkedRowIdsListener,
111
111
  LocalRowIdsListener,
112
112
  Relationships,
113
113
  RemoteRowIdListener,
114
- } from './relationships.d';
115
- import {MetricListener, Metrics} from './metrics.d';
114
+ } from './relationships.d.ts';
115
+ import {MetricListener, Metrics} from './metrics.d.ts';
116
116
  import {
117
117
  Queries,
118
118
  ResultCell,
@@ -126,8 +126,8 @@ import {
126
126
  ResultTable,
127
127
  ResultTableCellIdsListener,
128
128
  ResultTableListener,
129
- } from './queries.d';
130
- import {Persister} from './persisters.d';
129
+ } from './queries.d.ts';
130
+ import {Persister} from './persisters.d.ts';
131
131
  import {ReactElement} from 'react';
132
132
 
133
133
  export type WithSchemas<Schemas extends OptionalSchemas> = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinybase",
3
- "version": "4.7.1",
3
+ "version": "4.7.3",
4
4
  "author": "jamesgpearce",
5
5
  "repository": "github:tinyplex/tinybase",
6
6
  "license": "MIT",
@@ -214,14 +214,14 @@
214
214
  "publishPackage": "gulp publishPackage"
215
215
  },
216
216
  "devDependencies": {
217
- "@automerge/automerge": "^2.1.10",
218
- "@automerge/automerge-repo": "^1.1.2",
219
- "@babel/cli": "^7.23.9",
220
- "@babel/core": "^7.24.0",
221
- "@babel/preset-env": "^7.24.0",
222
- "@babel/preset-react": "^7.23.3",
223
- "@babel/preset-typescript": "^7.23.3",
224
- "@libsql/client": "^0.5.6",
217
+ "@automerge/automerge": "^2.1.13",
218
+ "@automerge/automerge-repo": "^1.1.4",
219
+ "@babel/cli": "^7.24.1",
220
+ "@babel/core": "^7.24.3",
221
+ "@babel/preset-env": "^7.24.3",
222
+ "@babel/preset-react": "^7.24.1",
223
+ "@babel/preset-typescript": "^7.24.1",
224
+ "@libsql/client": "^0.6.0",
225
225
  "@prettier/sync": "^0.5.1",
226
226
  "@rollup/plugin-image": "^3.0.3",
227
227
  "@rollup/plugin-replace": "^5.0.5",
@@ -233,14 +233,14 @@
233
233
  "@types/jest": "^29.5.12",
234
234
  "@types/jest-environment-puppeteer": "^5.0.6",
235
235
  "@types/less": "^3.0.6",
236
- "@types/node": "^20.11.28",
236
+ "@types/node": "^20.11.30",
237
237
  "@types/puppeteer": "^5.4.7",
238
- "@types/react": "^18.2.66",
238
+ "@types/react": "^18.2.73",
239
239
  "@types/react-dom": "^18.2.22",
240
240
  "@types/react-test-renderer": "^18.0.7",
241
241
  "@types/tmp": "^0.2.6",
242
- "@typescript-eslint/eslint-plugin": "^7.2.0",
243
- "@typescript-eslint/parser": "^7.2.0",
242
+ "@typescript-eslint/eslint-plugin": "^7.4.0",
243
+ "@typescript-eslint/parser": "^7.4.0",
244
244
  "@vlcn.io/crsqlite-wasm": "^0.16.0",
245
245
  "asciichart": "^1.5.25",
246
246
  "babel-eslint": "^10.1.0",
@@ -250,13 +250,13 @@
250
250
  "babel-preset-minify": "^0.5.2",
251
251
  "buffer-replace": "^1.0.0",
252
252
  "country-flag-emoji-json": "^2.0.0",
253
- "cspell": "^8.6.0",
253
+ "cspell": "^8.6.1",
254
254
  "electric-sql": "^0.9.6",
255
255
  "esbuild": "^0.20.2",
256
256
  "eslint": "^8.57.0",
257
257
  "eslint-config-prettier": "^9.1.0",
258
258
  "eslint-plugin-jest": "^27.9.0",
259
- "eslint-plugin-jsdoc": "^48.2.1",
259
+ "eslint-plugin-jsdoc": "^48.2.2",
260
260
  "eslint-plugin-react": "7.34.1",
261
261
  "eslint-plugin-react-hooks": "^4.6.0",
262
262
  "expo-sqlite": "^13.2.1",
@@ -270,14 +270,14 @@
270
270
  "jest-fetch-mock": "^3.0.3",
271
271
  "jest-puppeteer": "^10.0.1",
272
272
  "less": "^4.2.0",
273
- "partykit": "^0.0.99",
273
+ "partykit": "^0.0.101",
274
274
  "partysocket": "^1.0.1",
275
275
  "prettier": "^3.2.5",
276
- "puppeteer": "22.5.0",
276
+ "puppeteer": "22.6.1",
277
277
  "react": "^18.2.0",
278
278
  "react-dom": "^18.2.0",
279
279
  "react-test-renderer": "^18.2.0",
280
- "rollup": "^4.13.0",
280
+ "rollup": "^4.13.2",
281
281
  "rollup-plugin-esbuild": "^6.1.1",
282
282
  "rollup-plugin-gzip": "^3.1.2",
283
283
  "rollup-plugin-preserve-shebang": "^1.0.1",
@@ -287,18 +287,18 @@
287
287
  "tinydocs": "^0.1.36",
288
288
  "tmp": "^0.2.3",
289
289
  "ts-unused-exports": "^10.0.1",
290
- "typescript": "5.4.2",
290
+ "typescript": "5.4.3",
291
291
  "wa-sqlite": "github:rhashimoto/wa-sqlite",
292
292
  "yjs": "^13.6.14"
293
293
  },
294
294
  "peerDependencies": {
295
- "@automerge/automerge-repo": "^1.1.2",
295
+ "@automerge/automerge-repo": "^1.1.4",
296
296
  "@libsql/client": "^0.5.6",
297
297
  "@sqlite.org/sqlite-wasm": "^3.45.2-build1",
298
298
  "@vlcn.io/crsqlite-wasm": "^0.16.0",
299
299
  "electric-sql": "^0.9.6",
300
300
  "expo-sqlite": "^13.2.1",
301
- "partykit": "^0.0.99",
301
+ "partykit": "^0.0.101",
302
302
  "partysocket": "^1.0.1",
303
303
  "prettier": "^3.2.5",
304
304
  "react": "^18.2.0",
package/readme.md CHANGED
@@ -1,4 +1,4 @@
1
- <section id="hero"><h2 id="the-reactive-data-store-for-local-first-apps">The <em>reactive</em> data store for <span>local-first apps</span>.</h2><p id="copy">Build blisteringly fast web apps that work both online and offline. Manage your state locally, synchronize it to the cloud when you need to, or even make it collaborative. But, most importantly... have fun building stuff again!</p></section><p><a href="https://tinybase.org/guides/releases/#v4-7"><em>NEW!</em> v4.7 release</a> <span id="one-with">&quot;The One With Turso&quot;</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><ul><li>Manage <a href="#start-with-a-simple-key-value-store">key-value data</a>, <a href="#level-up-to-use-tabular-data">tabular data</a> - or both - with optional <a href="#apply-schemas-to-tables-values">schematization</a> to model your app&#x27;s data structures.</li><li><a href="#register-granular-listeners">Flexibly reactive</a> to reconciled updates, so you only spend rendering cycles on things that change.</li><li><a href="#build-complex-queries-with-tinyql">Powerful query engine</a> to select, join, filter, group, sort and paginate data - reactively - and without SQL.</li><li>Built-in <a href="#create-indexes-for-fast-lookups">indexing</a>, <a href="#define-metrics-and-aggregations">metric aggregation</a>, <a href="#model-table-relationships">tabular relationships</a> - and even an <a href="#set-checkpoints-for-an-undo-stack">undo stack</a> for your app state.</li><li>Create <a href="#type-definitions-orm-like-apis">type definitions &amp; ORM-like APIs</a>, from schema or inference. <a href="#an-inspector-for-your-data">Inspect your data</a> (<em>new!</em>) directly in the browser.</li><li>Easily <a href="#persist-to-storage-sqlite-crdts">sync your data</a> to browser <a href="https://tinybase.org/api/persister-browser">storage</a>, <a href="https://tinybase.org/api/persister-indexed-db/">IndexedDB</a>, <a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence/">SQLite</a>, <a href="https://tinybase.org/guides/schemas-and-persistence/synchronizing-data/">CRDTs</a>; and (<em>new!</em>) <a href="https://tinybase.org/api/persister-partykit-client/">PartyKit</a> and <a href="https://electric-sql.com/">ElectricSQL</a>.</li><li>Optional <a href="#call-hooks-to-bind-to-data">bindings to React</a> and (<em>new!</em>) <a href="#pre-built-reactive-components">pre-built components</a> that let you easily build fully reactive user interfaces.</li><li>Tiny by name, tiny by nature: <a href="#did-we-say-tiny">5.0kB - 9.4kB</a>, no dependencies. <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>!</li></ul><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 width="48" src="https://tinybase.org/react.svg"> React</a></div><div><a href="https://tinybase.org/api/persister-partykit-client"><img width="48" src="https://tinybase.org/partykit.svg"> PartyKit</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/expo.svg">Expo SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/electric.svg">ElectricSQL</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/sqlite.svg"> SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/turso.svg">Turso</a></div><div><a href="https://tinybase.org/api/persister-indexed-db/functions/creation/createindexeddbpersister"><img width="48" src="https://tinybase.org/indexeddb.svg"> IndexedDB</a></div><div><a href="https://tinybase.org/api/persister-yjs/functions/creation/createyjspersister"><img width="48" src="https://tinybase.org/yjs.svg"> YJS</a></div><div><a href="https://tinybase.org/api/persister-cr-sqlite-wasm"><img width="48" src="https://tinybase.org/crsqlite.png"> CR-SQLite</a></div><div><a href="https://tinybase.org/api/persister-automerge"><img width="48" src="https://tinybase.org/automerge.svg"> Automerge</a></div></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&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=GitHub&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&amp;logo=discord&amp;logoColor=%23fff&amp;label=Discord&amp;labelColor=%233131e8&amp;color=%23333"> </a><a href="https://twitter.com/tinybasejs" target="_blank"><img src="https://img.shields.io/twitter/follow/tinybasejs?style=for-the-badge&amp;logo=x&amp;logoColor=%23fff&amp;label=Twitter&amp;labelColor=%23333&amp;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&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Ideas&amp;labelColor=%23d81b60&amp;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&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Issues&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&amp;logo=jest&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/4.7.1" target="_blank"><img src="https://img.shields.io/npm/v/tinybase?style=for-the-badge&amp;logo=npm&amp;logoColor=%23fff&amp;labelColor=%23bd0005&amp;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
+ <section id="hero"><h2 id="the-reactive-data-store-for-local-first-apps">The <em>reactive</em> data store for <span>local-first apps</span>.</h2><p id="copy">Build blisteringly fast web apps that work both online and offline. Manage your state locally, synchronize it to the cloud when you need to, or even make it collaborative. But, most importantly... have fun building stuff again!</p></section><p><a href="https://tinybase.org/guides/releases/#v4-7"><em>NEW!</em> v4.7 release</a> <span id="one-with">&quot;The One With Turso&quot;</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><ul><li>Manage <a href="#start-with-a-simple-key-value-store">key-value data</a>, <a href="#level-up-to-use-tabular-data">tabular data</a> - or both - with optional <a href="#apply-schemas-to-tables-values">schematization</a> to model your app&#x27;s data structures.</li><li><a href="#register-granular-listeners">Flexibly reactive</a> to reconciled updates, so you only spend rendering cycles on things that change.</li><li><a href="#build-complex-queries-with-tinyql">Powerful query engine</a> to select, join, filter, group, sort and paginate data - reactively - and without SQL.</li><li>Built-in <a href="#create-indexes-for-fast-lookups">indexing</a>, <a href="#define-metrics-and-aggregations">metric aggregation</a>, <a href="#model-table-relationships">tabular relationships</a> - and even an <a href="#set-checkpoints-for-an-undo-stack">undo stack</a> for your app state.</li><li>Create <a href="#type-definitions-orm-like-apis">type definitions &amp; ORM-like APIs</a>, from schema or inference. <a href="#an-inspector-for-your-data">Inspect your data</a> (<em>new!</em>) directly in the browser.</li><li>Easily <a href="#persist-to-storage-sqlite-crdts">sync your data</a> to browser <a href="https://tinybase.org/api/persister-browser">storage</a>, <a href="https://tinybase.org/api/persister-indexed-db/">IndexedDB</a>, <a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence/">SQLite</a>, <a href="https://tinybase.org/guides/schemas-and-persistence/synchronizing-data/">CRDTs</a>; and (<em>new!</em>) <a href="https://tinybase.org/api/persister-partykit-client/">PartyKit</a> and <a href="https://electric-sql.com/">ElectricSQL</a>.</li><li>Optional <a href="#call-hooks-to-bind-to-data">bindings to React</a> and (<em>new!</em>) <a href="#pre-built-reactive-components">pre-built components</a> that let you easily build fully reactive user interfaces.</li><li>Tiny by name, tiny by nature: <a href="#did-we-say-tiny">5.0kB - 9.4kB</a>, no dependencies. <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>!</li></ul><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 width="48" src="https://tinybase.org/react.svg"> React</a></div><div><a href="https://tinybase.org/api/persister-partykit-client"><img width="48" src="https://tinybase.org/partykit.svg"> PartyKit</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/expo.svg">Expo SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/electric.svg">ElectricSQL</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/sqlite.svg"> SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/turso.svg">Turso</a></div><div><a href="https://tinybase.org/api/persister-indexed-db/functions/creation/createindexeddbpersister"><img width="48" src="https://tinybase.org/indexeddb.svg"> IndexedDB</a></div><div><a href="https://tinybase.org/api/persister-yjs/functions/creation/createyjspersister"><img width="48" src="https://tinybase.org/yjs.svg"> YJS</a></div><div><a href="https://tinybase.org/api/persister-cr-sqlite-wasm"><img width="48" src="https://tinybase.org/crsqlite.png"> CR-SQLite</a></div><div><a href="https://tinybase.org/api/persister-automerge"><img width="48" src="https://tinybase.org/automerge.svg"> Automerge</a></div></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&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=GitHub&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&amp;logo=discord&amp;logoColor=%23fff&amp;label=Discord&amp;labelColor=%233131e8&amp;color=%23333"> </a><a href="https://twitter.com/tinybasejs" target="_blank"><img src="https://img.shields.io/twitter/follow/tinybasejs?style=for-the-badge&amp;logo=x&amp;logoColor=%23fff&amp;label=Twitter&amp;labelColor=%23333&amp;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&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Ideas&amp;labelColor=%23d81b60&amp;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&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Issues&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&amp;logo=jest&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/4.7.3" target="_blank"><img src="https://img.shields.io/npm/v/tinybase?style=for-the-badge&amp;logo=npm&amp;logoColor=%23fff&amp;labelColor=%23bd0005&amp;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
  const store = createStore()