You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tracking epic for the data-layer refactor planned in docs/HANDOFF_TANSTACK_ROUTER_QUERY.md (refined in a grilling session; see docs/adr/0001-api-modules.md).
Goal
Move from src/hooks/queries/ to a feature-sliced src/api/ module with one self-contained file per endpoint (types + fetch/mutate + queryOptions factory + hook), then adopt TanStack Router loaders + useSuspenseQuery, then make auth-dependent queries prefetchable.
Phases (child tickets)
Effort 1 — Restructuresrc/hooks/queries/ → src/api/ (mechanical, no behavior change)
Effort 2 — Router adoption (loaders + useSuspenseQuery per feature)
Tracking epic for the data-layer refactor planned in
docs/HANDOFF_TANSTACK_ROUTER_QUERY.md(refined in a grilling session; seedocs/adr/0001-api-modules.md).Goal
Move from
src/hooks/queries/to a feature-slicedsrc/api/module with one self-contained file per endpoint (types + fetch/mutate +queryOptionsfactory + hook), then adopt TanStack Router loaders +useSuspenseQuery, then make auth-dependent queries prefetchable.Phases (child tickets)
src/hooks/queries/→src/api/(mechanical, no behavior change)useSuspenseQueryper feature)Each effort is executed feature-by-feature and the three are kept separate (don't bundle a restructure and a router change in one slice).
Key decisions (locked)
src/api/, flat — one folder per feature; nested sub-features promoted to top-level siblings (editions,artist-notes,invites).types.ts(entity Row type + key factory); oneuse-prefixed file per endpoint holding its types + fetch/mutate + per-filequeryOptionsfactory + hook.enabled/conditional queries stayuseQuery(not suspense).AuthProviderstays fully intact (Hoist auth session into router context (enable auth-dependent loader prefetch) #50).See the handoff doc for full detail, caveats, and open questions (
staleTime, errorComponent global vs per-route).