Skip to content

Commit 8eba14e

Browse files
chore(fetchium): rewrite this change's changesets for React developers
Lead with what changes for an app using useQuery or fetchQuery, keep migration notes to a line or two, and drop internal detail. No source change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 9ffa42b commit 8eba14e

4 files changed

Lines changed: 8 additions & 18 deletions

File tree

‎.changeset/activation-timing-fixes.md‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22
'fetchium': patch
33
---
44

5-
Timing fixes for mounting, unmounting and changing params.
5+
Fixed spurious errors and wrong data when a query mounts, unmounts or changes params quickly.
66

7-
- A query mounted and unmounted in the same task (a redirect in a layout effect, a `replace` on mount) no longer shows an `AbortError` on its next mount: its first request finishes in the background. Releasing a `prefetch()` or `retain()` lease still aborts the fetch it started.
8-
- A query unmounted mid-fetch and mounted again (a chart switched to another timeframe and back) no longer flashes an error. With no data yet it stays pending and refetches; with cached data it shows that data while it refetches.
9-
- Changing a Signal param while a fetch is in flight aborts it and fetches the new params, instead of showing and caching the old params' response under the new key. A param set in the same task the query mounts is fetched right away, and a param change makes a remounted query refetch even if its old data was fresh.
10-
- A query whose result is not an entity caches each params key separately. Previously every key's cache pointed at the latest params' data, so a cold start could show another key's data. This bug was in every earlier version.
11-
- A stale query that mounts as the network goes offline waits for the network instead of rejecting with "Query is paused due to network status".
12-
- A topic query mounted and unmounted in the same task no longer stays pending forever on its next mount. `TopicQueryAdapter.send()` honors its abort signal, including under React Native's `AbortController` polyfill.
13-
- `QueryClient.destroy()` aborts and cancels every fetch; whoever awaits one gets an `AbortError`, and nothing is written to the store afterwards.
14-
- With `gcTime: 0`, a query is collected only once its first fetch settles, so its entities no longer leak.
15-
- Also: `reactivationStaggerMs` spreads the refetches that resume after a pause, a `__fetchNext()` page for stale params is dropped, and with an asynchronous store a param change during the cache load no longer applies the old params' entry.
7+
- Unmounting and remounting a query, in the same task or mid-fetch (switching a chart timeframe and back), no longer shows an `AbortError`. The query shows its cached data, or stays pending, while it refetches. One exception: a topic query with no data that mounts and unmounts in the same task shows the `AbortError` on its next mount until its data arrives (before, it stayed pending forever).
8+
- Changing a Signal param mid-fetch fetches the new params instead of showing the old params' response. A query whose result is not an entity now caches each params value separately; a cold start could show another params value's data.
9+
- `QueryClient.destroy()` aborts every fetch in flight, and code awaiting one gets an `AbortError`.

‎.changeset/config-context-and-suspense-holds.md‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
'fetchium': patch
33
---
44

5-
Fixes for the new client options and `useSuspenseQuery`.
5+
`useSuspenseQuery` no longer refetches in a loop when a slow retry render takes a while to reach the component. The error goes to the error boundary, and resetting the boundary retries.
66

7-
- Custom `QueryClientConfig` keys still reach queries as `this.context`. `shouldRetry`, `reactivationGraceMs`, `reactivationStaggerMs`, `activity` and `pollResumeJitterMs` are reserved: a value under one of them is read as that option.
8-
- `poll()` ignores an `activity` value without `isActive` and `subscribe` functions (with a warning in development) instead of failing every polled query. `QueryContext` no longer declares `activity` or `pollResumeJitterMs`.
9-
- `Infinity` for `reactivationStaggerMs` or `pollResumeJitterMs` counts as 0, and `reactivationGraceMs: Infinity` never refetches on reactivation. A `shouldRetry` that is not a function is ignored.
10-
- `useSuspenseQuery` no longer refetches in a loop when a slow retry render takes too long to reach the component; the error goes to the error boundary, and resetting the boundary retries.
11-
- `Object.keys(this)` inside a query no longer lists an internal hook.
7+
Custom `QueryClientConfig` keys still reach queries as `this.context`, except the reserved option names `shouldRetry`, `reactivationGraceMs`, `reactivationStaggerMs`, `activity` and `pollResumeJitterMs`. An invalid value for one of these options is ignored instead of breaking queries.

‎.changeset/nested-value-reactivity.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'fetchium': patch
33
---
44

5-
Fixed child components showing stale nested values. A `component()` or `React.memo` child given a nested value as a prop (`token.price`: a `t.object` or `t.record` field, or a live collection's value) kept showing the old value after an update, because it received the same object. A changed nested value is now a new object, so the child re-renders. An unchanged one keeps its identity, so an update to another field doesn't re-render the child.
5+
Fixed memoized children (`component()` or `React.memo`) showing a stale value when given a nested value such as `token.price` as a prop. A nested `t.object`, `t.record` or live-collection value is now a new object when it changes, and keeps its identity when it doesn't.

‎.changeset/sync-store-merge-without-read.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'fetchium': patch
33
---
44

5-
Faster streamed updates with `SyncQueryStore`. Merging an update into a stored entity that is not in memory reads and parses the stored record only for the first merge, not on every event (up to 1024 entities are remembered). This is the common case for full-payload updates on a typename that more than one entity class declares.
5+
Faster streamed updates with `SyncQueryStore` for entities that aren't in memory, which is common when two entity classes share a typename.

0 commit comments

Comments
 (0)