@opetope/react 0.12.1 → 0.12.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,75 @@
1
1
  # @opetope/react
2
2
 
3
+ ## 0.12.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [7a33768]
8
+ - @opetope/runtime@0.12.3
9
+ - @opetope/core@0.12.3
10
+
11
+ ## 0.12.2
12
+
13
+ ### Patch Changes
14
+
15
+ - 2d1ecfc: Two axes of a Resource state, not one word (D462)
16
+
17
+ `ResourceState` carries two independent fields, `failure` and `pending`, and each is declared on every member of the
18
+ union — `?: never` where the member cannot hold one. Both are therefore read on the whole state in one step, without
19
+ narrowing by `kind` first:
20
+
21
+ ```ts
22
+ const refused = state.failure !== undefined;
23
+ const working = state.kind === 'loading' || state.pending !== undefined;
24
+ ```
25
+
26
+ `ResourceActivity` is gone, `ResourceChannelFailure` is now `ResourceFailure` with an optional `channel`, and
27
+ `failed` carries `failure` instead of a top-level `error`.
28
+
29
+ **Why.** One frequent question — «did something fail?» — was asked in three shapes: `failed.error`,
30
+ `loading.failure`, and `ready.activity.kind === 'failed'`. «Is something in flight?» was asked in two. Both are one
31
+ read each now.
32
+
33
+ **What changes in behaviour.** The priority within an axis is unchanged: at an equal kind the connection outranks
34
+ the refresh. The priority _between_ the axes is gone — a failed channel no longer hides a working one, so a `ready`
35
+ record publishes a dead connection and a running refresh together. That is more information, not less, and it is the
36
+ difference between «the live stream is gone, what is shown will not update» and «a manual reload is running over a
37
+ live stream».
38
+
39
+ `pending` is observable structure, so **every transition of the work axis now publishes a record**. It did not
40
+ before: one projected word hid that axis on a dataless `loading`, which carried no `activity` at all, and under any
41
+ failure, because `failed` outranked `pending`. Measured on a live Resource with both channels, a connection opening
42
+ over a dataless Resource goes from 1 record to 2; a `refresh()` over a healthy `ready` from 5 to 6; and a
43
+ `refresh()` over a `ready` that already carries a dead connection from 5 to 7, because its settling used to cost no
44
+ record at all. Up to two extra publications over the life of one materialization, and they reach the subscribers of
45
+ a `ready` Resource and not only a dataless one. Each carries the fact the axes were split for.
46
+
47
+ **Migration.**
48
+
49
+ | Was | Is now |
50
+ | --------------------------------------------- | ------------------------------------------------- |
51
+ | `state.error` on `failed` | `state.failure.error` |
52
+ | `state.failure.channel` on `loading` | unchanged, and now on every kind |
53
+ | `state.activity.kind === 'failed'` | `state.failure !== undefined` |
54
+ | `state.activity.kind === 'pending'` | `state.pending !== undefined` |
55
+ | `state.activity.operation` | `state.failure?.channel` or `state.pending` |
56
+ | `state.activity.error` | `state.failure?.error` |
57
+ | `ResourceChannelFailure` from `@opetope/core` | `ResourceFailure` |
58
+ | `ResourceActivity` from `@opetope/core` | nothing: read `state.failure` and `state.pending` |
59
+
60
+ `failure.channel` is absent only on a `failed` record whose every configured channel died, where no single channel
61
+ is the answer. `opetope/no-retired-vocabulary` reports `ResourceActivity` at both entries that ever spelled it, and
62
+ reports `state.activity` wherever it is read rather than only inside a `kind === 'loading'` narrowing; the rename to
63
+ `ResourceFailure` is printed by the compiler itself.
64
+
65
+ The inspection protocol is unchanged: `opetope.runtime-activity/4` stays `/4`, and the facts now read the published
66
+ record instead of a second copy of the channel phases.
67
+
68
+ - Updated dependencies [26e6c9a]
69
+ - Updated dependencies [2d1ecfc]
70
+ - @opetope/core@0.12.2
71
+ - @opetope/runtime@0.12.2
72
+
3
73
  ## 0.12.1
4
74
 
5
75
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opetope/react",
3
- "version": "0.12.1",
3
+ "version": "0.12.3",
4
4
  "engines": {
5
5
  "node": ">=20.19.0"
6
6
  },
@@ -49,16 +49,16 @@
49
49
  }
50
50
  ],
51
51
  "devDependencies": {
52
- "@opetope/core": "0.12.1",
53
- "@opetope/runtime": "0.12.1",
52
+ "@opetope/core": "0.12.3",
53
+ "@opetope/runtime": "0.12.3",
54
54
  "@testing-library/react": "16.3.3",
55
55
  "@types/react": "19.2.18",
56
56
  "react": "19.2.8",
57
57
  "react-dom": "19.2.8"
58
58
  },
59
59
  "peerDependencies": {
60
- "@opetope/core": "0.12.1",
61
- "@opetope/runtime": "0.12.1",
60
+ "@opetope/core": "0.12.3",
61
+ "@opetope/runtime": "0.12.3",
62
62
  "react": ">=19.0.0 <20"
63
63
  },
64
64
  "sideEffects": false,