Skip to content

Commit 49d1d2e

Browse files
docs(caching): expand changeset to cover the full hook migration
1 parent 31b410c commit 49d1d2e

1 file changed

Lines changed: 25 additions & 7 deletions

File tree

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
---
22
'@openchoreo/backstage-plugin-react': patch
33
'@openchoreo/backstage-plugin': patch
4+
'@openchoreo/backstage-plugin-openchoreo-observability': patch
5+
'@openchoreo/backstage-plugin-openchoreo-ci': patch
6+
'@openchoreo/backstage-plugin-openchoreo-workflows': patch
47
---
58

6-
Add a frontend response-caching foundation built on TanStack Query. New
7-
`useOpenChoreoQuery` hook in the React plugin wraps `useQuery` behind a
8-
swappable seam and returns the `{ loading, isRefetching, data, error, refetch }`
9-
shape `ContentLoader` consumes, so cached data paints instantly on remount and a
10-
background refresh no longer blanks the view. As a proof of concept the Deploy
11-
tab's `useEnvironmentData` now fetches through the cache, and the pipeline canvas
12-
shows a subtle "refreshing" overlay on a background refetch instead of clearing.
9+
Introduce a frontend response cache (TanStack Query) behind a swappable seam and
10+
migrate the portal's data-fetching hooks onto it, so cached data paints
11+
instantly on remount and a background refresh no longer blanks the view.
12+
13+
New hooks in `@openchoreo/backstage-plugin-react`, all wrapping TanStack Query so
14+
plugins never import it directly:
15+
16+
- `useOpenChoreoQuery` — cached reads, returning the
17+
`{ data, loading, isRefetching, error, refetch }` shape the loaders consume.
18+
- `useOpenChoreoMutation` — writes that re-throw on error and invalidate cached
19+
queries on success (replacing the hand-rolled "call verb then refetch").
20+
- `useOpenChoreoInfiniteQuery` — cursor-paginated "load more + live poll" lists
21+
(runtime logs/events).
22+
- `useOpenChoreoCache` — imperative cache access for optimistic writes and the
23+
lazy, dynamically-keyed hooks.
24+
25+
Migrated across the openchoreo, observability, CI and workflows plugins: simple
26+
and parameterized reads, read+mutation hooks, `setInterval` pollers (now
27+
`refetchInterval` with terminal stop conditions), lazy/conditional and
28+
keyed-Map hooks, the log/event pagination trio, and the `react-use` `useAsync`
29+
sites. `useAsyncOperation` is deprecated in favour of `useOpenChoreoMutation`.
30+
The provider is mounted in the app root and the cache is cleared on sign-out.

0 commit comments

Comments
 (0)