Releases: tinyplex/tinybase
v3.0.2
Includes CJS modules in the NPM distribution, which can be used like so:
import {createStore} from 'tinybase/cjs';An es6 variant is also provided. Individual modules can be imported by name if required.
Huge thanks to @uwemneku and @WonderPanda for proposing and verifying in #48!
v3.0.1
Fixes missing type in code-generated API
v3.0.0
This major new release adds key/value store functionality to TinyBase. Alongside existing tabular data, it allows you to get, set, and listen to, individual Value items, each with a unique Id.
const store = createStore().setValues({employees: 3, open: true});
console.log(store.getValues());
// -> {employees: 3, open: true}
const listenerId = store.addValueListener(
null,
(store, valueId, newValue, oldValue) => {
console.log(`Value '${valueId}' changed from ${oldValue} to ${newValue}`);
},
);
store.setValue('employees', 4);
// -> "Value 'employees' changed from 3 to 4"
store.delListener(listenerId).delValues();Guides and documentation have been fully updated, and certain demos - such as the Todo App v2 (indexes) demo, and the Countries demo - have been updated to use this new functionality.
If you use the optional ui-react module with TinyBase, v3.0 now uses and expects React v18.
In terms of core API changes in v3.0, there are some minor breaking changes, but the majority of the alterations are additions. See the release notes for full details.
And please enjoy!
v3.0.0-beta.1
For those who don't need tables, but just a reactive flat map, this experimental release adds a new keyed value API to the Store interface: setValue, getValue, addValueListener, etc.
It's not fully documented in the guides and demos but the API documentation and full test coverage is complete.
v3.0.0-beta.0
This upgrades TinyBase to use React v18 for development and example demos.
v2.2.6
Upgrades esbuild devDependency with required jest array type support
v2.2.5
v2.2.4
v2.2.3
https://tinybase.org/guides/releases/#v2-2
This release includes a new tools module. These tools are not intended for production use, but are instead to be used as part of your engineering workflow to perform tasks like generating APIs from schemas, or schemas from data. For example:
const store = createStore().setTable('pets', {
fido: {species: 'dog'},
felix: {species: 'cat'},
cujo: {species: 'dog'},
});
const tools = createTools(store);
const [dTs, ts] = tools.getStoreApi('shop');
// -- shop.d.ts --
/* Represents the 'pets' Table. */
export type PetsTable = {[rowId: Id]: PetsRow};
/* Represents a Row when getting the content of the 'pets' Table. */
export type PetsRow = {species: string};
//...
// -- shop.ts --
export const createShop: typeof createShopDecl = () => {
//...
};This release includes a new tinybase CLI tool which allows you to generate Typescript definition and implementation files direct from a schema file:
npx tinybase getStoreApi schema.json shop api
Definition: [...]/api/shop.d.ts
Implementation: [...]/api/shop.tsFinally, the tools module also provides ways to track the overall size and structure of a Store for use while debugging.
v2.1.1
Updates devDependencies and small pool function bug.