@xmachines/play-xstate 4.0.0 → 5.0.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 +61 -30
- package/dist/capabilities.d.ts +4 -3
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js.map +1 -1
- package/dist/errors.d.ts +38 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +44 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/player-actor.d.ts +30 -29
- package/dist/player-actor.d.ts.map +1 -1
- package/dist/player-actor.js +51 -41
- package/dist/player-actor.js.map +1 -1
- package/dist/routing/build-url.d.ts +8 -1
- package/dist/routing/build-url.d.ts.map +1 -1
- package/dist/routing/build-url.js +34 -54
- package/dist/routing/build-url.js.map +1 -1
- package/dist/routing/derive-current-route.d.ts +11 -2
- package/dist/routing/derive-current-route.d.ts.map +1 -1
- package/dist/routing/derive-current-route.js +22 -6
- package/dist/routing/derive-current-route.js.map +1 -1
- package/dist/routing/derive-initial-route.d.ts +2 -1
- package/dist/routing/derive-initial-route.d.ts.map +1 -1
- package/dist/routing/derive-initial-route.js +2 -2
- package/dist/routing/derive-initial-route.js.map +1 -1
- package/dist/routing/format-play-route-transitions.js +10 -5
- package/dist/routing/format-play-route-transitions.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/view/derive-current-view.d.ts +6 -5
- package/dist/view/derive-current-view.d.ts.map +1 -1
- package/dist/view/derive-current-view.js +5 -4
- package/dist/view/derive-current-view.js.map +1 -1
- package/dist/with-routing.d.ts.map +1 -1
- package/dist/with-routing.js +66 -4
- package/dist/with-routing.js.map +1 -1
- package/dist/with-view.d.ts +19 -4
- package/dist/with-view.d.ts.map +1 -1
- package/dist/with-view.js +64 -56
- package/dist/with-view.js.map +1 -1
- package/package.json +14 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-play-route-transitions.js","sourceRoot":"","sources":["../../src/routing/format-play-route-transitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG1F;;;;;;;;;;GAUG;AACH,MAAM,kBAAkB,GAAG,CAAoC,IAAmB,EAAE,IAAO,EAAK,EAAE,CACjG,IAAI,KAAK,SAAS,IAAI,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAmCpE;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,KAAc,EAAa,EAAE,CACvD,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAKnE;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,KAAgC,EAAW,EAAE,CACvE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAK,KAAqB,CAAC,IAAI,KAAK,SAAS,CAAC;AAE1F
|
|
1
|
+
{"version":3,"file":"format-play-route-transitions.js","sourceRoot":"","sources":["../../src/routing/format-play-route-transitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE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AE,EAAE;YACzB,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,IAAI,QAAQ,CAAC,EAAE,EAAE;YACpD,OAAO,EAAE,YAAY,CAAC,aAAa,CAAC;YACpC,OAAO,EAAE,eAAe,CAAC,aAAa,CAAC;SACvC,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,aAAa,GAAG,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAE7C,oFAAoF;IACpF,gFAAgF;IAChF,yEAAyE;IACzE,cAAc;IACd,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;QACrD,OAAO,aAAa,CAAC;IACtB,CAAC;IAED,MAAM,IAAI,GAA4B;QACrC,GAAG,aAAa;QAChB,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD,CAAC;IAEF,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,MAAM,UAAU,GAAG,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC;QAE1C,iFAAiF;QACjF,8EAA8E;QAC9E,kFAAkF;QAClF,0EAA0E;QAC1E,IAAI,CAAC,IAAI,CAAC,GAAG;YACZ,GAAG,UAAU;YACb,YAAY,EAAE,CAAC,GAAG,gBAAgB,EAAE,GAAG,iBAAiB,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;SACnF,CAAC;IACH,CAAC;IAED,OAAO,IAAS,CAAC;AAClB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export interface PlayerOptions<TMachine extends AnyStateMachine> {
|
|
|
47
47
|
* you.
|
|
48
48
|
*/
|
|
49
49
|
onTransition?: (actor: PlayerActorClass<TMachine>, prevState: SnapshotFrom<TMachine>, nextState: SnapshotFrom<TMachine>) => void;
|
|
50
|
-
/** The actor calls it when the state
|
|
50
|
+
/** The actor calls it when the state atom changes */
|
|
51
51
|
onStateChange?: (actor: PlayerActorClass<TMachine>, state: SnapshotFrom<TMachine>) => void;
|
|
52
52
|
/**
|
|
53
53
|
* The actor calls it on an actor error: a snapshot restore that fails at `start()`,
|
|
@@ -92,7 +92,7 @@ export interface PlayerOptions<TMachine extends AnyStateMachine> {
|
|
|
92
92
|
* inside the constructor of the actor. Its `actorRef` value is therefore the
|
|
93
93
|
* instance during the construction, and `state`, `currentRoute`, `currentView`, and
|
|
94
94
|
* `initialRoute` do not exist yet. A read of one of them there throws. Keep the
|
|
95
|
-
* reference, and read the
|
|
95
|
+
* reference, and read the atoms from a later event, or outside the observer.
|
|
96
96
|
*
|
|
97
97
|
* @example
|
|
98
98
|
* ```typescript
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACrF,OAAO,KAAK,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,YAAY,CAC5B,QAAQ,SAAS,eAAe,EAChC,aAAa,SAAS,MAAM,GAAG,MAAM;IAErC,kCAAkC;IAClC,OAAO,EAAE,QAAQ,CAAC;IAElB,gDAAgD;IAChD,OAAO,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAElC;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;CACnD;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,QAAQ,SAAS,eAAe;IAC9D;;;;OA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AgB,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The view derivation — the meta.view half of the player pipeline.
|
|
3
3
|
*
|
|
4
4
|
* This file is beside src/routing/, so that player-actor.ts holds the actor
|
|
5
|
-
* itself only: the
|
|
5
|
+
* itself only: the atoms, the hooks, and the lifecycle. The walk over the active
|
|
6
6
|
* branch is shared with the route derivation. Therefore the view of a parallel
|
|
7
7
|
* machine always belongs to the region of its URL.
|
|
8
8
|
*/
|
|
@@ -12,12 +12,13 @@ import { type PlaySpec } from "@xmachines/play-view";
|
|
|
12
12
|
* Derives the current view of the actor from the state metadata.
|
|
13
13
|
*
|
|
14
14
|
* The function always returns a **fresh** `PlaySpec` object. The `Object.is`
|
|
15
|
-
* equality test of
|
|
16
|
-
* `
|
|
15
|
+
* equality test of the atom therefore stops no real change of the view.
|
|
16
|
+
* The `currentView` atom of `withView` decides if the actor emits that fresh object:
|
|
17
17
|
* it compares the object with the last spec of an emission, it reuses the reference
|
|
18
18
|
* of the composed `state` field when the value of the projection did not change, and
|
|
19
|
-
* it
|
|
20
|
-
*
|
|
19
|
+
* it returns the previous spec when the view on the screen is the same — which the
|
|
20
|
+
* `Object.is` compare of the atom reads as no change, so it notifies no subscriber. A
|
|
21
|
+
* provider below the actor therefore mounts the UI again not on every event.
|
|
21
22
|
*
|
|
22
23
|
* ### The context projection
|
|
23
24
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive-current-view.d.ts","sourceRoot":"","sources":["../../src/view/derive-current-view.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAiC,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAyEpF
|
|
1
|
+
{"version":3,"file":"derive-current-view.d.ts","sourceRoot":"","sources":["../../src/view/derive-current-view.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAiC,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAyEpF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,kBAAkB,KAAG,QAAQ,GAAG,IA4C3E,CAAC"}
|
|
@@ -59,12 +59,13 @@ const resolveViewMeta = (meta) => {
|
|
|
59
59
|
* Derives the current view of the actor from the state metadata.
|
|
60
60
|
*
|
|
61
61
|
* The function always returns a **fresh** `PlaySpec` object. The `Object.is`
|
|
62
|
-
* equality test of
|
|
63
|
-
* `
|
|
62
|
+
* equality test of the atom therefore stops no real change of the view.
|
|
63
|
+
* The `currentView` atom of `withView` decides if the actor emits that fresh object:
|
|
64
64
|
* it compares the object with the last spec of an emission, it reuses the reference
|
|
65
65
|
* of the composed `state` field when the value of the projection did not change, and
|
|
66
|
-
* it
|
|
67
|
-
*
|
|
66
|
+
* it returns the previous spec when the view on the screen is the same — which the
|
|
67
|
+
* `Object.is` compare of the atom reads as no change, so it notifies no subscriber. A
|
|
68
|
+
* provider below the actor therefore mounts the UI again not on every event.
|
|
68
69
|
*
|
|
69
70
|
* ### The context projection
|
|
70
71
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive-current-view.js","sourceRoot":"","sources":["../../src/view/derive-current-view.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAiB,MAAM,sBAAsB,CAAC;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AASnD;;;;;;;;GAQG;AACH,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAAU,CAAC;AACjD,MAAM,uBAAuB,GAAG,CAAC,QAAgB,EAAQ,EAAE;IAC1D,IAAI,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC;QAAE,OAAO;IAC7C,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjC,OAAO,CAAC,IAAI,CACX,mFAAmF;QAClF,uFAAuF,CACxF,CAAC;AACH,CAAC,CAAC;AAEF,iFAAiF;AACjF,MAAM,WAAW,GAAG,CAAC,SAAkB,EAAmB,EAAE;IAC3D,MAAM,SAAS,GACd,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ;QACzC,CAAC,CAAE,SAAgC,CAAC,IAAI;QACxC,CAAC,CAAC,SAAS,CAAC;IAEd,OAAO,SAAS;QACf,OAAO,SAAS,KAAK,QAAQ;QAC7B,MAAM,IAAK,SAAoB;QAC/B,UAAU,IAAK,SAAoB;QACnC,CAAC,CAAE,SAAsB;QACzB,CAAC,CAAC,IAAI,CAAC;AACT,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,IAA6B,EAA2B,EAAE;IAClF,oFAAoF;IACpF,qFAAqF;IACrF,0CAA0C;IAC1C,EAAE;IACF,+EAA+E;IAC/E,mFAAmF;IACnF,mFAAmF;IACnF,qFAAqF;IACrF,kEAAkE;IAClE,EAAE;IACF,qFAAqF;IACrF,gFAAgF;IAChF,EAAE;IACF,qFAAqF;IACrF,qFAAqF;IACrF,kFAAkF;IAClF,kBAAkB;IAClB,KAAK,MAAM,CAAC,GAAG,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC;QAClE,MAAM,IAAI,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,IAAI,EAAE,CAAC;YACV,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;QACtB,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"derive-current-view.js","sourceRoot":"","sources":["../../src/view/derive-current-view.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAE,WAA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CAAC;IACd,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7F,MAAM,KAAK,GAAG,gBAAgB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IAErD,OAAO;QACN,GAAG,QAAQ;QACX,OAAO;QACP,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC;KACrC,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-routing.d.ts","sourceRoot":"","sources":["../src/with-routing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"with-routing.d.ts","sourceRoot":"","sources":["../src/with-routing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAG9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAI3D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,QAAQ,SAAS,eAAe,EAC3D,IAAI,EAAE,iBAAiB,CAAC,QAAQ,CAAC,GAC/B,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAiHvC;AAcD,OAAO,EACN,WAAW,EACX,eAAe,EACf,aAAa,EACb,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACX,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,WAAW,EACX,aAAa,EACb,SAAS,EACT,iBAAiB,GACjB,MAAM,oBAAoB,CAAC"}
|
package/dist/with-routing.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createAtom } from "@xmachines/play-atom";
|
|
2
2
|
import { deriveCurrentRoute, deriveInitialRoute } from "./routing/index.js";
|
|
3
|
+
import { toError } from "./player-actor.js";
|
|
3
4
|
/**
|
|
4
5
|
* Adds the routing capability to an actor class.
|
|
5
6
|
*
|
|
@@ -17,14 +18,27 @@ import { deriveCurrentRoute, deriveInitialRoute } from "./routing/index.js";
|
|
|
17
18
|
export function withRouting(Base) {
|
|
18
19
|
class RoutableActor extends Base {
|
|
19
20
|
/**
|
|
20
|
-
* A
|
|
21
|
+
* A computed atom. It derives the current URL path from the `meta.route`
|
|
21
22
|
* template of the active machine state and from the context of the actor.
|
|
22
23
|
*
|
|
23
24
|
* It returns `null` when the current state has no `meta.route` field, and also when
|
|
24
25
|
* a necessary `:param` has no value in the context. The second case is normally
|
|
25
|
-
* temporary during a transition, and the
|
|
26
|
+
* temporary during a transition, and the atom computes the value again on the next
|
|
26
27
|
* snapshot.
|
|
27
28
|
*
|
|
29
|
+
* It THROWS never. A derivation of this architecture reports a failure through
|
|
30
|
+
* `onError` and keeps its last good value, and `currentView` of
|
|
31
|
+
* `@xmachines/play-xstate/view` follows the same rule.
|
|
32
|
+
*
|
|
33
|
+
* The reason is the propagation. A subscriber makes this atom eager, so the
|
|
34
|
+
* derivation runs inside the `set` of `state`, which runs inside the XState
|
|
35
|
+
* subscription. A throw that left this function would unwind into `actor.send` and
|
|
36
|
+
* break the transition for EVERY other observer of the actor.
|
|
37
|
+
*
|
|
38
|
+
* The containment therefore belongs to the derivation, and not to each subscriber:
|
|
39
|
+
* a consumer that writes its own `watchAtom(actor.currentRoute, ...)` is protected
|
|
40
|
+
* by the same rule that protects a router bridge.
|
|
41
|
+
*
|
|
28
42
|
* @example
|
|
29
43
|
* ```typescript
|
|
30
44
|
* // It returns "/profile/alice" when context.params.userId === "alice",
|
|
@@ -32,7 +46,55 @@ export function withRouting(Base) {
|
|
|
32
46
|
* const route = actor.currentRoute.get();
|
|
33
47
|
* ```
|
|
34
48
|
*/
|
|
35
|
-
currentRoute =
|
|
49
|
+
currentRoute = createAtom((previous) => {
|
|
50
|
+
try {
|
|
51
|
+
return deriveCurrentRoute(this.state.get());
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
// `deriveCurrentRoute` answers the EXPECTED failure itself: a missing `:param`
|
|
55
|
+
// returns `null`, and the next snapshot resolves it. Whatever reaches this line
|
|
56
|
+
// is unexpected — a `URIError` of `encodeURIComponent` for a lone surrogate,
|
|
57
|
+
// for example. Report it, and keep the last route: a caller that reads `null`
|
|
58
|
+
// or a stale route navigates nowhere, which the bridge handles already.
|
|
59
|
+
// The derivation runs inside the `set` of `state`, and the engine TRACKS every
|
|
60
|
+
// atom that this function reads — the handler of the host included. A report
|
|
61
|
+
// from HERE therefore made whatever that handler reads a dependency of this
|
|
62
|
+
// atom, and an unrelated write of it re-derived and reported again: three
|
|
63
|
+
// reports for one failure. The microtask leaves the evaluation, so the handler
|
|
64
|
+
// reads what it likes and this atom depends on none of it.
|
|
65
|
+
//
|
|
66
|
+
// It leaves the `set` as well, which is what the comment below already needed:
|
|
67
|
+
// a throw from the handler lands on the global handler of the runtime, and it
|
|
68
|
+
// breaks the transition for no other observer of the actor.
|
|
69
|
+
const onError = this.hooks.onError;
|
|
70
|
+
if (onError) {
|
|
71
|
+
const reported = toError(error);
|
|
72
|
+
queueMicrotask(() => {
|
|
73
|
+
onError(this, reported);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return previous ?? null;
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
// Every WRITE of `state` reaches an observer of this atom, and not the writes
|
|
80
|
+
// that change the route alone.
|
|
81
|
+
//
|
|
82
|
+
// The default `Object.is` stops a notification for a value that the atom holds
|
|
83
|
+
// already, and a route is a STRING: a guard that refuses an inbound location and
|
|
84
|
+
// moves the actor back to the state it came from derives the same string, so no
|
|
85
|
+
// observer heard the answer. `RouterBridgeBase` waits for exactly that answer —
|
|
86
|
+
// `syncActorFromRouter` clears `lastActorRoute` before it sends, so the push
|
|
87
|
+
// that puts the address bar back on the route of the machine is owed to this
|
|
88
|
+
// notification — and the address bar kept the location that the guard refused.
|
|
89
|
+
//
|
|
90
|
+
// The bridge is written against a notification for each change of the SNAPSHOT,
|
|
91
|
+
// and not for each change of the derived string, so the comparison has to answer
|
|
92
|
+
// "different" always. A consumer that reads the value pays nothing for it: the
|
|
93
|
+
// derivation still runs one time for each transition, and `state` itself compares
|
|
94
|
+
// with `Object.is`, so an event that XState ignores delivers the identical
|
|
95
|
+
// snapshot and propagates nothing.
|
|
96
|
+
compare: () => false,
|
|
97
|
+
});
|
|
36
98
|
/**
|
|
37
99
|
* The route of the initial state of the machine. The construction fixes it, and it
|
|
38
100
|
* never changes, also when the code restores the actor from a snapshot.
|
package/dist/with-routing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-routing.js","sourceRoot":"","sources":["../src/with-routing.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"with-routing.js","sourceRoot":"","sources":["../src/with-routing.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKlD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,WAAW,CAC1B,IAAiC;IAEjC,MAAM,aAAc,SAAQ,IAAI;QAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA4BG;QACa,YAAY,GAAgC,UAAU,CACrE,CAAC,QAAQ,EAAiB,EAAE;YAC3B,IAAI,CAAC;gBACJ,OAAO,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,C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AACrE,EAAE;AACF,oEAAoE;AACpE,+EAA+E;AAC/E,iFAAiF;AACjF,qFAAqF;AACrF,kFAAkF;AAClF,oFAAoF;AACpF,WAAW;AACX,EAAE;AACF,gFAAgF;AAChF,+BAA+B;AAC/B,OAAO,EACN,WAAW,EACX,eAAe,EACf,aAAa,EACb,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC"}
|
package/dist/with-view.d.ts
CHANGED
|
@@ -27,13 +27,28 @@
|
|
|
27
27
|
import type { AnyStateMachine } from "xstate";
|
|
28
28
|
import { type Viewable } from "@xmachines/play-view";
|
|
29
29
|
import type { PlayerConstructor } from "./capabilities.js";
|
|
30
|
+
/**
|
|
31
|
+
* Two WeakMaps stood here, and the derivation below needs neither.
|
|
32
|
+
*
|
|
33
|
+
* `lastViewSnapshots` skipped the derivation for a snapshot that the pipeline read
|
|
34
|
+
* already, because XState notifies each observer on EVERY event that it processes and an
|
|
35
|
+
* event that it ignores delivers the identical snapshot again. A computed atom answers
|
|
36
|
+
* that by itself: `state.set(snapshot)` compares with `Object.is`, an identical reference
|
|
37
|
+
* therefore propagates nothing, and this atom stays valid.
|
|
38
|
+
*
|
|
39
|
+
* `lastEmittedViews` held the previous emission for the equality gate, because a read of
|
|
40
|
+
* `currentView` would have registered it as a dependency of the computation around the
|
|
41
|
+
* call and `@xstate/store` exports no `untrack`. The `previous` parameter of a computed
|
|
42
|
+
* atom is that same value, and the engine hands it in rather than tracking a read.
|
|
43
|
+
*/
|
|
30
44
|
/**
|
|
31
45
|
* Adds the view capability to an actor class.
|
|
32
46
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
47
|
+
* The ORDER of the composition does not matter. `currentView` and `currentRoute` are two
|
|
48
|
+
* computed atoms over `state`, and neither reads the other, so the engine evaluates both
|
|
49
|
+
* from one write in topological order. An earlier release wrote `currentView` from an
|
|
50
|
+
* `onSnapshot` override, and the order then decided which capability held its new value
|
|
51
|
+
* first.
|
|
37
52
|
*
|
|
38
53
|
* @param Base - The actor class to extend, normally `PlayerActor` or the result of
|
|
39
54
|
* another capability.
|
package/dist/with-view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-view.d.ts","sourceRoot":"","sources":["../src/with-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"with-view.d.ts","sourceRoot":"","sources":["../src/with-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAI9C,OAAO,EAAqC,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAsC3D;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,SAAS,eAAe,EACxD,IAAI,EAAE,iBAAiB,CAAC,QAAQ,CAAC,GAC/B,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAuFvC"}
|
package/dist/with-view.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createAtom } from "@xmachines/play-atom";
|
|
2
2
|
import { shallowEqualExcept } from "@xmachines/play";
|
|
3
3
|
import { reuseComposedState } from "@xmachines/play-view";
|
|
4
4
|
import { toError } from "./player-actor.js";
|
|
@@ -46,27 +46,27 @@ const viewSpecsEquivalent = (a, b) => {
|
|
|
46
46
|
return true;
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Two WeakMaps stood here, and the derivation below needs neither.
|
|
50
50
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
51
|
+
* `lastViewSnapshots` skipped the derivation for a snapshot that the pipeline read
|
|
52
|
+
* already, because XState notifies each observer on EVERY event that it processes and an
|
|
53
|
+
* event that it ignores delivers the identical snapshot again. A computed atom answers
|
|
54
|
+
* that by itself: `state.set(snapshot)` compares with `Object.is`, an identical reference
|
|
55
|
+
* therefore propagates nothing, and this atom stays valid.
|
|
55
56
|
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* the construction has the same reference as the snapshot that `start()` replays.
|
|
57
|
+
* `lastEmittedViews` held the previous emission for the equality gate, because a read of
|
|
58
|
+
* `currentView` would have registered it as a dependency of the computation around the
|
|
59
|
+
* call and `@xstate/store` exports no `untrack`. The `previous` parameter of a computed
|
|
60
|
+
* atom is that same value, and the engine hands it in rather than tracking a read.
|
|
61
61
|
*/
|
|
62
|
-
const lastViewSnapshots = new WeakMap();
|
|
63
62
|
/**
|
|
64
63
|
* Adds the view capability to an actor class.
|
|
65
64
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
65
|
+
* The ORDER of the composition does not matter. `currentView` and `currentRoute` are two
|
|
66
|
+
* computed atoms over `state`, and neither reads the other, so the engine evaluates both
|
|
67
|
+
* from one write in topological order. An earlier release wrote `currentView` from an
|
|
68
|
+
* `onSnapshot` override, and the order then decided which capability held its new value
|
|
69
|
+
* first.
|
|
70
70
|
*
|
|
71
71
|
* @param Base - The actor class to extend, normally `PlayerActor` or the result of
|
|
72
72
|
* another capability.
|
|
@@ -74,14 +74,14 @@ const lastViewSnapshots = new WeakMap();
|
|
|
74
74
|
export function withView(Base) {
|
|
75
75
|
class ViewableActor extends Base {
|
|
76
76
|
/**
|
|
77
|
-
* The reactive
|
|
77
|
+
* The reactive atom of the current view spec. The atom derives the spec from the
|
|
78
78
|
* `meta.view` metadata of the active state.
|
|
79
79
|
*
|
|
80
80
|
* It emits a **new object reference** on each real change of the view on the screen:
|
|
81
81
|
* the view of a different state, or a change of a param or of the context that changes
|
|
82
82
|
* the resolved spec. A re-entry with `reenter: true` and new params also changes the
|
|
83
83
|
* spec. A snapshot that changes no view on the screen, such as an assign of the
|
|
84
|
-
* context alone, keeps the previous reference. A provider below the
|
|
84
|
+
* context alone, keeps the previous reference. A provider below the atom therefore
|
|
85
85
|
* mounts the UI again not on every event.
|
|
86
86
|
*
|
|
87
87
|
* The `PlaySpec` of the emission carries the context of the machine in its composed
|
|
@@ -90,60 +90,68 @@ export function withView(Base) {
|
|
|
90
90
|
* (`{ $state: "/context/params/section" }`). The context-projection module of
|
|
91
91
|
* `@xmachines/play-view` holds the complete contract.
|
|
92
92
|
*
|
|
93
|
-
* The
|
|
93
|
+
* The atom returns `null` when the current state has no `meta.view` metadata.
|
|
94
94
|
*
|
|
95
95
|
* Two states can declare two separate `meta.view` literals with an identical
|
|
96
96
|
* structure. A transition between those two states then emits two different
|
|
97
97
|
* references, and a provider mounts the UI again. Move the shared literal into one
|
|
98
98
|
* `typedSpec` constant, and the identity then removes the duplicate.
|
|
99
|
-
*/
|
|
100
|
-
currentView = new Signal.State(null);
|
|
101
|
-
onSnapshot(snapshot) {
|
|
102
|
-
// FIRST, so that every capability composed before this one holds its new value.
|
|
103
|
-
super.onSnapshot(snapshot);
|
|
104
|
-
this.validateAndCacheView(snapshot);
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Derives the view at the entry of a state, and keeps it. This happens one time for
|
|
108
|
-
* each transition. The signal holds the view, and the code computes it not on each
|
|
109
|
-
* read.
|
|
110
99
|
*
|
|
111
|
-
*
|
|
100
|
+
* It is a COMPUTED atom over `state`, and not a written one. One write for each
|
|
101
|
+
* transition therefore reaches the whole actor — `state.set(snapshot)` — and the
|
|
102
|
+
* engine evaluates this atom and `currentRoute` in one propagation, in topological
|
|
103
|
+
* order. A second write would flush a second time, and an observer that reads two
|
|
104
|
+
* atoms would see the new state beside the old view in between.
|
|
112
105
|
*/
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
106
|
+
currentView = createAtom((previous) => {
|
|
107
|
+
// `previous` is the value that this atom holds already. The engine hands it in,
|
|
108
|
+
// so the gate below reads it without a `get()`, and it therefore registers
|
|
109
|
+
// `currentView` as a dependency of nothing.
|
|
110
|
+
const lastEmittedView = previous ?? null;
|
|
118
111
|
try {
|
|
119
|
-
const view = deriveCurrentView(
|
|
112
|
+
const view = deriveCurrentView(this.state.get());
|
|
120
113
|
// Emit only after a real change of the view on the screen: deriveCurrentView
|
|
121
|
-
// returns a fresh object on each call, and the identity of the reference
|
|
122
|
-
// tells nothing. A new reference for a snapshot that changes the view
|
|
123
|
-
// example a context-only assign, makes a provider below mount the UI
|
|
124
|
-
// that removes the state of the view. A deep equality test is
|
|
125
|
-
// here: it sees nothing inside a Map or a Set, and it
|
|
126
|
-
// change, and it recurses without an end on a cyclic
|
|
127
|
-
//
|
|
128
|
-
//
|
|
129
|
-
|
|
130
|
-
//
|
|
131
|
-
// /context projection did not change. A context-only assign that changes no
|
|
132
|
-
// projected value therefore changes the identity of the state not.
|
|
114
|
+
// returns a fresh object on each call, and the identity of the reference
|
|
115
|
+
// therefore tells nothing. A new reference for a snapshot that changes the view
|
|
116
|
+
// not, for example a context-only assign, makes a provider below mount the UI
|
|
117
|
+
// again, and that removes the state of the view. A deep equality test is
|
|
118
|
+
// deliberately NOT here: it sees nothing inside a Map or a Set, and it
|
|
119
|
+
// therefore stops a real change, and it recurses without an end on a cyclic
|
|
120
|
+
// prop.
|
|
121
|
+
//
|
|
122
|
+
// A return of `lastEmittedView` compares equal under `Object.is`, so the atom
|
|
123
|
+
// notifies no subscriber and the propagation stops here.
|
|
133
124
|
const nextView = reuseComposedState(lastEmittedView, view);
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
this.currentView.set(nextView);
|
|
125
|
+
return viewSpecsEquivalent(lastEmittedView, nextView)
|
|
126
|
+
? lastEmittedView
|
|
127
|
+
: nextView;
|
|
138
128
|
}
|
|
139
129
|
catch (error) {
|
|
130
|
+
// The derivation runs inside the `set` of `state`, which runs inside the XState
|
|
131
|
+
// subscription. A throw that leaves this function therefore leaves that `set`
|
|
132
|
+
// and breaks the transition for every other observer of the actor. Report it,
|
|
133
|
+
// and keep the last valid view.
|
|
134
|
+
//
|
|
135
|
+
// The derivation runs inside the `set` of `state`, and the engine TRACKS every
|
|
136
|
+
// atom that this function reads — the handler of the host included. A report
|
|
137
|
+
// from HERE therefore made whatever that handler reads a dependency of this
|
|
138
|
+
// atom, and an unrelated write of it re-derived and reported again: three
|
|
139
|
+
// reports for one failure. The microtask leaves the evaluation, so the handler
|
|
140
|
+
// reads what it likes and this atom depends on none of it.
|
|
141
|
+
//
|
|
142
|
+
// It leaves the `set` as well, which is what the comment below already needed:
|
|
143
|
+
// a throw from the handler lands on the global handler of the runtime, and it
|
|
144
|
+
// breaks the transition for no other observer of the actor.
|
|
140
145
|
const onError = this.hooks.onError;
|
|
141
146
|
if (onError) {
|
|
142
|
-
|
|
147
|
+
const reported = toError(error);
|
|
148
|
+
queueMicrotask(() => {
|
|
149
|
+
onError(this, reported);
|
|
150
|
+
});
|
|
143
151
|
}
|
|
144
|
-
|
|
152
|
+
return lastEmittedView;
|
|
145
153
|
}
|
|
146
|
-
}
|
|
154
|
+
});
|
|
147
155
|
}
|
|
148
156
|
return ViewableActor;
|
|
149
157
|
}
|
package/dist/with-view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-view.js","sourceRoot":"","sources":["../src/with-view.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"with-view.js","sourceRoot":"","sources":["../src/with-view.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAgC,MAAM,sBAAsB,CAAC;AAExF,OAA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AI,CAAC,KAAK,CAAC,OAAO,CAAC;gBACnC,IAAI,OAAO,EAAE,CAAC;oBACb,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;oBAChC,cAAc,CAAC,GAAG,EAAE;wBACnB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;oBACzB,CAAC,CAAC,CAAC;gBACJ,CAAC;gBACD,OAAO,eAAe,CAAC;YACxB,CAAC;QACF,CAAC,CACD,CAAC;KACF;IAED,OAAO,aAAa,CAAC;AACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmachines/play-xstate",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "XState v5 adapter for Play Architecture",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"actor-model",
|
|
7
|
+
"atoms",
|
|
7
8
|
"play-architecture",
|
|
8
|
-
"signals",
|
|
9
9
|
"state-machine",
|
|
10
10
|
"xstate"
|
|
11
11
|
],
|
|
@@ -57,28 +57,29 @@
|
|
|
57
57
|
"test:coverage": "vitest run --coverage"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@xmachines/play-actor": "
|
|
60
|
+
"@xmachines/play-actor": "5.0.1",
|
|
61
|
+
"@xmachines/play-pattern": "5.0.1"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@testing-library/jest-dom": "^7.0.1",
|
|
64
65
|
"@types/node": "^26.6.2",
|
|
65
66
|
"@xmachines/json-render-core": "^0.20.0-xm.4",
|
|
66
|
-
"@xmachines/play": "
|
|
67
|
-
"@xmachines/play-
|
|
68
|
-
"@xmachines/play-
|
|
69
|
-
"@xmachines/play-view": "
|
|
70
|
-
"oxfmt": "^0.
|
|
71
|
-
"oxlint": "^1.
|
|
67
|
+
"@xmachines/play": "5.0.1",
|
|
68
|
+
"@xmachines/play-atom": "5.0.1",
|
|
69
|
+
"@xmachines/play-router": "5.0.1",
|
|
70
|
+
"@xmachines/play-view": "5.0.1",
|
|
71
|
+
"oxfmt": "^0.70.0",
|
|
72
|
+
"oxlint": "^1.85.0",
|
|
72
73
|
"typescript": "^5.9.3 || ^6.0.3",
|
|
73
74
|
"vite": "^8.3.0",
|
|
74
75
|
"vitest": "^5.0.1",
|
|
75
76
|
"xstate": "^5.33.0"
|
|
76
77
|
},
|
|
77
78
|
"peerDependencies": {
|
|
78
|
-
"@xmachines/play": "
|
|
79
|
-
"@xmachines/play-
|
|
80
|
-
"@xmachines/play-
|
|
81
|
-
"@xmachines/play-view": "
|
|
79
|
+
"@xmachines/play": "5.0.1",
|
|
80
|
+
"@xmachines/play-atom": "5.0.1",
|
|
81
|
+
"@xmachines/play-router": "5.0.1",
|
|
82
|
+
"@xmachines/play-view": "5.0.1",
|
|
82
83
|
"xstate": "^5.33.0"
|
|
83
84
|
},
|
|
84
85
|
"peerDependenciesMeta": {
|