tinybase 4.0.0-beta.5.3 → 4.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/types/persisters/persister-cr-sqlite-wasm.d.ts +2 -0
- package/lib/types/persisters/persister-sqlite-wasm.d.ts +2 -0
- package/lib/types/persisters/persister-sqlite3.d.ts +2 -0
- package/lib/types/with-schemas/persisters/persister-cr-sqlite-wasm.d.ts +2 -0
- package/lib/types/with-schemas/persisters/persister-sqlite-wasm.d.ts +2 -0
- package/lib/types/with-schemas/persisters/persister-sqlite3.d.ts +2 -0
- package/package.json +11 -11
- package/readme.md +3 -3
|
@@ -49,6 +49,8 @@ import {Store} from '../store';
|
|
|
49
49
|
* const persister = createCrSqliteWasmPersister(store, db, 'my_tinybase');
|
|
50
50
|
*
|
|
51
51
|
* await persister.save();
|
|
52
|
+
* // Store will be saved to the database.
|
|
53
|
+
*
|
|
52
54
|
* console.log(await db.execO('SELECT * FROM my_tinybase;'));
|
|
53
55
|
* // -> [{_id: '_', store: '[{"pets":{"fido":{"species":"dog"}}},{}]'}]
|
|
54
56
|
*
|
|
@@ -55,6 +55,8 @@ import {Store} from '../store';
|
|
|
55
55
|
* );
|
|
56
56
|
*
|
|
57
57
|
* await persister.save();
|
|
58
|
+
* // Store will be saved to the database.
|
|
59
|
+
*
|
|
58
60
|
* console.log(db.exec('SELECT * FROM my_tinybase;', {rowMode: 'object'}));
|
|
59
61
|
* // -> [{_id: '_', store: '[{"pets":{"fido":{"species":"dog"}}},{}]'}]
|
|
60
62
|
*
|
|
@@ -48,6 +48,8 @@ import {Store} from '../store';
|
|
|
48
48
|
* const persister = createSqlite3Persister(store, db, 'my_tinybase');
|
|
49
49
|
*
|
|
50
50
|
* await persister.save();
|
|
51
|
+
* // Store will be saved to the database.
|
|
52
|
+
*
|
|
51
53
|
* console.log(
|
|
52
54
|
* await new Promise((resolve) =>
|
|
53
55
|
* db.all('SELECT * FROM my_tinybase;', (_, rows) => resolve(rows)),
|
|
@@ -59,6 +59,8 @@ import {DB} from '@vlcn.io/crsqlite-wasm';
|
|
|
59
59
|
* const persister = createCrSqliteWasmPersister(store, db, 'my_tinybase');
|
|
60
60
|
*
|
|
61
61
|
* await persister.save();
|
|
62
|
+
* // Store will be saved to the database.
|
|
63
|
+
*
|
|
62
64
|
* console.log(await db.execO('SELECT * FROM my_tinybase;'));
|
|
63
65
|
* // -> [{_id: '_', store: '[{"pets":{"fido":{"species":"dog"}}},{}]'}]
|
|
64
66
|
*
|
|
@@ -66,6 +66,8 @@ import {OptionalSchemas, Store} from '../store';
|
|
|
66
66
|
* );
|
|
67
67
|
*
|
|
68
68
|
* await persister.save();
|
|
69
|
+
* // Store will be saved to the database.
|
|
70
|
+
*
|
|
69
71
|
* console.log(db.exec('SELECT * FROM my_tinybase;', {rowMode: 'object'}));
|
|
70
72
|
* // -> [{_id: '_', store: '[{"pets":{"fido":{"species":"dog"}}},{}]'}]
|
|
71
73
|
*
|
|
@@ -58,6 +58,8 @@ import {Database} from 'sqlite3';
|
|
|
58
58
|
* const persister = createSqlite3Persister(store, db, 'my_tinybase');
|
|
59
59
|
*
|
|
60
60
|
* await persister.save();
|
|
61
|
+
* // Store will be saved to the database.
|
|
62
|
+
*
|
|
61
63
|
* console.log(
|
|
62
64
|
* await new Promise((resolve) =>
|
|
63
65
|
* db.all('SELECT * FROM my_tinybase;', (_, rows) => resolve(rows)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinybase",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0-beta.0",
|
|
4
4
|
"author": "jamesgpearce",
|
|
5
5
|
"repository": "github:tinyplex/tinybase",
|
|
6
6
|
"license": "MIT",
|
|
@@ -218,21 +218,21 @@
|
|
|
218
218
|
"@babel/preset-typescript": "^7.22.5",
|
|
219
219
|
"@rollup/plugin-replace": "^5.0.2",
|
|
220
220
|
"@rollup/plugin-terser": "^0.4.3",
|
|
221
|
-
"@sqlite.org/sqlite-wasm": "^3.42.0-
|
|
221
|
+
"@sqlite.org/sqlite-wasm": "^3.42.0-build2",
|
|
222
222
|
"@types/asciichart": "^1.5.6",
|
|
223
223
|
"@types/expect-puppeteer": "^5.0.3",
|
|
224
224
|
"@types/http-server": "^0.12.1",
|
|
225
225
|
"@types/jest": "^29.5.2",
|
|
226
226
|
"@types/jest-environment-puppeteer": "^5.0.3",
|
|
227
227
|
"@types/less": "^3.0.3",
|
|
228
|
-
"@types/node": "^20.3.
|
|
228
|
+
"@types/node": "^20.3.2",
|
|
229
229
|
"@types/puppeteer": "^5.4.7",
|
|
230
230
|
"@types/react": "^18.2.14",
|
|
231
231
|
"@types/react-dom": "^18.2.6",
|
|
232
232
|
"@types/react-test-renderer": "^18.0.0",
|
|
233
233
|
"@types/tmp": "^0.2.3",
|
|
234
|
-
"@typescript-eslint/eslint-plugin": "^5.60.
|
|
235
|
-
"@typescript-eslint/parser": "^5.60.
|
|
234
|
+
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
|
235
|
+
"@typescript-eslint/parser": "^5.60.1",
|
|
236
236
|
"@vlcn.io/crsqlite-wasm": "^0.13.0",
|
|
237
237
|
"asciichart": "^1.5.25",
|
|
238
238
|
"automerge-repo": "^0.1.0",
|
|
@@ -243,11 +243,11 @@
|
|
|
243
243
|
"buffer-replace": "^1.0.0",
|
|
244
244
|
"country-flag-emoji-json": "^2.0.0",
|
|
245
245
|
"cspell": "^6.31.1",
|
|
246
|
-
"esbuild": "^0.18.
|
|
246
|
+
"esbuild": "^0.18.10",
|
|
247
247
|
"eslint": "^8.43.0",
|
|
248
248
|
"eslint-config-prettier": "^8.8.0",
|
|
249
249
|
"eslint-plugin-jest": "^27.2.2",
|
|
250
|
-
"eslint-plugin-jsdoc": "^46.
|
|
250
|
+
"eslint-plugin-jsdoc": "^46.4.2",
|
|
251
251
|
"eslint-plugin-react": "^7.32.2",
|
|
252
252
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
253
253
|
"fake-indexeddb": "^4.0.1",
|
|
@@ -260,11 +260,11 @@
|
|
|
260
260
|
"jest-puppeteer": "^9.0.0",
|
|
261
261
|
"less": "^4.1.3",
|
|
262
262
|
"prettier": "^2.8.8",
|
|
263
|
-
"puppeteer": "^20.7.
|
|
263
|
+
"puppeteer": "^20.7.4",
|
|
264
264
|
"react": "^18.2.0",
|
|
265
265
|
"react-dom": "^18.2.0",
|
|
266
266
|
"react-test-renderer": "^18.2.0",
|
|
267
|
-
"rollup": "^3.
|
|
267
|
+
"rollup": "^3.26.0",
|
|
268
268
|
"rollup-plugin-esbuild": "^5.0.0",
|
|
269
269
|
"rollup-plugin-gzip": "^3.1.0",
|
|
270
270
|
"rollup-plugin-preserve-shebang": "^1.0.1",
|
|
@@ -274,11 +274,11 @@
|
|
|
274
274
|
"tinydocs": "^0.1.27",
|
|
275
275
|
"tmp": "^0.2.1",
|
|
276
276
|
"ts-unused-exports": "^9.0.5",
|
|
277
|
-
"typescript": "5.1.
|
|
277
|
+
"typescript": "5.1.6",
|
|
278
278
|
"yjs": "^13.6.6"
|
|
279
279
|
},
|
|
280
280
|
"peerDependencies": {
|
|
281
|
-
"@sqlite.org/sqlite-wasm": "^3.42.0-
|
|
281
|
+
"@sqlite.org/sqlite-wasm": "^3.42.0-build2",
|
|
282
282
|
"@vlcn.io/crsqlite-wasm": "^0.13.0",
|
|
283
283
|
"automerge-repo": "^0.1.0",
|
|
284
284
|
"prettier": "^2.8.8",
|
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>Modern apps deserve better. Why trade reactive user experiences to be able to use relational data? Why sacrifice store features for bundle size? And why should the cloud do all the work <a href="https://localfirstweb.dev/" target="_blank">anyway</a>?</p><p><em>TinyBase is a smart new way to structure your local app data:</em></p><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-and-values">schematization</a> to model it.</li><li><a href="#register-listeners-at-any-granularity">Flexibly reactive</a> to reconciled updates, so you only spend 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.</li><li><a href="#create-indexes-for-fast-lookups">Indexing</a>, <a href="#define-metrics-and-aggregations">metrics</a>, <a href="#configure-relationships-between-tables">relationships</a> - and even an <a href="#use-checkpoints-for-an-easy-undo-stack">undo stack</a> for your app state.</li><li><a href="#type-definitions-orm-like-apis">Type definitions & ORM-like APIs</a> (<em>new!</em>), based on a schema or inference.</li><li>Easily <a href="#persist-to-storage-sqlite-or-crdts">sync your data</a> to storage, (<em>new!</em>) SQLite, or (<em>new!</em>) CRDTs.</li><li>Use idiomatic, optional, <a href="#call-hooks-to-bind-to-data">bindings to React</a> for a fully reactive UI.</li></ul><p><em>Tiny by name, tiny by nature</em>, TinyBase only costs <a href="#did-we-say-tiny">4.7kB - 8.9kB</a> when compressed, and has zero dependencies. And of course it's <a href="#well-tested-and-documented">well tested</a>, <a href="https://beta.tinybase.org/guides/the-basics/getting-started/">fully documented</a>, and <a href="https://github.com/tinyplex/tinybase">open source</a>. Other <a href="https://beta.tinybase.org/guides/faq/">FAQs</a>?</p></section><p><a id="new" href="https://beta.tinybase.org/guides/releases/#v4-0"><em>NEW!</em> v4.0
|
|
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>Modern apps deserve better. Why trade reactive user experiences to be able to use relational data? Why sacrifice store features for bundle size? And why should the cloud do all the work <a href="https://localfirstweb.dev/" target="_blank">anyway</a>?</p><p><em>TinyBase is a smart new way to structure your local app data:</em></p><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-and-values">schematization</a> to model it.</li><li><a href="#register-listeners-at-any-granularity">Flexibly reactive</a> to reconciled updates, so you only spend 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.</li><li><a href="#create-indexes-for-fast-lookups">Indexing</a>, <a href="#define-metrics-and-aggregations">metrics</a>, <a href="#configure-relationships-between-tables">relationships</a> - and even an <a href="#use-checkpoints-for-an-easy-undo-stack">undo stack</a> for your app state.</li><li><a href="#type-definitions-orm-like-apis">Type definitions & ORM-like APIs</a> (<em>new!</em>), based on a schema or inference.</li><li>Easily <a href="#persist-to-storage-sqlite-or-crdts">sync your data</a> to storage, (<em>new!</em>) SQLite, or (<em>new!</em>) CRDTs.</li><li>Use idiomatic, optional, <a href="#call-hooks-to-bind-to-data">bindings to React</a> for a fully reactive UI.</li></ul><p><em>Tiny by name, tiny by nature</em>, TinyBase only costs <a href="#did-we-say-tiny">4.7kB - 8.9kB</a> when compressed, and has zero dependencies. And of course it's <a href="#well-tested-and-documented">well tested</a>, <a href="https://beta.tinybase.org/guides/the-basics/getting-started/">fully documented</a>, and <a href="https://github.com/tinyplex/tinybase">open source</a>. Other <a href="https://beta.tinybase.org/guides/faq/">FAQs</a>?</p></section><p><a id="new" href="https://beta.tinybase.org/guides/releases/#v4-0"><em>NEW!</em> v4.0 release</a></p><hr><p><a class="start" href="https://beta.tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://beta.tinybase.org/demos/">Try the demos</a></p><p><a href="https://beta.tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section><h3 id="proud-to-be-sponsored-by">Proud to be sponsored by:</h3><p><a href="https://github.com/expo" target="_blank"><img title="expo" src="https://github.com/expo.png?size=48" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img title="WonderPanda" src="https://github.com/WonderPanda.png?size=48" width="48" height="48"></a><a href="https://github.com/arpitBhalla" target="_blank"><img title="arpitBhalla" src="https://github.com/arpitBhalla.png?size=48" width="48" height="48"></a></p></section><section><h3 id="excited-to-be-used-by">Excited to be used by:</h3><p><a href="https://github.com/Apocalypsor" target="_blank"><img title="Apocalypsor" src="https://github.com/Apocalypsor.png?size=48" width="48" height="48"></a><a href="https://github.com/brentvatne" target="_blank"><img title="brentvatne" src="https://github.com/brentvatne.png?size=48" width="48" height="48"></a><a href="https://github.com/circadian-risk" target="_blank"><img title="circadian-risk" src="https://github.com/circadian-risk.png?size=48" width="48" height="48"></a><a href="https://github.com/cubecull" target="_blank"><img title="cubecull" src="https://github.com/cubecull.png?size=48" width="48" height="48"></a><a href="https://github.com/erwinkn" target="_blank"><img title="erwinkn" src="https://github.com/erwinkn.png?size=48" width="48" height="48"></a><a href="https://github.com/flaming-codes" target="_blank"><img title="flaming-codes" src="https://github.com/flaming-codes.png?size=48" width="48" height="48"></a><a href="https://github.com/generates" target="_blank"><img title="generates" src="https://github.com/generates.png?size=48" width="48" height="48"></a><a href="https://github.com/Giulio987" target="_blank"><img title="Giulio987" src="https://github.com/Giulio987.png?size=48" width="48" height="48"></a><a href="https://github.com/jaysc" target="_blank"><img title="jaysc" src="https://github.com/jaysc.png?size=48" width="48" height="48"></a><a href="https://github.com/Kayoo-asso" target="_blank"><img title="Kayoo-asso" src="https://github.com/Kayoo-asso.png?size=48" width="48" height="48"></a><a href="https://github.com/kotofurumiya" target="_blank"><img title="kotofurumiya" src="https://github.com/kotofurumiya.png?size=48" width="48" height="48"></a><a href="https://github.com/miking-the-viking" target="_blank"><img title="miking-the-viking" src="https://github.com/miking-the-viking.png?size=48" width="48" height="48"></a><a href="https://github.com/shaneosullivan" target="_blank"><img title="shaneosullivan" src="https://github.com/shaneosullivan.png?size=48" width="48" height="48"></a><a href="https://github.com/SuperSonicHub1" target="_blank"><img title="SuperSonicHub1" src="https://github.com/SuperSonicHub1.png?size=48" width="48" height="48"></a><a href="https://github.com/uptonking" target="_blank"><img title="uptonking" src="https://github.com/uptonking.png?size=48" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img title="WonderPanda" src="https://github.com/WonderPanda.png?size=48" width="48" height="48"></a></p></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://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> requires just a simple call to the <a href="https://beta.tinybase.org/api/store/functions/creation/createstore/"><code>createStore</code></a> function. Once you have one, you can easily set <a href="https://beta.tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a> in it by unique <a href="https://beta.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://beta.tinybase.org/guides/the-basics/">The Basics</a> guide.</p></section>
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
4
|
const store = createStore()
|
|
@@ -9,7 +9,7 @@ console.log(store.getValues());
|
|
|
9
9
|
// -> {employees: 3, open: true}
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
<section><h2 id="level-up-to-use-tabular-data">Level up to use tabular data.</h2><p>For other types of data applications, a tabular data structure is more useful. TinyBase lets you set and get nested <a href="https://beta.tinybase.org/api/store/type-aliases/store/table/"><code>Table</code></a>, <a href="https://beta.tinybase.org/api/store/type-aliases/store/row/"><code>Row</code></a>, or <a href="https://beta.tinybase.org/api/store/type-aliases/store/cell/"><code>Cell</code></a> data, by unique <a href="https://beta.tinybase.org/api/common/type-aliases/identity/id/"><code>Id</code></a> and in the same <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> as the keyed values
|
|
12
|
+
<section><h2 id="level-up-to-use-tabular-data">Level up to use tabular data.</h2><p>For other types of data applications, a tabular data structure is more useful. TinyBase lets you set and get nested <a href="https://beta.tinybase.org/api/store/type-aliases/store/table/"><code>Table</code></a>, <a href="https://beta.tinybase.org/api/store/type-aliases/store/row/"><code>Row</code></a>, or <a href="https://beta.tinybase.org/api/store/type-aliases/store/cell/"><code>Cell</code></a> data, by unique <a href="https://beta.tinybase.org/api/common/type-aliases/identity/id/"><code>Id</code></a> - and in the same <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> as the keyed values!</p><p>Read more about setting and changing data in <a href="https://beta.tinybase.org/guides/the-basics/">The Basics</a> guide.</p></section>
|
|
13
13
|
|
|
14
14
|
```js
|
|
15
15
|
store
|
|
@@ -266,4 +266,4 @@ export const createShop: typeof createShopDecl = () => {
|
|
|
266
266
|
};
|
|
267
267
|
```
|
|
268
268
|
|
|
269
|
-
<section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://beta.tinybase.org/api/store/"><code>store</code></a> module alone, you'll only add a gzipped <em>4.7kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>8.9kB</em>.</p><p>The optional <a href="https://beta.tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just another <em>3.4kB</em>, the auxiliary <a href="https://beta.tinybase.org/api/tools/"><code>tools</code></a> module is <em>10.3kB</em>, and everything is super fast. Life's easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured and packaged in the <a href="https://beta.tinybase.org/guides/how-tinybase-is-built/architecture/">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>.js.gz</th><th>.js</th><th>debug.js</th><th>.d.ts</th></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/store/">store</a></th><td>4.7kB</td><td>11.1kB</td><td>47.8kB</td><td>212.9kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/metrics/">metrics</a></th><td>1.8kB</td><td>3.6kB</td><td>14.9kB</td><td>29.2kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/indexes/">indexes</a></th><td>1.9kB</td><td>3.7kB</td><td>16.7kB</td><td>33.8kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/relationships/">relationships</a></th><td>1.8kB</td><td>3.7kB</td><td>16.8kB</td><td>42.1kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/queries/">queries</a></th><td>2.7kB</td><td>5.5kB</td><td>25.0kB</td><td>112.7kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/checkpoints/">checkpoints</a></th><td>1.5kB</td><td>3.1kB</td><td>12.5kB</td><td>33.3kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/persisters/">persisters</a></th><td>0.6kB</td><td>1.2kB</td><td>3.9kB</td><td>41.9kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/common/">common</a></th><td>0.1kB</td><td>0.1kB</td><td>0.1kB</td><td>3.5kB</td></tr><tr><th class="right">tinybase (all)</th><td>8.9kB</td><td>21.9kB</td><td>95.0kB</td><td>0.3kB</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 to get up and running.</p><p>Read more about how TinyBase is tested in the Unit <a href="https://beta.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>1,817</td><td>1,817</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>1,959</td><td>1,959</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>777</td><td>777</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>669</td><td>669</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">3,093</td></tr><tr><th class="right">Assertions</th><td colspan="3">14,355</td></tr></tbody></table></div><hr><p><a class="start" href="https://beta.tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://beta.tinybase.org/demos/">Try the demos</a></p><p><a href="https://beta.tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section><h2 id="follow">Follow</h2><ul><li>News and updates on <a href="https://twitter.com/tinybasejs">Twitter</a>, <a href="https://discord.com/invite/mGz3mevwP8">Discord</a>, and <a href="https://facebook.com/tinybasejs">Facebook</a>.</li><li><a href="https://github.com/tinyplex/tinybase/discussions">Discussions</a> and <a href="https://github.com/tinyplex/tinybase/issues">issues</a> on <a href="https://github.com/tinyplex/tinybase">GitHub</a>.</li><li><a href="https://beta.tinybase.org/guides/releases/">Release notes</a> for each version.</li><li>Packages on <a href="https://www.npmjs.com/package/tinybase/v/4.
|
|
269
|
+
<section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://beta.tinybase.org/api/store/"><code>store</code></a> module alone, you'll only add a gzipped <em>4.7kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>8.9kB</em>.</p><p>The optional <a href="https://beta.tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just another <em>3.4kB</em>, the auxiliary <a href="https://beta.tinybase.org/api/tools/"><code>tools</code></a> module is <em>10.3kB</em>, and everything is super fast. Life's easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured and packaged in the <a href="https://beta.tinybase.org/guides/how-tinybase-is-built/architecture/">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>.js.gz</th><th>.js</th><th>debug.js</th><th>.d.ts</th></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/store/">store</a></th><td>4.7kB</td><td>11.1kB</td><td>47.8kB</td><td>212.9kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/metrics/">metrics</a></th><td>1.8kB</td><td>3.6kB</td><td>14.9kB</td><td>29.2kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/indexes/">indexes</a></th><td>1.9kB</td><td>3.7kB</td><td>16.7kB</td><td>33.8kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/relationships/">relationships</a></th><td>1.8kB</td><td>3.7kB</td><td>16.8kB</td><td>42.1kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/queries/">queries</a></th><td>2.7kB</td><td>5.5kB</td><td>25.0kB</td><td>112.7kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/checkpoints/">checkpoints</a></th><td>1.5kB</td><td>3.1kB</td><td>12.5kB</td><td>33.3kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/persisters/">persisters</a></th><td>0.6kB</td><td>1.2kB</td><td>3.9kB</td><td>41.9kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/common/">common</a></th><td>0.1kB</td><td>0.1kB</td><td>0.1kB</td><td>3.5kB</td></tr><tr><th class="right">tinybase (all)</th><td>8.9kB</td><td>21.9kB</td><td>95.0kB</td><td>0.3kB</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 to get up and running.</p><p>Read more about how TinyBase is tested in the Unit <a href="https://beta.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>1,817</td><td>1,817</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>1,959</td><td>1,959</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>777</td><td>777</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>669</td><td>669</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">3,093</td></tr><tr><th class="right">Assertions</th><td colspan="3">14,355</td></tr></tbody></table></div><hr><p><a class="start" href="https://beta.tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://beta.tinybase.org/demos/">Try the demos</a></p><p><a href="https://beta.tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section><h2 id="follow">Follow</h2><ul><li>News and updates on <a href="https://twitter.com/tinybasejs">Twitter</a>, <a href="https://discord.com/invite/mGz3mevwP8">Discord</a>, and <a href="https://facebook.com/tinybasejs">Facebook</a>.</li><li><a href="https://github.com/tinyplex/tinybase/discussions">Discussions</a> and <a href="https://github.com/tinyplex/tinybase/issues">issues</a> on <a href="https://github.com/tinyplex/tinybase">GitHub</a>.</li><li><a href="https://beta.tinybase.org/guides/releases/">Release notes</a> for each version.</li><li>Packages on <a href="https://www.npmjs.com/package/tinybase/v/4.1.0-beta.0">NPM</a>.</li></ul></section><section><h2 id="about">About</h2><p>Building TinyBase was originally an interesting exercise for <a rel="me" href="https://hachyderm.io/@jamesgpearce">me</a> in API design, minification, and documentation. It could not have been built without these great <a href="https://beta.tinybase.org/guides/how-tinybase-is-built/credits/#giants">projects</a> and <a href="https://beta.tinybase.org/guides/how-tinybase-is-built/credits/#and-friends">friends</a>, and I hope you enjoy using it!</p></section>
|