diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-01 10:16:35 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-01 10:16:38 +0900 |
| commit | a07dada0c9ba80976692ee14e256da0a2d6b0112 (patch) | |
| tree | 7de73126b4e69ed3e2128e19da2eca56fe4f9e68 /docs | |
| parent | 081498168fe25b377f4675637c57a08e4e399f95 (diff) | |
| download | kioku-a07dada0c9ba80976692ee14e256da0a2d6b0112.tar.gz kioku-a07dada0c9ba80976692ee14e256da0a2d6b0112.tar.zst kioku-a07dada0c9ba80976692ee14e256da0a2d6b0112.zip | |
refactor(atoms): migrate to jotai-tanstack-query from custom reloadable atoms
Replace custom createReloadableAtom/createReloadableAtomFamily with
atomWithSuspenseQuery from jotai-tanstack-query, leveraging TanStack
Query's built-in caching, invalidation, and Suspense support.
- Add @tanstack/query-core and jotai-tanstack-query dependencies
- Create shared QueryClient instance (src/client/queryClient.ts)
- Migrate all data atoms (decks, cards, study, noteTypes) to atomWithSuspenseQuery
- Update page components to use .data destructuring and queryClient.invalidateQueries()
- Update all test files to use QueryClient for data hydration
- Remove src/client/atoms/utils.ts (no longer needed)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/dev/architecture.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md index fd75c8c..cb6e634 100644 --- a/docs/dev/architecture.md +++ b/docs/dev/architecture.md @@ -6,7 +6,7 @@ |-------|------------| | Frontend | React + Vite | | Routing | Wouter | -| State | Jotai | +| State | Jotai + jotai-tanstack-query | | Styling | TailwindCSS | | Backend | Hono + TypeScript | | Database | PostgreSQL | @@ -67,9 +67,10 @@ kioku/ │ │ └── scripts/ # CLI scripts (add-user) │ └── client/ # React frontend │ ├── index.tsx +│ ├── queryClient.ts # Shared TanStack QueryClient instance │ ├── components/ │ ├── pages/ -│ ├── atoms/ # Jotai atoms (state management) +│ ├── atoms/ # Jotai atoms (atomWithSuspenseQuery for server data) │ ├── db/ # Dexie IndexedDB │ ├── sync/ # Sync engine │ └── api/ |
