• Steven's avatar
    perf(react-query): fix context re-renders and improve type safety · b2e2b642
    Steven authored
    Optimizes React Query migration with performance and consistency improvements:
    
    Performance:
    - Memoize AuthContext and InstanceContext provider values to prevent unnecessary re-renders
    - Convert InstanceContext getter functions to useMemo hooks
    - Fix refetchSettings to avoid state dependency that caused frequent recreations
    
    Type Safety:
    - Replace 'any' types in useAttachmentQueries with proper protobuf types
    - Add Attachment and ListAttachmentsRequest type imports
    
    Query Key Consistency:
    - Replace hardcoded ["users", "stats"] with userKeys.stats() factory function
    - Ensures consistent cache key management across mutations
    
    Developer Experience:
    - Rename unused useCurrentUser to useCurrentUserQuery to avoid confusion
    - Add documentation explaining AuthContext-based vs React Query current user hooks
    - Update internal references in useNotifications and useTagCounts
    
    All changes verified with TypeScript compilation and build tests.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    Co-Authored-By: 's avatarClaude Sonnet 4.5 <noreply@anthropic.com>
    b2e2b642
Name
Last commit
Last update
.github Loading commit data...
cmd/memos Loading commit data...
internal Loading commit data...
plugin Loading commit data...
proto Loading commit data...
scripts Loading commit data...
server Loading commit data...
store Loading commit data...
web Loading commit data...
.dockerignore Loading commit data...
.gitignore Loading commit data...
.golangci.yaml Loading commit data...
CLAUDE.md Loading commit data...
CODEOWNERS Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
SECURITY.md Loading commit data...
go.mod Loading commit data...
go.sum Loading commit data...