mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
- Create asyncDataSlice.ts (426 lines)
* AsyncRequest interface for tracking request state
* AsyncDataState interface for global async state
* Four async thunks: fetchAsyncData, mutateAsyncData, refetchAsyncData, cleanupAsyncRequests
* Nine reducers for request state management
* Nine selectors for state access
* Automatic cleanup of old requests (>5min)
* Request deduplication via stable IDs
- Create redux/hooks-async workspace (1300+ lines)
* useReduxAsyncData hook: drop-in replacement for useQuery
- Automatic retries with configurable backoff
- Refetch on focus and refetch interval support
- Success/error callbacks
- Manual retry and refetch functions
* useReduxMutation hook: drop-in replacement for useMutation
- Execute mutations with loading/error tracking
- Status lifecycle tracking
- Multi-step mutation support for complex workflows
* useReduxPaginatedAsyncData: pagination helper
* useReduxMultiMutation: sequential mutation execution
- Create comprehensive unit tests (350+ lines)
* Test data fetching and state updates
* Test error handling and retries
* Test callbacks and status changes
* Test manual refetch/retry operations
* Test pagination functionality
* Full TypeScript type coverage
- Update root package.json to register redux/hooks-async workspace
- Create TANSTACK_TO_REDUX_MIGRATION_CHECKLIST.txt
* Tracks all 25 migration tasks across 5 phases
* Phase 1 now 100% complete
## Implementation Details
All async state stored in Redux, observable via DevTools:
- Requests tracked by ID for deduplication
- Automatic cleanup prevents memory leaks
- Status: idle → pending → succeeded/failed
- Refetching without clearing stale data
- Full TypeScript generic support
No breaking changes - API identical to previous hooks.
## Next Steps
Phase 2: Update api-clients to delegate to Redux hooks
Phase 3: Remove TanStack from providers and package.json
Phase 4: Validation & testing
Phase 5: Documentation updates
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
23 lines
610 B
JSON
23 lines
610 B
JSON
{
|
|
"compilerOptions": {
|
|
"target": "ES2020",
|
|
"useDefineForClassFields": true,
|
|
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
"module": "ESNext",
|
|
"skipLibCheck": true,
|
|
"esModuleInterop": true,
|
|
"allowSyntheticDefaultImports": true,
|
|
"strict": true,
|
|
"forceConsistentCasingInFileNames": true,
|
|
"resolveJsonModule": true,
|
|
"declaration": true,
|
|
"declarationMap": true,
|
|
"sourceMap": true,
|
|
"outDir": "./dist",
|
|
"rootDir": "./src",
|
|
"moduleResolution": "node"
|
|
},
|
|
"include": ["src/**/*"],
|
|
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.test.tsx"]
|
|
}
|