Skip to content

Conversation

@johnnyjoygh
Copy link
Collaborator

No description provided.

johnnyjoygh and others added 3 commits December 24, 2025 09:21
- Add React Query v5.90.12 with devtools for modern state management
- Create query hooks for memos, users, and attachments with automatic caching
- Replace MobX with React Context for client state (view preferences, filters)
- Migrate core pages: Home, MemoDetail, UserProfile, Inboxes to React Query
- Add comprehensive documentation and testing guides

Infrastructure:
- Query client configured with 10s staleTime, 5min gcTime
- Query keys organized by resource (memoKeys, userKeys, attachmentKeys)
- Optimistic updates and automatic invalidation on mutations
- ViewContext and MemoFilterContext for UI state persistence

Pages migrated:
- Home.tsx: Removed observer wrapper
- MemoDetail.tsx: Migrated to useMemoQuery hook with comment fetching
- UserProfile.tsx: Migrated to useUser hook
- Inboxes.tsx: Migrated to useNotifications hook

Documentation:
- Updated CLAUDE.md with React Query architecture and usage patterns
- Created migration guide in web/scripts/migration-guide.md
- Created testing guide in docs/plans/TESTING-GUIDE.md
- Updated development commands to mention React Query devtools

Benefits:
- Industry-standard patterns for better contributor onboarding
- Automatic request deduplication and background refetching
- Type-safe hooks with built-in loading/error states
- Hybrid approach allows gradual migration (MobX coexists)

Core user flows now use React Query while maintaining backward
compatibility with unmigrated components.

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@johnnyjoygh johnnyjoygh requested a review from boojack as a code owner December 24, 2025 10:11
@boojack boojack merged commit f87f728 into main Dec 24, 2025
2 checks passed
@boojack boojack deleted the feat/react-query-migration branch December 24, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants