Skip to content
Source
Sign inSign up
TanStack/query

fix(broadcast-client): restore cache before initial fetch #11397

OpenTETvega(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/11397/headopened View on GitHub

Showing 30 changed files with 139 additions and 0 deletions (loading 26).

x
0 of 30 viewed, 30 left
15 additions and 0 deletions.changeset/add-broadcast-query-client-restore.mdAdded
View file
@@ -0,0 +1,15 @@
+---
+'@tanstack/query-broadcast-client-experimental': minor
+'@tanstack/react-query-persist-client': minor
+'@tanstack/preact-query-persist-client': minor
+'@tanstack/solid-query-persist-client': minor
+'@tanstack/svelte-query-persist-client': minor
+'@tanstack/angular-query-experimental': minor
+'@tanstack/angular-query-persist-client': minor
+---
+​
+Add cross-tab QueryClient bootstrap and restore-gate integrations to prevent
+duplicate initial requests when a fresh tab opens. `broadcastQueryClientRestore`
+automatically requests and responds to cache snapshots, while existing
+`broadcastQueryClient` usage remains live-sync-only unless
+`respondToCacheRequests` is explicitly enabled.
123 additions and 0 deletionsdocs/framework/react/plugins/broadcastQueryClient.mdModified
View file
@@ -28,6 +28,60 @@
​
## API
​
+### broadcastQueryClientRestore
+​
+Use the additive restore API when a new tab must bootstrap its cache before