@ic-reactor/react 4.0.0-beta.1 → 4.0.0-beta.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @ic-reactor/react
2
2
 
3
- > **ic-reactor 4 is a prerelease.** `4.0.0-beta.1` is published under npm's
3
+ > **ic-reactor 4 is a prerelease.** `4.0.0-beta.2` is published under npm's
4
4
  > `beta` dist-tag, and `latest` stays 3.x until 4.0 GA (milestone 1,
5
5
  > [#790](https://github.com/B3Pay/ic-reactor/issues/790)).
6
6
 
@@ -225,11 +225,14 @@ Three consequences of that move to the session are accepted, and tested:
225
225
  key that holds data (the server's) keeps it as it was, and a fetch of it
226
226
  resolves with that data. A key with none fails, with `kind` `"cancelled"`
227
227
  and `code` `"caller_changed"`, until the anonymous caller is current again.
228
- The hydrating render's own reads never show that error, but a `QueryCache`
229
- `onError`, an effect that awaits the fetch and, for a `useSuspenseQuery`
230
- read the server rendered without dehydrating its data, React's
231
- `onRecoverableError` (as the reported error's `cause` on React 19) see it:
232
- ignore `kind` `"cancelled"` there.
228
+ The hydrating render's own reads never show that error, but a global
229
+ error listener, an effect that awaits the fetch and, for a
230
+ `useSuspenseQuery` read the server rendered without dehydrating its data,
231
+ React's `onRecoverableError` (as the reported error's `cause` on React 19)
232
+ see it: ignore `kind` `"cancelled"` there. The client owns its
233
+ `QueryClient` and takes no `QueryCache`, so a global listener is
234
+ `client.queryClient.getQueryCache().subscribe()`, which sees the error as
235
+ an `"updated"` event whose `action.type` is `"error"`.
233
236
  - **A `useSuspenseQuery` read needs a Suspense boundary above it, on React 18
234
237
  and 19 alike.** The move to the session is a synchronous update, and a
235
238
  `useSuspenseQuery` read with none of the user's data yet suspends it. With a
package/dist/index.d.ts CHANGED
@@ -204,11 +204,12 @@ export declare function ReactorProvider({ client: build, children, }: ReactorPro
204
204
  * keeps it as it was, and a fetch of it resolves with that data. A key with
205
205
  * none fails (`kind` `"cancelled"`, `code` `"caller_changed"`) until the
206
206
  * anonymous caller is current again: the hydrating render's own reads never
207
- * show that, but a `QueryCache` `onError`, an effect that awaits the fetch
208
- * and, for a `useSuspenseQuery` read the server rendered without
209
- * dehydrating its data, React's `onRecoverableError` (as the reported
210
- * error's `cause` on React 19) see it, so ignore `kind` `"cancelled"`
211
- * there.
207
+ * show that, but a listener of
208
+ * `client.queryClient.getQueryCache().subscribe()` (the client takes no
209
+ * `QueryCache` of yours), an effect that awaits the fetch and, for a
210
+ * `useSuspenseQuery` read the server rendered without dehydrating its
211
+ * data, React's `onRecoverableError` (as the reported error's `cause` on
212
+ * React 19) see it, so ignore `kind` `"cancelled"` there.
212
213
  * - Put a Suspense boundary above every component that reads with
213
214
  * `useSuspenseQuery`, on React 18 and 19 alike. The move is a synchronous
214
215
  * update, which such a read suspends until the user's data arrives. With a
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzD,OAAO,EAQL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAwNd,wCAAwC;AACxC,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,MAAM,CAAA;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2GG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EAAE,KAAK,EACb,QAAQ,GACT,EAAE,oBAAoB,GAAG,YAAY,CAmDrC;AAmBD;;;;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;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,OAAO,IAAI,SAAS,GAAG;IACrC,gEAAgE;IAChE,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACxC,2CAA2C;IAC3C,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1C,CAsBA"}
package/dist/index.js CHANGED
@@ -383,11 +383,12 @@ const anonymous = () => ANONYMOUS;
383
383
  * keeps it as it was, and a fetch of it resolves with that data. A key with
384
384
  * none fails (`kind` `"cancelled"`, `code` `"caller_changed"`) until the
385
385
  * anonymous caller is current again: the hydrating render's own reads never
386
- * show that, but a `QueryCache` `onError`, an effect that awaits the fetch
387
- * and, for a `useSuspenseQuery` read the server rendered without
388
- * dehydrating its data, React's `onRecoverableError` (as the reported
389
- * error's `cause` on React 19) see it, so ignore `kind` `"cancelled"`
390
- * there.
386
+ * show that, but a listener of
387
+ * `client.queryClient.getQueryCache().subscribe()` (the client takes no
388
+ * `QueryCache` of yours), an effect that awaits the fetch and, for a
389
+ * `useSuspenseQuery` read the server rendered without dehydrating its
390
+ * data, React's `onRecoverableError` (as the reported error's `cause` on
391
+ * React 19) see it, so ignore `kind` `"cancelled"` there.
391
392
  * - Put a Suspense boundary above every component that reads with
392
393
  * `useSuspenseQuery`, on React 18 and 19 alike. The move is a synchronous
393
394
  * update, which such a read suspends until the user's data arrives. With a
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAqBZ,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EACL,aAAa,EACb,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACR,oBAAoB,GAGrB,MAAM,OAAO,CAAA;AAEd,8EAA8E;AAC9E,M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WAAW,CACZ,CAAA;IACD,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC;QACL,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,MAAM,EAAE,CAAC,OAAiB,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;QACrD,OAAO,EAAE,CAAC,OAAiB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;KACxD,CAAC,EACF,CAAC,MAAM,EAAE,KAAK,CAAC,CAChB,CAAA;AACH,CAAC"}
package/llms.txt CHANGED
@@ -3,7 +3,7 @@
3
3
  > The React bindings of ic-reactor 4: `ReactorProvider`, `useClient` and
4
4
  > `useAuth`. Their guide is the one `@ic-reactor/core` ships.
5
5
 
6
- Applies to `@ic-reactor/react` 4.0.0-beta.1.
6
+ Applies to `@ic-reactor/react` 4.0.0-beta.2.
7
7
 
8
8
  Read `node_modules/@ic-reactor/core/llms.txt`. It is the one guide for both
9
9
  packages: setup, the provider and `useAuth`, reads, writes, errors, values,
@@ -65,7 +65,9 @@ A signed-in reload has three accepted costs:
65
65
  it resolves with that data. A key with none fails, with `kind`
66
66
  `"cancelled"` and `code` `"caller_changed"`, until the anonymous caller is
67
67
  current again: the hydrating render's own reads never show it, but a
68
- `QueryCache` `onError`, an effect that awaits the fetch and, for a
68
+ listener of `client.queryClient.getQueryCache().subscribe()` (an
69
+ `"updated"` event whose `action.type` is `"error"`; the client takes no
70
+ `QueryCache` of yours), an effect that awaits the fetch and, for a
69
71
  `useSuspenseQuery` read the server rendered without dehydrating its data,
70
72
  React's `onRecoverableError` (as the reported error's `cause` on React 19)
71
73
  see it, so ignore `kind` `"cancelled"` there.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ic-reactor/react",
3
- "version": "4.0.0-beta.1",
3
+ "version": "4.0.0-beta.2",
4
4
  "description": "ic-reactor 4 React bindings: a provider that owns one client per tree, useClient and useAuth",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -35,7 +35,7 @@
35
35
  "bugs": {
36
36
  "url": "https://github.com/B3Pay/ic-reactor/issues"
37
37
  },
38
- "homepage": "https://ic-reactor.b3pay.net/v4/",
38
+ "homepage": "https://ic-reactor.b3pay.net/v4/packages/react/",
39
39
  "keywords": [
40
40
  "internet-computer",
41
41
  "icp",
@@ -55,10 +55,10 @@
55
55
  "peerDependencies": {
56
56
  "@tanstack/react-query": "^5.90.2",
57
57
  "react": ">=18.0.0",
58
- "@ic-reactor/core": "4.0.0-beta.1"
58
+ "@ic-reactor/core": "4.0.0-beta.2"
59
59
  },
60
60
  "devDependencies": {
61
- "@candid-core/schema": "0.3.0-beta.1",
61
+ "@candid-core/schema": "0.3.0",
62
62
  "@size-limit/preset-small-lib": "^13.0.3",
63
63
  "@tanstack/react-query": "^5.102.8",
64
64
  "@testing-library/dom": "^10.4.1",
@@ -70,7 +70,7 @@
70
70
  "react-dom": "^19.3.0",
71
71
  "size-limit": "^13.0.3",
72
72
  "vitest": "^5.0.0",
73
- "@ic-reactor/core": "4.0.0-beta.1"
73
+ "@ic-reactor/core": "4.0.0-beta.2"
74
74
  },
75
75
  "size-limit": [
76
76
  {
package/src/index.tsx CHANGED
@@ -505,11 +505,12 @@ const anonymous = (): string => ANONYMOUS
505
505
  * keeps it as it was, and a fetch of it resolves with that data. A key with
506
506
  * none fails (`kind` `"cancelled"`, `code` `"caller_changed"`) until the
507
507
  * anonymous caller is current again: the hydrating render's own reads never
508
- * show that, but a `QueryCache` `onError`, an effect that awaits the fetch
509
- * and, for a `useSuspenseQuery` read the server rendered without
510
- * dehydrating its data, React's `onRecoverableError` (as the reported
511
- * error's `cause` on React 19) see it, so ignore `kind` `"cancelled"`
512
- * there.
508
+ * show that, but a listener of
509
+ * `client.queryClient.getQueryCache().subscribe()` (the client takes no
510
+ * `QueryCache` of yours), an effect that awaits the fetch and, for a
511
+ * `useSuspenseQuery` read the server rendered without dehydrating its
512
+ * data, React's `onRecoverableError` (as the reported error's `cause` on
513
+ * React 19) see it, so ignore `kind` `"cancelled"` there.
513
514
  * - Put a Suspense boundary above every component that reads with
514
515
  * `useSuspenseQuery`, on React 18 and 19 alike. The move is a synchronous
515
516
  * update, which such a read suspends until the user's data arrives. With a