@blaze-cache/swr 0.4.0-beta.2 → 0.5.0-beta.1
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/README.md +27 -27
- package/dist/middleware.d.ts.map +1 -1
- package/dist/middleware.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/useBlazeSWR.d.ts.map +1 -1
- package/dist/useBlazeSWR.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/blaze-cache/blaze-cache/main/docs/blaze-cache-logo.png" alt="Blaze Cache logo" width="150">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/blaze-cache/blaze-cache/main/docs/assets/blaze-cache-logo.png" alt="Blaze Cache logo" width="150">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">@blaze-cache/swr</h1>
|
|
@@ -40,29 +40,29 @@ for that key) always wins over the cache.
|
|
|
40
40
|
|
|
41
41
|
## Behaviour
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
- Keys are filed under **SWR's own serialization** (`unstable_serialize`): plain strings
|
|
44
44
|
stay themselves, array/object keys get SWR's stable hash — an entry always lines up
|
|
45
45
|
with the key SWR uses internally, and `resolveBlazeKey(key)` exposes it for
|
|
46
46
|
imperative `cache.get` / `cache.set` / `cache.delete`.
|
|
47
|
-
|
|
47
|
+
- Successful fetches are written to the shared cache; failed fetches are not — errors
|
|
48
48
|
stay in SWR, data crosses into Blaze.
|
|
49
|
-
|
|
49
|
+
- The cache layer never takes a fetch down with it: a hydration read that throws seeds
|
|
50
50
|
nothing (the hook fetches as plain `useSWR` would, with one console warning), and a
|
|
51
51
|
write that throws — or a `tags` resolver that does — returns the data unwritten,
|
|
52
52
|
warned and otherwise uninterrupted.
|
|
53
|
-
|
|
53
|
+
- An `undefined` result is skipped too: SWR reads it as "no data", so there is nothing
|
|
54
54
|
to stamp a TTL onto.
|
|
55
|
-
|
|
55
|
+
- What is written is an **envelope** — `{ kind: 'swr', data, storedAt }` — and hydration
|
|
56
56
|
only seeds the UI from values carrying it. On a cache shared with `@blaze-cache/axios`,
|
|
57
57
|
`@blaze-cache/fetch` or `@blaze-cache/react-query`, a forced key collision can park a
|
|
58
58
|
foreign value under an SWR key; the envelope keeps an HTTP record from ever being shown
|
|
59
59
|
as this hook's `data`. `readBlazeSWRRecord(cache, key)` exposes the gated read, and
|
|
60
60
|
`isBlazeSWRRecord` the shape check.
|
|
61
|
-
|
|
61
|
+
- Renders never touch cache statistics: the hydration read prefers `peek` over `get`,
|
|
62
62
|
so StrictMode's double render cannot move the hit rate or influence eviction.
|
|
63
|
-
|
|
63
|
+
- Paused keys (`null`/`undefined`/`false`, or a lazy key resolving to one) read and
|
|
64
64
|
write nothing.
|
|
65
|
-
|
|
65
|
+
- SWR owns freshness _within_ a session; Blaze Cache owns it _across_ sessions —
|
|
66
66
|
`ttlMs` defaults to 24 h, and with no `tags` given every write carries the `'swr'`
|
|
67
67
|
tag, so `cache.invalidateTags('swr')` purges everything this package wrote.
|
|
68
68
|
(Supplied `tags` **replace** the default rather than extending it — add `'swr'`
|
|
@@ -73,16 +73,16 @@ for that key) always wins over the cache.
|
|
|
73
73
|
The entry points take `(cache, …, options?)` — the cache first, then the usual SWR
|
|
74
74
|
arguments, then normal SWR options plus the Blaze-side stamp (`ttlMs`/`tags`/`forceRefresh`).
|
|
75
75
|
|
|
76
|
-
| Export
|
|
77
|
-
|
|
|
78
|
-
| `useBlazeSWR`
|
|
79
|
-
| `blazeSWRMiddleware`
|
|
80
|
-
| `invalidateBlazeSWR`
|
|
81
|
-
| `resolveBlazeKey`
|
|
82
|
-
| `readBlazeSWRRecord`
|
|
83
|
-
| `isBlazeSWRRecord`
|
|
84
|
-
| `DEFAULT_TTL_MS` / `DEFAULT_TAGS`
|
|
85
|
-
| `BlazeSWROptions` / `BlazeSWRMiddlewareOptions` / `BlazeSWRCacheLike` / `BlazeSWRRecord` / `BlazeSWRTags` / `InvalidateBlazeSWROptions` | The option, cache, record and tag types.
|
|
76
|
+
| Export | What it does |
|
|
77
|
+
| --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
78
|
+
| `useBlazeSWR` | `useSWR` seeded from the cache, persisting successful fetches. |
|
|
79
|
+
| `blazeSWRMiddleware` | The same behaviour as a plain SWR middleware, for `SWRConfig` or an existing `useSWR`. |
|
|
80
|
+
| `invalidateBlazeSWR` | Purge this package's entries by tag — foreign records on a shared cache survive — and revalidate the hooks that showed them. |
|
|
81
|
+
| `resolveBlazeKey` | The key an SWR `key` is filed under in the Blaze Cache (`null` when paused). |
|
|
82
|
+
| `readBlazeSWRRecord` | The gated hydration read: `key`'s data, but only when the value is this package's own envelope. |
|
|
83
|
+
| `isBlazeSWRRecord` | The envelope shape check `readBlazeSWRRecord` uses. |
|
|
84
|
+
| `DEFAULT_TTL_MS` / `DEFAULT_TAGS` | The write stamp used when nothing is given: 24 h, `['swr']`. |
|
|
85
|
+
| `BlazeSWROptions` / `BlazeSWRMiddlewareOptions` / `BlazeSWRCacheLike` / `BlazeSWRRecord` / `BlazeSWRTags` / `InvalidateBlazeSWROptions` | The option, cache, record and tag types. |
|
|
86
86
|
|
|
87
87
|
Precedence for the write stamp and `forceRefresh`: the current `useSWR`/`useBlazeSWR`
|
|
88
88
|
options, then the middleware's own options, then the defaults. `useBlazeSWR` keeps
|
|
@@ -155,13 +155,13 @@ const { data } = useBlazeSWR(cache, '/api/todos', fetchTodos, {
|
|
|
155
155
|
// back, so the next mount starts from it
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
For a key that must be current
|
|
158
|
+
For a key that must be current _right now_ — a pull-to-refresh, a view opened after a
|
|
159
159
|
mutation elsewhere: the persisted entry is not read, `revalidateOnMount` is forced so the
|
|
160
160
|
fetch runs even where this call or the provider would quiet it (the flag beats an
|
|
161
161
|
explicit `revalidateOnMount: false` — skipping the read is only honest if the network
|
|
162
162
|
runs), and the write still happens. Skip the read, keep the write — the same rule as
|
|
163
163
|
axios/fetch's `forceRefresh`. Caller `fallbackData` and provider `fallback` keep their
|
|
164
|
-
own precedence: they only stop
|
|
164
|
+
own precedence: they only stop _Blaze_ from seeding, never the caller.
|
|
165
165
|
|
|
166
166
|
### Invalidating by tag
|
|
167
167
|
|
|
@@ -177,7 +177,7 @@ await invalidateBlazeSWR(cache, 'todos');
|
|
|
177
177
|
`invalidateBlazeSWR` only ever touches this package's `{ kind: 'swr' }` envelopes: on a
|
|
178
178
|
cache shared with `@blaze-cache/axios` / `@blaze-cache/fetch` /
|
|
179
179
|
`@blaze-cache/react-query`, an entry another integration wrote — even one wearing the
|
|
180
|
-
same tag — survives. It returns the purged keys. Hooks under a
|
|
180
|
+
same tag — survives. It returns the purged keys. Hooks under a _custom_ `SWRConfig`
|
|
181
181
|
provider need that provider's mutator:
|
|
182
182
|
|
|
183
183
|
```ts
|
|
@@ -218,11 +218,11 @@ Setup and the full integration reference live in the
|
|
|
218
218
|
|
|
219
219
|
## Part of Blaze Cache
|
|
220
220
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
221
|
+
- [`@blaze-cache/core`](https://www.npmjs.com/package/@blaze-cache/core) — the cache itself
|
|
222
|
+
- [`@blaze-cache/axios`](https://www.npmjs.com/package/@blaze-cache/axios) — HTTP adapter
|
|
223
|
+
- [`@blaze-cache/fetch`](https://www.npmjs.com/package/@blaze-cache/fetch) — drop-in `fetch()` replacement
|
|
224
|
+
- [`@blaze-cache/ky`](https://www.npmjs.com/package/@blaze-cache/ky) — ky hooks (v1 and v2)
|
|
225
|
+
- [`@blaze-cache/react-query`](https://www.npmjs.com/package/@blaze-cache/react-query) — TanStack Query v5 mirror + hook
|
|
226
226
|
|
|
227
227
|
## License
|
|
228
228
|
|
package/dist/middleware.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,UAAU,EAAiC,MAAM,KAAK,CAAC;AAIlF,OAAO,KAAK,EACV,iBAAiB,EACjB,yBAAyB,EAG1B,MAAM,YAAY,CAAC;AAEpB,2FAA2F;AAC3F,eAAO,MAAM,cAAc,WAAa,CAAC;AACzC,0FAA0F;AAC1F,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAAY,CAAC;AAuDvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,GAAG,OAAO,EAC/C,KAAK,EAAE,iBAAiB,EACxB,OAAO,GAAE,yBAAyB,CAAC,IAAI,CAAM,GAC5C,UAAU,CA6CZ"}
|
package/dist/middleware.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAQjD,2FAA2F;AAC3F,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AACzC,0FAA0F;AAC1F,MAAM,CAAC,MAAM,YAAY,GAAsB,CAAC,KAAK,CAAC,CAAC;AAavD;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAS,iBAAiB,CACxB,OAA0B,EAC1B,KAAwB,EACxB,GAAW,EACX,KAAoB;IAEpB,OAAO,KAAK,EAAE,GAAG,IAAW,EAAE,EAAE;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1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAEnF;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,OAAO;IACzC,kEAAkE;IAClE,IAAI,EAAE,KAAK,CAAC;IACZ,iDAAiD;IACjD,IAAI,EAAE,CAAC,CAAC;IACR,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,CAAC,IAAI,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAEnF;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,OAAO;IACzC,kEAAkE;IAClE,IAAI,EAAE,KAAK,CAAC;IACZ,iDAAiD;IACjD,IAAI,EAAE,CAAC,CAAC;IACR,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,CAAC,IAAI,GAAG,OAAO,IACrC,SAAS,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,KAAK,SAAS,MAAM,EAAE,CAAC,CAAC;AAE1E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,GAAG;IACxC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IAChC;;;;;;;;OAQG;IACH,IAAI,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,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E,KAAK,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,IAAI,CAAC;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBlazeSWR.d.ts","sourceRoot":"","sources":["../src/useBlazeSWR.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAGrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,WAAW,
|
|
1
|
+
{"version":3,"file":"useBlazeSWR.d.ts","sourceRoot":"","sources":["../src/useBlazeSWR.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAGrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,WAAW,CAAC,IAAI,GAAG,GAAG,EAAE,KAAK,GAAG,GAAG,EAAE,MAAM,SAAS,GAAG,GAAG,GAAG,EAC3E,KAAK,EAAE,iBAAiB,EACxB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,IAAW,EAC5C,OAAO,GAAE,eAAe,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAM,GAChE,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAoB1B"}
|
package/dist/useBlazeSWR.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBlazeSWR.js","sourceRoot":"","sources":["../src/useBlazeSWR.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,UAAU,WAAW,
|
|
1
|
+
{"version":3,"file":"useBlazeSWR.js","sourceRoot":"","sources":["../src/useBlazeSWR.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,UAAU,WAAW,CACzB,KAAwB,EACxB,GAAW,EACX,OAAO,GAAiC,IAAI,EAC5C,OAAO,GAAwD,EAAE;IAEjE,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC;IAEvC,OAAO,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE;QAC1B,iFAAiF;QACjF,qFAAqF;QACrF,iFAAiF;QACjF,oFAAoF;QACpF,+EAA+E;QAC/E,gBAAgB;QAChB,GAAG,UAAU;QACb,GAAG,EAAE;YACH,kBAAkB,CAAO,KAAK,EAAE;gBAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,YAAY,EAAE,OAAO,CAAC,YAAY;aACnC,CAAC;YACF,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC;SACf;KACF,CAA6B,CAAC;AACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cache/swr",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-beta.1",
|
|
4
4
|
"description": "Persist SWR in WebAssembly — instant first paint after reload while stale-while-revalidate still works",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"swr",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@blaze-cache/core": "0.
|
|
38
|
+
"@blaze-cache/core": "0.5.0-beta.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"swr": "^2.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"swr": "^2.5.1",
|
|
45
|
-
"typescript": "^
|
|
45
|
+
"typescript": "^7.0.2"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsc -p tsconfig.json",
|