Repository navigation
RTK Query usage feedback for 2.x planning #5534
markerikson
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
We're starting on the RTK Query work in the 2.x and 3.0 roadmap. Several of the upcoming 2.x releases change how RTKQ tracks requests and writes to the cache. Before we lock in those behaviors, we'd like to know how you actually use them today.
Real code examples help the most, even short snippets. "We do X because Y" is more useful to us than "X would be nice".
Reading the cache directly
state.api.queriesorstate.api.mutationsdirectly, instead of through the endpoint selectors? What for?In 3.0 the query cache moves to
queries[endpointName][cacheKey](#5503), so we want to know what that breaks and what selectors or utilities would replace your current code.initiate()promises and request timingawait dispatch(api.endpoints.x.initiate(arg))and use the value it resolves to? What happens if that request was deduped against one already in flight?forceRefetch,subscribe: false, or manualunsubscribe()calls? What for?In 2.15 the
initiate()promise always resolves with the result of its own request (#5506). That's a behavior change, so we want to know who depends on the current behavior.Invalidation while a request is pending
updateQueryDataorupsertQueryDatawhile a fetch for that entry is in flight, which result do you expect to win?These answers feed directly into the invalidation work (#5510, #5511) and into which of these behaviors becomes the default.
SSR, hydration and persistence
extractRehydrationInfo? With which setup (Next.js pages or app router, redux-persist, something custom)?We plan to add
dehydrate/hydrateutilities in 2.17 (#5515), and they will be the supported way to carry cache data across the 3.0 upgrade.Answers on any subset of these are welcome. Feedback on the 3.0 API changes goes in [the 3.0 breaking changes discussion].
All reactions