Releases: tinyplex/tinybase
v4.5.10
This release updates a few peer dependencies and fixes some docs issues.
v4.5.9
This release updates PartyKit runtime dependencies.
v4.5.8
This release updates PartyKit runtime dependencies.
v4.5.7
This release changes the can* sanitization methods on the TinyBasePartyKitServer class to be asynchronous. This allows asynchronous permission checks if you are using these methods to prohibit certain writes to server data.
This is not a breaking change at runtime, but you may wish to update your declarations accordingly to remove TypeScript warnings.
v4.5.6
v4.5.5
This release enhances the data-setting hooks so that the Ids of data being changed can be evaluated from a function, rather than pre-configured.
For example, if you wanted a callback to set the content of a Row, previously you would have to explicitly provide the Id ('felix') when creating the callback:
const setPet = useSetRowCallback('pets', 'felix', () => ({species: 'cat'}));But now you can get the Row Id when the callback is invoked, perhaps getting its value from the event:
const setPet = useSetRowCallback(
'pets',
(event) => String(event.currentTarget.dataset.petName),
() => ({species: 'cat'}),
);This would allow you to have just one callback, but which can be invoked by events from multiple HTML elements, each with a data-petName attribute.
This functionality is also useful if you want to create unique Row Ids programmatically:
const addShape = useSetRowCallback(
'shapes',
() => nanoid(10),
() => ({x: 100, y: 100, w: 80, h: 50}),
);The following hooks are enhanced with the GetId type to support this behavior: useSetTableCallback, useSetRowCallback, useAddRowCallback, useSetPartialRowCallback, useSetCellCallback, and useSetValueCallback.
v4.5.4
This release updates dependencies, including a long-awaited Puppeteer upgrade & fix.
v4.5.3
This release adds the clearForward method to the Checkpoints interface so that you can prevent users from redoing actions that have been undone. (See #105.)
v4.5.2
This release updates a few peer dependencies & TypeScript test fixtures.
v4.5.1
This release includes a new PartyKit server function called broadcastTransactionChanges. This is intended for specialist applications that require the ability to update clients of a TinyBasePartyKitServer in their own custom ways.