v0.7.10-alpha-0
ponderingdemocritus
released this
07 Jul 06:45
·
295 commits
to main
since this release
Breaking changes
This pre-release introduces some long-awaited features for testing. It allows you to sync specific parts of your world defined by Keys.
Torii Client breaking changes
Torii client must be created like the following. You now longer pass in entities as a first parameter.
const toriiClient = await torii.createClient({
rpcUrl: config.rpcUrl,
toriiUrl: config.toriiUrl,
relayUrl: "",
worldAddress: config.manifest.world.address || "",
});
Getting and syncing entities introduces a Key Clause as the final parameter. Pass an undefined
if you wish to fetch everything.
const sync = await getSyncEntities(
toriiClient,
contractComponents as any,
undefined // syncs all entities
);
If you do pass in a query it has to match a EntitiesKeyClause
.
export type EntityKeysClause = { HashedKeys: string[] } | { Keys: KeysClause };
export interface KeysClause {
keys: (string | null)[];
pattern_matching: PatternMatching;
models: string[];
}
React updates
There is a new react hook called useQuerySync
which you can use to subscribe and sync specific parts of your app. This is very useful for large apps that wish to subscribe to only specific parts.
What's Changed
- fix: docs and example by @ponderingdemocritus in #231
- fix: locked snjs by @ponderingdemocritus in #234
- fix: added SRC acronym to create-components by @rsodre in #233
Full Changelog: v0.7.9...v0.7.10-alpha.0