Commit f2c37d9
chore(example): showcase type system across all frameworks (#520)
* chore(example): showcase type system across all frameworks
- React: replace any/Record<string, unknown> with ABI-derived types,
add ParsedEntity, Token, TokenBalance, Event imports, remove console.log
- Vue: use ABI-derived Position/Moves types instead of ComponentValue<any>
- Node: add typed Position/Moves annotations from @showcase/dojo
- Add educational comments pointing to core/types.ts for the full pattern
- Fix 'Infinite Scroll Entities' -> 'Infinite Scroll Tokens' copy-paste bug
* fix(example): address CodeRabbit review feedback
- Extract shared NUMSGame interface to core/nums-types.ts (no duplication)
- Use React.JSX.Element for React 19 compatibility
- Use non-null assertion after .filter() instead of optional chaining
- Type Event consistently across EventList, EventSubscriber, and InfiniteScroll
- Add optional chaining for vec access in Vue moveUp/moveLeft
- Cast getComponentValue at boundary in Vue for consistency with Node
- Remove Partial<> wrapper on Vue refs (full model or null)
* refactor(example): switch React from NUMS/Sepolia to dojo-starter
- Connect to local Torii (localhost:8080) with dojo-starter manifest
- Query dojo_starter-Position and dojo_starter-Moves models
- Use ABI-derived Position/Moves types from @showcase/dojo
- Remove manifest_sepolia.json and nums-types.ts
- All frameworks now consistently use the dojo-starter world
* chore(example): replace recs with SDK pattern in vue and node
* fix(example): use Pagination.getItems() instead of private .items
---------
Co-authored-by: Thierry <thierry@openclaw.ai>1 parent 81f04d8 commit f2c37d9
10 files changed
Lines changed: 250 additions & 4761 deletions
File tree
- example
- core/dojo
- frameworks
- node/src
- react/src
- effect/atoms
- pages
- vue/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
3 | 2 | | |
4 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
5 | 11 | | |
6 | | - | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
9 | 29 | | |
10 | 30 | | |
11 | 31 | | |
| |||
23 | 43 | | |
24 | 44 | | |
25 | 45 | | |
26 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
27 | 58 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
33 | 64 | | |
34 | 65 | | |
35 | 66 | | |
36 | 67 | | |
37 | 68 | | |
38 | | - | |
| 69 | + | |
39 | 70 | | |
40 | 71 | | |
41 | 72 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | | - | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
0 commit comments