Skip to content

Releases: tinyplex/tinybase

v6.7.1

11 Oct 09:01

Choose a tag to compare

This release updates dependencies, and migrates the test suite from Jest to Vitest.

v6.7.0

04 Oct 01:43

Choose a tag to compare

This release includes support for the Origin Private File System (OPFS) in a browser. The createOpfsPersister function is the main entry point, and is available in the existing persister-browser module:

import {createStore} from 'tinybase';
import {createOpfsPersister} from 'tinybase/persisters/persister-browser';

const opfs = await navigator.storage.getDirectory();
const handle = await opfs.getFileHandle('tinybase.json', {create: true});

const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
const persister = createOpfsPersister(store, handle);

await persister.save();
// Store JSON will be saved to the OPFS file.

await persister.load();
// Store JSON will be loaded from the OPFS file.

await persister.destroy();

That's it! If you've used other TinyBase persisters, this API should be easy and familiar to use.

One caveat: observability in OPFS is not yet standardized in browsers. This means that the auto-load functionality of the persister may not work as expected, although a best effort is made using the experimental FileSystemObserverAPI, so please let us know how that works!

v6.6.1

23 Sep 02:35

Choose a tag to compare

This release updates dependencies.

v6.6.0

23 Sep 02:34

Choose a tag to compare

This release improves the Inspector tool, making it easier to debug, inspect, and mutate your TinyBase stores.

image

As well as a modernized UI, new in this release is the ability to create, duplicate, or delete tables, rows, values and cells directly within the Inspector. Press the 'pencil' icon to start editing items, and then hover over the new icons to see how to manipulate the data.

See the Inspecting Data guide for more information about how to use the Inspector in your application during development.

v6.5.2

13 Aug 20:04

Choose a tag to compare

This release updates dependencies.

v6.5.1

06 Aug 06:57

Choose a tag to compare

This release updates dependencies.

v6.5.0

26 Jul 20:12

Choose a tag to compare

This release includes the new persister-react-native-mmkv module, which allows you to persist data in a React Native MMKV store via the react-native-mmkv library.

Usage should be as simple as this:

import {MMKV} from 'react-native-mmkv';
import {createStore} from 'tinybase';
import {createReactNativeMmkvPersister} from 'tinybase/persisters/persister-react-native-mmkv';

const storage = new MMKV();
const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
const persister = createReactNativeMmkvPersister(store, storage);

await persister.save();
// Store will be saved to the MMKV store.

A huge shout out to Jérémy Barbet for this new persister!

v6.4.2

24 Jul 23:04

Choose a tag to compare

This release merges #263.

v6.4.1

24 Jul 22:19

Choose a tag to compare

This release updates dependencies.

v6.4.0

10 Jul 21:40

Choose a tag to compare

This release includes the new persister-react-native-sqlite module, which allows you to persist data in a React Native SQLite database via the react-native-sqlite-storage library.

Usage should be as simple as this:

import {enablePromise, openDatabase} from 'react-native-sqlite-storage';
import {createStore} from 'tinybase';
import {createReactNativeSqlitePersister} from 'tinybase/persisters/persister-react-native-sqlite';

enablePromise(true);
const db = await openDatabase({name: 'my.db', location: 'default'});
const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
const persister = createReactNativeSqlitePersister(store, db);

await persister.save();
// Store will be saved to the database.

Please let us know how you get on with this new Persister, and if you have any feedback or suggestions.