Skip to content

Releases: tinyplex/tinybase

v5.1.4

12 Aug 16:43

Choose a tag to compare

Updates peer dependencies and fixes #170.

v5.1.3

09 Aug 04:05

Choose a tag to compare

Updates peer dependencies

v5.1.2

01 Aug 16:08

Choose a tag to compare

Updates peer dependencies

v5.1.1

25 Jul 21:30

Choose a tag to compare

Updates peer dependencies, and lets you return a callback in the createPersisterForPath argument of the createWsServer function so that you can manipulate data on the server just after clients connect.

v5.1.0

19 Jul 22:31

Choose a tag to compare

This release lets you persist data on a server using the createWsServer function. This makes it possible for all clients to disconnect from a path, but, when they reconnect, for the data to still be present for them to sync with.

This is done by passing in a second argument to the createWsServer function that creates a Persister instance (for which also need to create or provide a MergeableStore) for a given path:

import {WebSocketServer} from 'ws';
import {createFilePersister} from 'tinybase/persisters/persister-file';
import {createMergeableStore} from 'tinybase';
import {createWsServer} from 'tinybase/synchronizers/synchronizer-ws-server';

const persistingServer = createWsServer(
  new WebSocketServer({port: 8051}),
  (pathId) => createFilePersister(createMergeableStore(), pathId + '.json'),
);

This is a very crude (and not production-safe!) example, but demonstrates a server that will create a file, based on any path that clients connect to, and persist data to it. See the createWsServer function documentation for more details.

This implementation is still experimental so please kick the tires!

There is one small breaking change in this release: the functions for creating Synchronizer objects can now take optional onSend and onReceive callbacks that will fire whenever messages pass through the Synchronizer. See, for example, the createWsSynchronizer function. These are suitable for debugging synchronization issues in a development environment.

v5.0.5

17 Jul 23:13

Choose a tag to compare

Addresses #161 and updates dependencies.

v5.1.0-beta.1

16 Jul 19:33

Choose a tag to compare

v5.1.0-beta.1 Pre-release
Pre-release

This release lets you persist data on a server using the createWsServer function. This makes it possible for all clients to disconnect from a path, but, when they reconnect, for the data to still be present for them to sync with.

This is done by passing in a second argument to the createWsServer function that creates a Persister instance (for which also need to create or provide a MergeableStore) for a given path:

import {WebSocketServer} from 'ws';
import {createFilePersister} from 'tinybase/persisters/persister-file';
import {createMergeableStore} from 'tinybase';
import {createWsServer} from 'tinybase/synchronizers/synchronizer-ws-server';

const persistingServer = createWsServer(
  new WebSocketServer({port: 8051}),
  (pathId) => createFilePersister(createMergeableStore(), pathId + '.json'),
);

This is a very crude (and not production-safe!) example, but demonstrates a server that will create a file, based on any path that clients connect to, and persist data to it. See the createWsServer function documentation for more details.

This implementation is still experimental so please kick the tires!

v5.0.4

16 Jul 19:25

Choose a tag to compare

This corrects an error where not all peer dependencies were optional and so expo was often being installed.

v5.0.3

08 Jul 05:31

Choose a tag to compare

This includes a final tiny breaking change for v5 (before the working week starts!)

In the WsServer API, the PathIdsListener and ClientIdsListener types are now given the changing path Id or client Id directly, rather than needing to call the clumsy getIdChanges callback.

v5.0.2

07 Jul 23:41

Choose a tag to compare

This release includes a few minor improvements to the ui-react module hooks, including:

  • ensuring the callbacks are stable references when GetId-typed functions are used
  • allowing the useDel* hooks to use GetId-typed functions in order to delete specific tables, rows, cells, or values based on the event parameter

Thanks to @cpojer for identifying these improvements.