Update changelog
Lint / lint (push) Failing after 20s

This commit is contained in:
Julien Valverdé committed 2026-10-11 21:53:42 +02:00
1 parent e48f3a6176
commit 0b636e0eaf
1 file changed
+40
+40
View File
@@ -57,6 +57,46 @@
QueryClient.layerWithOptions({ defaultStaleTime: "30 seconds" })
```
- [`2ed417a`](https://git.valverde.cloud/Thilawyn/effect-view/commit/2ed417a49f283c120af4034d1a496d3fe304dd05) - Add offline support to `Query`, like TanStack Query's `networkMode`.
- The new `networkMode` option (`Operation.NetworkMode`) is `"online"` by default: a request made offline waits for a connection before running, and its state has `paused: true` meanwhile, with `result.waiting` still `true`. With `"always"`, requests ignore the connection.
- The new `refreshOnReconnect` option refreshes the current key when the connection returns, subject to `staleTime`. It defaults to `true` in `"online"` mode, and to `false` otherwise.
- `QueryClient` takes the matching defaults: `defaultNetworkMode` and `defaultRefreshOnReconnect`.
- Focus and reconnect refreshes no longer restart a request that is already running, and a paused request resumes by itself.
The connection status comes from the new `AppConnectivity` service, and focus from the new `AppFocus` service. Each module provides `layerBrowser` (window events), `layerDummy` (always online or focused, e.g. for tests) and `make(view)` to build the service from any `View<boolean>`, e.g. on React Native.
- [`79d9061`](https://git.valverde.cloud/Thilawyn/effect-view/commit/79d906190754193b1b86bd07cd176d402180509f) - **Breaking:** `Mutation` takes a `networkMode` option too, defaulting to the client's `defaultNetworkMode`. Mutations called offline are now paused until the connection returns, unless `networkMode` is `"always"`. `Mutation.make` (and `MutationForm.make`) now require a `QueryClient`.
- [`2ed417a`](https://git.valverde.cloud/Thilawyn/effect-view/commit/2ed417a49f283c120af4034d1a496d3fe304dd05) - **Breaking:** `QueryClient.layer` and `QueryClient.layerWithOptions` now require the `AppConnectivity` and `AppFocus` services. In a browser, use `QueryClient.layerBrowser` and `QueryClient.layerBrowserWithOptions`, which provide both.
```ts
// Before
QueryClient.layer
QueryClient.layerWithOptions({ defaultStaleTime: "30 seconds" })
// After, in a browser
QueryClient.layerBrowser
QueryClient.layerBrowserWithOptions({ defaultStaleTime: "30 seconds" })
// After, elsewhere
QueryClient.layer.pipe(
Layer.provide(Layer.mergeAll(AppConnectivity.layerDummy, AppFocus.layerDummy)),
)
```
- [`2ed417a`](https://git.valverde.cloud/Thilawyn/effect-view/commit/2ed417a49f283c120af4034d1a496d3fe304dd05) - **Breaking:** rename `refreshOnWindowFocus` to `refreshOnFocus`, and `defaultRefreshOnWindowFocus` to `defaultRefreshOnFocus`. Focus is now read from the `AppFocus` service instead of the window directly, so it can be provided on any platform.
```ts
// Before
Query.make({ key, f, refreshOnWindowFocus: false })
QueryClient.layerWithOptions({ defaultRefreshOnWindowFocus: false })
// After
Query.make({ key, f, refreshOnFocus: false })
QueryClient.layerBrowserWithOptions({ defaultRefreshOnFocus: false })
```
### Patch Changes
- [`3875bc4`](https://git.valverde.cloud/Thilawyn/effect-view/commit/3875bc4f691dfa670137142e3bd62c226f9f5886) - Serving a fresh result from the cache no longer resets that cache entry's staleness timer.