Releases: tinyplex/tinybase
v4.5.0
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!
v4.4.2
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
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
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:
These methods may become particularly important in future versions of TinyBase that support null as valid Cell and Value content.
v4.3.24
v4.3.23
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
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
Adds a top level types field and smooths TS resolution by removing main entry extension.
v4.3.20
v4.3.19
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.
