You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For older environments, see the [compatibility guide](./docs/compatibility.md).
128
+
If your environment does not support `AbortSignal.any` (Node.js < 20.6, older browsers), you **must install a polyfill** before using ffetch. See the [compatibility guide](./docs/compatibility.md) for instructions.
129
129
130
130
**Custom fetch support:**
131
131
You can pass any fetch-compatible implementation (native fetch, node-fetch, undici, SvelteKit, Next.js, Nuxt, or a polyfill) via the `fetchHandler` option. This makes ffetch fully compatible with SSR, edge, metaframework environments, custom backends, and test runners.
Copy file name to clipboardExpand all lines: docs/advanced.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,9 +44,7 @@ Pending requests and abort logic work identically whether you use the default gl
44
44
45
45
Every `PendingRequest` always has a `controller` property, even if you did not supply an AbortController. This allows you to abort any pending request programmatically, regardless of how it was created.
46
46
47
-
When multiple signals (user, timeout, transformRequest) are combined and `AbortSignal.any` is not available, ffetch creates a new internal `AbortController` to manage aborts. This controller is always available in `PendingRequest.controller`.
48
-
49
-
You can always abort a pending request using `pendingRequest.controller.abort()`, even if you did not provide a controller or signal. This works for all requests tracked in `pendingRequests`.
47
+
Signal combination (user, timeout, transformRequest) requires `AbortSignal.any`. If your environment does not support it, you must install a polyfill before using ffetch.
50
48
51
49
You can access and monitor all active requests through the `pendingRequests` property on the client instance:
Copy file name to clipboardExpand all lines: docs/api.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,7 @@ client.abortAll(): void // Aborts all currently pending requests
82
82
83
83
### Notes
84
84
85
+
- Signal combination (user, timeout, transformRequest) requires `AbortSignal.any`. If your environment does not support it, you must install a polyfill before using ffetch.
85
86
- The first retry attempt uses `attempt = 2` (i.e., the first call is attempt 1, first retry is 2)
86
87
-`shouldRetry` default logic: retries on network errors, HTTP 5xx, or 429; does not retry on 4xx (except 429), abort, or timeout errors
87
88
- All client options can be overridden on a per-request basis via the `init` parameter
Copy file name to clipboardExpand all lines: docs/compatibility.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Prerequisites
4
4
5
-
`ffetch` requires modern AbortSignal APIs, specifically `AbortSignal.timeout` and `AbortSignal.any`.
5
+
`ffetch` requires modern AbortSignal APIs, specifically `AbortSignal.timeout` and **AbortSignal.any**. Signal combination requires `AbortSignal.any` (native or polyfill).
6
6
7
7
## Node.js Support
8
8
@@ -13,21 +13,19 @@
13
13
14
14
### Polyfills for Older Versions
15
15
16
-
For older Node.js versions, you must install a polyfill:
16
+
For older Node.js versions, you must install a polyfill for both `AbortSignal.timeout` and `AbortSignal.any`:
0 commit comments