Skip to content

Releases: tinyplex/tinybase

v4.5.0

16 Nov 21:58

Choose a tag to compare

This release includes the new persister-expo-sqlite-next module, which provides a Persister for the modern version of Expo's SQLite library, designated 'next' as of November 2023. This API should be used if you are installing the expo-sqlite/next module.

Note that TinyBase support for the legacy version of Expo-SQLite (expo-sqlite) is still available in the persister-expo-sqlite module.

Thank you to Expo for providing this functionality!

image

v4.4.2

15 Nov 04:03

Choose a tag to compare

This release adds a new hook to the optional ui-react module called useProvideStore.

This lets you add a Store object by Id to a Provider component, but imperatively from a component within it. For example:

const App = () => (
  <Provider>
    <RegisterStore />
    <ConsumeStore />
  </Provider>
);
const RegisterStore = () => {
  const store = useCreateStore(() =>
    createStore().setCell('pets', 'fido', 'color', 'brown'),
  );
  useProvideStore('petStore', store);
  return null;
};
const ConsumeStore = () => (
  <span>{JSON.stringify(useStore('petStore')?.getTableIds())}</span>
);

v4.4.1

12 Nov 05:18

Choose a tag to compare

This release adds two functions to the PartyKit server component: hasStoreInStorage and loadStoreFromStorage.

These are intended for specialist applications that require the ability to inspect or load a Store from a server's storage outside of the normal context of a TinyBasePartyKitServer.

It also changes the PartyKit broadcast behavior to not echo changes back to the client that originated them.

v4.4.0

09 Nov 16:32

Choose a tag to compare

This relatively straightforward release adds a selection of new listeners to the Store object, and their respective hooks. These are for listening to changes in the 'existence' of entities rather than to their value. For example, the addHasTableListener method will let you listen for the presence (or not) of a specific table.

The full set of new existence-listening methods and hooks to work with this is as follows:

Existence of: Add Listener Hook Add Listener Hook
Tables addHasTablesListener useHasTables useHasTablesListener
A Table addHasTableListener useHasTable useHasTableListener
A Table Cell addHasTableCellListener useHasTableCell useHasTableCellListener
A Row addHasRowListener useHasRow useHasRowListener
A Cell addHasCellListener useHasCell useHasCellListener
Values addHasValuesListener useHasValues useHasValuesListener
A Value addHasValueListener useHasValue useHasValueListener

These methods may become particularly important in future versions of TinyBase that support null as valid Cell and Value content.

v4.3.24

08 Nov 14:19

Choose a tag to compare

This release uses useLayoutEffect for React hook bindings to help fix #106. Please report any rendering-related issues.

v4.3.23

30 Oct 20:15

Choose a tag to compare

This release improves the detection of valid objects to include those created with a null prototype (which appear in rare cases such as from some SQLite providers or recent versions of fakeIndexedDB). Please report any issues this creates.

v4.3.22

25 Oct 00:01

Choose a tag to compare

This release makes two small optimizations to TinyBase's React hooks. It reduces the internal state stored within each hook implementation, and it closes a small race condition gap that occurred between hook execution (to get a value) and useEffect execution (to set a listener on it). Please report any React-related issues seen as a result!

The release also improves VS Code auto-import heuristics by listing the default types higher in package.json.

v4.3.21

22 Oct 14:59

Choose a tag to compare

Adds a top level types field and smooths TS resolution by removing main entry extension.

v4.3.20

22 Oct 14:21

Choose a tag to compare

This release simply adds an explicit main field to package.json. Hopefully this fixes #100 so that the React Native bundler can export for web.

v4.3.19

21 Oct 18:22

Choose a tag to compare

This release provides an optional destroy argument to the useCreatePersister hook in the ui-react module.

This will be called after an old Persister is destroyed due to a change in the createDeps dependencies that causes a new one to be created. Use this to clean up any underlying storage objects that you set up during the then function, for example.