Skip to content

Replace useProjectsCache with Tanstack Query (or SWR) #276

Description

@eipasteur

Context

Per review comment on #184 by @svozza: the hand-rolled useProjectsCache hook (~200 lines) manually implements stale-while-revalidate, dedup, TTL, and error states. A library like Tanstack Query or SWR provides all of this out of the box with devtools, retry, prefetch, and garbage collection.

Expected outcome

  • Replace useProjectsCache.ts with Tanstack Query hooks
  • Reduce cache boilerplate by ~50%
  • All consumers (AppSidebar, Dashboard, Project, ObservabilityLayout) updated
  • Behavior unchanged: stale-while-revalidate, 120s TTL projects, 60s sprints

Notes

  • Tanstack Query is tree-shakeable and ~12kB gzipped
  • This is a refactor, no user-facing behavior change

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions