mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 22:04:56 +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>
47 lines
1.6 KiB
JSON
47 lines
1.6 KiB
JSON
{
|
|
"name": "metabuilder-root",
|
|
"private": true,
|
|
"version": "0.0.0",
|
|
"description": "MetaBuilder - Data-driven multi-tenant platform",
|
|
"scripts": {
|
|
"db:generate": "npm --prefix dbal/development run db:generate",
|
|
"db:push": "npm --prefix dbal/development run db:push",
|
|
"db:migrate": "npm --prefix dbal/development run db:migrate",
|
|
"db:seed": "npm --prefix dbal/development run db:seed",
|
|
"dev": "npm --prefix frontends/nextjs run dev",
|
|
"build": "npm --prefix frontends/nextjs run build",
|
|
"typecheck": "npm --prefix frontends/nextjs run typecheck",
|
|
"lint": "npm --prefix frontends/nextjs run lint",
|
|
"test": "npm --prefix frontends/nextjs run test",
|
|
"test:e2e": "playwright test",
|
|
"test:e2e:ui": "playwright test --ui",
|
|
"test:e2e:headed": "playwright test --headed",
|
|
"test:e2e:debug": "playwright test --debug",
|
|
"test:e2e:report": "playwright show-report",
|
|
"test:e2e:json": "playwright test e2e/json-packages.spec.ts",
|
|
"migrate:workflows": "ts-node scripts/migrate-workflows-to-n8n.ts",
|
|
"migrate:workflows:dry": "ts-node scripts/migrate-workflows-to-n8n.ts --dry-run"
|
|
},
|
|
"workspaces": [
|
|
"redux/slices",
|
|
"redux/hooks",
|
|
"redux/adapters",
|
|
"redux/hooks-data",
|
|
"redux/hooks-auth",
|
|
"redux/hooks-canvas",
|
|
"redux/hooks-async",
|
|
"redux/core-hooks",
|
|
"redux/api-clients",
|
|
"redux/timing-utils",
|
|
"dbal/development",
|
|
"frontends/nextjs",
|
|
"frontends/dbal",
|
|
"config",
|
|
"storybook"
|
|
],
|
|
"devDependencies": {
|
|
"@playwright/test": "^1.49.1",
|
|
"jsdom": "^27.4.0"
|
|
}
|
|
}
|