liaise 5.0.1 → 5.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,64 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [5.0.3] — 2026-10-04
9
+
10
+ A documentation release. Nothing in the package's behaviour changes. See
11
+ [MIGRATION.md](./MIGRATION.md#upgrading-to-503).
12
+
13
+ ### Documentation
14
+
15
+ - **The README is reorganised around what you need first.** It now runs from the
16
+ problem, to a quick start, a guide, tested recipes and a comparison, and ends with
17
+ a complete reference. Every recipe in it runs as a test in CI, and
18
+ `npm run docs:check` fails if the README copy drifts from that test.
19
+ - **`src/types.ts` comments corrected.** More than ten stale or wrong comments,
20
+ including the claim that a raw string param is never shared, and a comparison of
21
+ timeouts with axios, XHR and got that the project cannot support, which is removed.
22
+
23
+ ### Fixed
24
+
25
+ - **The `share` option's type documentation no longer lists signal-replacing
26
+ middleware as a known limitation.** It was fixed in 3.0.0 (the shared signal is
27
+ re-merged when a middleware replaces `ctx.request.signal`), and an existing test
28
+ pins it.
29
+
30
+ ### Added (repository only, not in the package)
31
+
32
+ - `compare/`, a rerunnable comparison of fetch, axios, ky, ofetch and liaise. The
33
+ README's comparison section is generated from it.
34
+ - `npm run docs:check`, which fails when a README recipe drifts from its test or an
35
+ in-page link has no heading.
36
+ - Tests for behaviour the README states: a throwing middleware gives
37
+ `kind: 'middleware'` with `status: 0`; a caller's cancel still ends the call as
38
+ `'abort'` when a middleware replaces `ctx.request.signal`, without aborting the
39
+ request itself; a header added by middleware is not part of the `share` key;
40
+ and the defaults of `retryMiddleware` (`max` 3, `baseDelay` 250,
41
+ `maxDelay` 30000) and `cacheMiddleware` (`ttl` 5 minutes, `maxSize` 50).
42
+
43
+ ## [5.0.2] — 2026-10-04
44
+
45
+ ### Fixed
46
+
47
+ - **A path parameter with no usable value is refused instead of sent.** A token
48
+ was filled with `String(value)` unchecked, so `getUser({ id: undefined })` on
49
+ `/users/:id` fetched `/users/undefined`, and `null`, `''`, an object or an array
50
+ built `/users/null`, `/users/`, `/users/%5Bobject%20Object%5D` or `/users/1%2C2`.
51
+ The usual cause is a component rendering before the id has loaded. Such a call
52
+ now returns an error Result (`kind: 'network'`, a `TypeError` naming each bad
53
+ param, e.g. `Path parameter "id" is undefined in path "/users/:id", so the call
54
+ was not sent.`) and nothing reaches the server. Accepted values are non-empty
55
+ strings, finite numbers, bigints and booleans; a `Date` is refused with a hint
56
+ to convert it first (`toISOString()` or `getTime()`), as in a query string.
57
+ `NaN` and `Infinity` are refused too. See
58
+ [MIGRATION.md](./MIGRATION.md#upgrading-to-502).
59
+
60
+ ### Changed
61
+
62
+ - The README's size figures are re-measured with `npm run size`: about 5.8 kB
63
+ gzipped for a REST-only import, 6.9 kB for the core entry, 8.0 kB with all
64
+ middleware (the new check and its error messages add about 0.2 kB).
65
+
8
66
  ## [5.0.1] — 2026-10-03
9
67
 
10
68
  A bug-fix release from an audit of 5.0.0. Nothing in the API changes; a few calls
@@ -1008,6 +1066,8 @@ Initial release of the rewritten client. Reconstructed from the release commit
1008
1066
  `ArrayBuffer` and strings
1009
1067
  - Response parsing as `json`, `text`, `blob`, `arrayBuffer` or `formData`
1010
1068
 
1069
+ [5.0.3]: https://github.com/iremlopsum/liaise/compare/v5.0.2...v5.0.3
1070
+ [5.0.2]: https://github.com/iremlopsum/liaise/compare/v5.0.1...v5.0.2
1011
1071
  [5.0.1]: https://github.com/iremlopsum/liaise/compare/v5.0.0...v5.0.1
1012
1072
  [5.0.0]: https://github.com/iremlopsum/liaise/compare/v4.4.3...v5.0.0
1013
1073
  [4.4.3]: https://github.com/iremlopsum/liaise/compare/v4.4.2...v4.4.3
package/MIGRATION.md CHANGED
@@ -7,6 +7,22 @@ For the full record of what changed in each release, see [CHANGELOG.md](./CHANGE
7
7
 
8
8
  ---
9
9
 
10
+ ## Upgrading to 5.0.3
11
+
12
+ No action needed. Documentation only, plus corrected type comments in `src/types.ts`.
13
+
14
+ ---
15
+
16
+ ## Upgrading to 5.0.2
17
+
18
+ No code changes needed. A call whose path parameter is `undefined`, `null`, an
19
+ empty string, an object, an array, a `Date`, a function, a symbol, `NaN` or `Infinity` now returns an
20
+ error Result instead of being sent to a URL like `/users/undefined`. Those calls
21
+ were already hitting the wrong URL; now they say so. If you relied on a literal
22
+ `null` or `undefined` segment, pass the string (`'null'`) explicitly.
23
+
24
+ ---
25
+
10
26
  ## Upgrading to 5.0.1
11
27
 
12
28
  No code changes for most callers. Six things you may observe.