Releases: dojoengine/dojo.js
v1.0.0-alpha.1
Full Changelog: v1.0.0-alpha.1...v1.0.0-alpha.1
v1.0.0-alpha.0
Breaking Changes
Pre-release Features
This pre-release introduces some long-awaited features for testing. More features will be added in the lead-up to v1 release. We suggest you try these and provide feedback to be added into the main release.
TLDR:
getSyncEntities
now allows passing an array of clauses for specific state and fetching sync- New React hook
useQuerySync
allows easy fetching and syncing in React apps - Breaking change in the
execute
functions - Upgrade Starknet.js to latest version (previous versions were broken with latest Katana and Torii)
Torii Client Breaking Changes
Torii client must be created as follows. You no longer pass entities as the 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 empty array if you wish to fetch everything:
const sync = await getSyncEntities(
toriiClient,
contractComponents as any,
[]
);
If you pass in a query, it must match an array of EntityKeysClause
:
export type EntityKeysClause = { HashedKeys: string[] } | { Keys: KeysClause };
export interface KeysClause {
keys: (string | null)[];
models: string[];
pattern_matching: PatternMatching;
}
{
Keys: {
keys: [BigInt(account?.account.address).toString()],
models: ["Position", "Moves", "DirectionsAvailable"],
pattern_matching: "FixedLen",
},
}
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:
useQuerySync(toriiClient, contractComponents as any, [
{
Keys: {
keys: [BigInt(account?.account.address).toString()],
models: ["Position", "Moves", "DirectionsAvailable"],
pattern_matching: "FixedLen",
},
},
]);
Core Updates
Dojo v1 introduces the concept of namespaces. Read full release notes here.
With the introduction of namespaces, a new field has been added to the execute functions - this allows you to specify which namespace to call:
return await provider.execute(
account,
{
contractName: "actions",
entrypoint: "spawn",
calldata: [],
},
NAMESPACE
);
What's Changed
- feat: subscription clauses by @ponderingdemocritus in #235
Full Changelog: v0.7.10-alpha.0...v1.0.0-alpha.0
v0.7.10-alpha-0
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
v0.7.9
What's Changed
- feat: test cover state & provider by @ponderingdemocritus in #230
Full Changelog: v0.7.8...v0.7.9
v0.7.6
What's Changed
- fix: make bigints bigints in recs by @ponderingdemocritus in #226
Full Changelog: v0.7.5...v0.7.6
v0.7.5
What's Changed
- feat: Core bytearray by @rsodre in #222
- fix: bumps version and readme by @ponderingdemocritus in #223
Full Changelog: v0.7.4...v0.7.5
v0.7.4
What's Changed
- fix: Prefund check by @rsodre in #218
- fix: bump recs, deps by @ponderingdemocritus in #220
Full Changelog: v0.7.3...v0.7.4
v0.7.3
What's Changed
- fix: pnpm dep by @ponderingdemocritus in #215
- fix: torii sync by @ponderingdemocritus in #216
Full Changelog: v0.7.2...v0.7.3
v0.7.2
v0.7.1
What's Changed
- fix: bump-stater to 7 by @ponderingdemocritus in #212
- fix: constants for v7 by @ponderingdemocritus in #213
Full Changelog: v0.7.0...v0.7.1