Closed ponderingdemocritus closed 5 days ago
The pull request introduces updates to the example-vite-react-sdk
, transitioning to workspace dependencies in package.json
and adding new libraries such as @types/uuid
, immer
, and zustand
. The state management in App.tsx
is refactored to utilize a custom hook, useDojoStore
, which centralizes entity management and introduces an optimisticUpdate
function. Additionally, new types and interfaces related to burner accounts are defined in packages/sdk/src/types.ts
, enhancing the SDK's functionality.
Files | Change Summary |
---|---|
examples/example-vite-react-sdk/package.json |
Updated dependencies to workspace references, added @types/uuid , uuid , immer , and zustand . |
examples/example-vite-react-sdk/src/App.tsx |
Refactored state management to use useDojoStore , introduced optimisticUpdate function, adjusted entity rendering. |
packages/sdk/package.json |
Added dependencies @rollup/plugin-commonjs , @dojoengine/create-burner , and immer . |
packages/sdk/src/types.ts |
Introduced new types and interfaces for managing burner accounts and predeployed accounts. |
packages/sdk/src/__example__/index.ts |
Added GalaxyModel interface and updated MockSchemaType to use it. |
packages/sdk/src/__tests__/state.test.ts |
Added unit tests for createDojoStore function covering various functionalities. |
packages/sdk/src/__tests__/zustand.perf.test.ts |
Introduced performance tests for Zustand store operations. |
packages/sdk/src/state/zustand.ts |
Implemented Zustand store with Immer middleware for state management, defining GameState interface. |
setEntities
function, which is also referenced in the main PR's App.tsx
file where state management logic has been updated.src/App.tsx
involving database connection handling align with the refactoring of state management in the main PR's App.tsx
.🐇 In the code, we hop and play,
With new tools brightening our day.
State is managed with such great flair,
Optimistic updates fill the air!
Dependencies shift, a monorepo's grace,
In our coding burrow, we find our place! 🌟
WIP:
Summary by CodeRabbit
New Features
immer
,uuid
,starknet
, andzustand
.GalaxyModel
for better structure and reusability.Refactor
useDojoStore
.Bug Fixes
Tests