Skip to content

Commit

Permalink
Merge pull request dojoengine#70 from dojoengine/0.4.0
Browse files Browse the repository at this point in the history
0.4.0
  • Loading branch information
ponderingdemocritus authored Dec 3, 2023
2 parents 96e7881 + f0d2d09 commit a24ce89
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 32 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun link
- name: Install dependencies
run: bun install
- name: Run Prettier
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/dojo-starter
7 changes: 3 additions & 4 deletions examples/react-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ function App() {
};

useEffect(() => {
// Clear message after 3 seconds
if (clipboardStatus.message) {
const timer = setTimeout(() => {
setClipboardStatus({ message: "", isError: false });
Expand Down Expand Up @@ -124,7 +123,7 @@ function App() {
</div>

<div className="card">
<div className="movement-buttons">
<div>
<button
onClick={() =>
position && position.vec.y > 0
Expand All @@ -135,7 +134,7 @@ function App() {
Move Up
</button>
</div>
<div className="movement-buttons">
<div>
<button
onClick={() =>
position && position.vec.x > 0
Expand All @@ -149,7 +148,7 @@ function App() {
Move Right
</button>
</div>
<div className="movement-buttons">
<div>
<button onClick={() => move(account, Direction.Down)}>
Move Down
</button>
Expand Down
1 change: 0 additions & 1 deletion examples/react-app/src/dojo/createSystemCalls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export function createSystemCalls(
player: BigInt(entityId),
vec: updatePositionWithDirection(
direction,
// currently recs does not support nested values so we use any here
getComponentValue(Position, entityId) as any
).vec,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dojoengine/core",
"version": "0.1.55",
"version": "0.1.56",
"description": "Dojo engine core providers and types",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-burner/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dojoengine/create-burner",
"version": "0.1.55",
"version": "0.1.56",
"description": "Useful hooks and functions to create a Starknet burner wallet",
"source": "src/index.ts",
"main": "dist/index.js",
Expand Down
Empty file modified packages/create-dojo/bin/index.d.ts
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion packages/create-dojo/bin/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/create-dojo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dojoengine/create-dojo",
"version": "0.1.55",
"version": "0.1.56",
"description": "Scaffold Dojo project from examples",
"module": "index.ts",
"main": "./bin/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dojoengine/react",
"version": "0.1.55",
"version": "0.1.56",
"description": "Useful React hooks for Starknet",
"source": "src/index.ts",
"main": "dist/index.js",
Expand Down
19 changes: 2 additions & 17 deletions packages/react/src/useSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function useSync<S extends Schema>(
[component.metadata?.name]
);

const keys_to_strings = useMemo(
const keysToStrings = useMemo(
() => keys.map((key) => key.toString()),
[keys]
);
Expand All @@ -44,7 +44,7 @@ export function useSync<S extends Schema>(
component.schema,
await client.getModelValue(
componentName as string,
keys_to_strings
keysToStrings
)
) as ComponentValue
);
Expand All @@ -60,19 +60,4 @@ export function useSync<S extends Schema>(
isMounted = false;
};
}, [client]);

useEffect(() => {
const entity = {
model: componentName as string,
keys: keys_to_strings,
};

client.addEntitiesToSync([entity]);

return () => {
client.removeEntitiesToSync([entity]).catch((error) => {
console.error("Failed to remove entities on cleanup", error);
});
};
}, [client]);
}
4 changes: 2 additions & 2 deletions packages/torii-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dojoengine/torii-client",
"version": "0.1.55",
"version": "0.1.56",
"description": "",
"main": "dist/index.js",
"type": "module",
Expand All @@ -17,7 +17,7 @@
"author": "",
"license": "MIT",
"dependencies": {
"@dojoengine/torii-wasm": "^0.1.42",
"@dojoengine/torii-wasm": "../torii-wasm",
"starknet": "5.19.5",
"typescript": "^5.0.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/torii-wasm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dojoengine/torii-wasm",
"version": "0.1.55",
"version": "0.1.56",
"description": "",
"main": "./pkg/torii_client_wasm.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dojoengine/utils",
"version": "0.1.55",
"version": "0.1.56",
"description": "Helpful Dojo Utils",
"type": "module",
"scripts": {
Expand Down

0 comments on commit a24ce89

Please sign in to comment.