@xmachines/docs 2.0.0 → 2.1.0
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 +11 -13
- package/api/@xmachines/play/README.md +58 -63
- package/api/@xmachines/play/classes/NonNullableError.md +7 -7
- package/api/@xmachines/play/classes/PlayError.md +25 -27
- package/api/@xmachines/play/functions/assertNonNullable.md +17 -17
- package/api/@xmachines/play/type-aliases/PlayEvent.md +26 -25
- package/api/@xmachines/play-actor/README.md +72 -63
- package/api/@xmachines/play-actor/classes/AbstractActor.md +39 -39
- package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +19 -18
- package/api/@xmachines/play-actor/functions/composePlayState.md +9 -8
- package/api/@xmachines/play-actor/functions/createViewStoreLifecycle.md +5 -5
- package/api/@xmachines/play-actor/functions/guardContextWrites.md +27 -25
- package/api/@xmachines/play-actor/functions/refreshContextSubtree.md +12 -11
- package/api/@xmachines/play-actor/functions/reuseComposedState.md +23 -22
- package/api/@xmachines/play-actor/functions/shallowEqualExcept.md +6 -5
- package/api/@xmachines/play-actor/functions/toAtomState.md +16 -14
- package/api/@xmachines/play-actor/functions/typedSpec.md +12 -11
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +17 -15
- package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +15 -14
- package/api/@xmachines/play-actor/interfaces/PlaySpec.md +13 -13
- package/api/@xmachines/play-actor/interfaces/ResolveViewStoreOptions.md +4 -4
- package/api/@xmachines/play-actor/interfaces/Routable.md +4 -4
- package/api/@xmachines/play-actor/interfaces/ViewStoreLifecycle.md +11 -11
- package/api/@xmachines/play-actor/interfaces/ViewStoreResolution.md +7 -7
- package/api/@xmachines/play-actor/interfaces/Viewable.md +9 -9
- package/api/@xmachines/play-actor/variables/CONTEXT_STATE_KEY.md +5 -5
- package/api/@xmachines/play-dom/README.md +119 -85
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +34 -32
- package/api/@xmachines/play-dom/functions/createPlayUI.md +10 -10
- package/api/@xmachines/play-dom/functions/createRenderer.md +21 -17
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +8 -8
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +9 -9
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +9 -9
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +5 -5
- package/api/@xmachines/play-dom-router/README.md +66 -49
- package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +116 -0
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +4 -3
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +16 -14
- package/api/@xmachines/play-dom-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-dom-router/functions/createRouter.md +14 -14
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +25 -26
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +19 -18
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +7 -7
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +18 -17
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +9 -9
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +39 -38
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +7 -7
- package/api/@xmachines/play-react/README.md +63 -54
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -13
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +4 -4
- package/api/@xmachines/play-react/functions/useSignalEffect.md +39 -39
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +4 -4
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +13 -0
- package/api/@xmachines/play-react/variables/ActorProvider.md +9 -8
- package/api/@xmachines/play-react/variables/PlayRenderer.md +5 -4
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +6 -6
- package/api/@xmachines/play-react-router/README.md +37 -28
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +22 -19
- package/api/@xmachines/play-react-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +16 -14
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +7 -6
- package/api/@xmachines/play-router/README.md +94 -82
- package/api/@xmachines/play-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +29 -23
- package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +6 -5
- package/api/@xmachines/play-router/functions/buildRouteTree.md +16 -15
- package/api/@xmachines/play-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +18 -17
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +11 -10
- package/api/@xmachines/play-router/functions/extractQuery.md +3 -3
- package/api/@xmachines/play-router/functions/extractRouteParams.md +22 -19
- package/api/@xmachines/play-router/functions/findRouteById.md +10 -9
- package/api/@xmachines/play-router/functions/findRouteByPath.md +14 -12
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +9 -9
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +9 -9
- package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +16 -15
- package/api/@xmachines/play-router/functions/isRouteReachable.md +12 -11
- package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
- package/api/@xmachines/play-router/functions/routeExists.md +8 -8
- package/api/@xmachines/play-router/functions/sanitizePathname.md +15 -13
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -10
- package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
- package/api/@xmachines/play-router/interfaces/LocationLike.md +9 -9
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +7 -7
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +9 -9
- package/api/@xmachines/play-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +7 -7
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +18 -17
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
- package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
- package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
- package/api/@xmachines/play-router/interfaces/RouteObject.md +6 -6
- package/api/@xmachines/play-router/interfaces/RouteTree.md +11 -11
- package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +13 -13
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-router/interfaces/WindowLike.md +10 -10
- package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +13 -0
- package/api/@xmachines/play-router/type-aliases/MachineGraph.md +4 -3
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
- package/api/@xmachines/play-signals/README.md +38 -36
- package/api/@xmachines/play-signals/functions/watchSignal.md +15 -15
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +6 -6
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +10 -10
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +6 -6
- package/api/@xmachines/play-signals/interfaces/SignalState.md +13 -13
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +18 -18
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +6 -5
- package/api/@xmachines/play-solid/README.md +46 -42
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +3 -3
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +13 -13
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +9 -9
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-solid/variables/ActorContext.md +5 -4
- package/api/@xmachines/play-solid/variables/ActorProvider.md +8 -7
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -4
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +7 -7
- package/api/@xmachines/play-solid-router/README.md +34 -29
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +43 -34
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +15 -13
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +39 -39
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +10 -10
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +5 -5
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +11 -11
- package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +9 -8
- package/api/@xmachines/play-svelte/README.md +40 -31
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +9 -8
- package/api/@xmachines/play-svelte/functions/getActorContext.md +5 -4
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +3 -3
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +17 -15
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +9 -9
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +20 -18
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +12 -11
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-svelte-spa-router/README.md +25 -25
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +133 -0
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +7 -7
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +10 -10
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-sveltekit-router/README.md +38 -34
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +132 -0
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -3
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -6
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +9 -9
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/README.md +66 -48
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +43 -38
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +16 -14
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +18 -18
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +11 -10
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +11 -11
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +16 -11
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +9 -8
- package/api/@xmachines/play-tanstack-router/README.md +37 -17
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +43 -38
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +9 -9
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/README.md +71 -45
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +38 -30
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +11 -11
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +9 -9
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +15 -13
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +7 -7
- package/api/@xmachines/play-vue/README.md +37 -35
- package/api/@xmachines/play-vue/functions/defineRegistry.md +10 -9
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/functions/usePlayView.md +28 -0
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +10 -9
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +13 -12
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +10 -9
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +6 -2
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +2 -2
- package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
- package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-vue/variables/getPlayViewContext.md +34 -0
- package/api/@xmachines/play-vue-router/README.md +65 -56
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +50 -48
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +26 -19
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +12 -11
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +22 -20
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +39 -33
- package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +11 -10
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +27 -24
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +2 -2
- package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +13 -0
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +5 -5
- package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +13 -0
- package/api/@xmachines/play-xstate/README.md +72 -70
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +123 -112
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +19 -16
- package/api/@xmachines/play-xstate/functions/composeGuards.md +25 -23
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +20 -20
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +15 -15
- package/api/@xmachines/play-xstate/functions/definePlayer.md +19 -19
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +26 -25
- package/api/@xmachines/play-xstate/functions/eventMatches.md +8 -8
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +16 -13
- package/api/@xmachines/play-xstate/functions/hasContext.md +8 -8
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +10 -10
- package/api/@xmachines/play-xstate/functions/negateGuard.md +19 -18
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +6 -6
- package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +7 -7
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +10 -10
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -14
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +2 -2
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +5 -5
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +9 -9
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +4 -3
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +7 -7
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +12 -12
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +15 -14
- package/api/@xmachines/shared/README.md +11 -13
- package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
- package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +2 -2
- package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
- package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
- package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
- package/contributing/development.md +28 -0
- package/guides/inspector.md +1 -1
- package/package.json +1 -1
- package/api/@xmachines/play-vue/functions/getPlayViewContext.md +0 -28
|
@@ -6,50 +6,51 @@
|
|
|
6
6
|
type PlayEvent<TPayload> = object & TPayload;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play/src/types.ts:
|
|
9
|
+
Defined in: [packages/play/src/types.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play/src/types.ts#L71)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The generic event type of the Play Architecture
|
|
12
12
|
|
|
13
|
-
PlayEvent
|
|
14
|
-
with a `type` string property.
|
|
15
|
-
Actor
|
|
13
|
+
PlayEvent is the minimal event contract of the Actor communication: it is every
|
|
14
|
+
object with a `type` string property. The infrastructure sends each event to the
|
|
15
|
+
Actor, and the guards of the Actor state machine decide the validity.
|
|
16
16
|
|
|
17
|
-
**
|
|
18
|
-
|
|
17
|
+
**The type parameter:** the generic `TPayload` gives the shape of the event fields
|
|
18
|
+
after `type`. Its default is `Record<string, unknown>`, which accepts each shape.
|
|
19
19
|
|
|
20
|
-
**Architectural
|
|
21
|
-
infrastructure
|
|
22
|
-
|
|
20
|
+
**Architectural context:** the type implements **Passive Infrastructure
|
|
21
|
+
(INV-04)**. The infrastructure converts each user action into an event, and it
|
|
22
|
+
makes no decision. The guards of the Actor state machine decide if each event is
|
|
23
|
+
valid in the current state.
|
|
23
24
|
|
|
24
|
-
**Framework
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
**Framework-agnostic:** this type is generic on purpose, and it is bound to no
|
|
26
|
+
state machine framework. It matches the common event shape of XState, of Robot,
|
|
27
|
+
and of the other state machine libraries.
|
|
27
28
|
|
|
28
|
-
**
|
|
29
|
+
**The common event types:**
|
|
29
30
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
31
|
+
- A domain event: `{ type: 'auth.login', userId: '123' }`
|
|
32
|
+
- Your own event: `{ type: 'form.submit', data: {...} }`
|
|
32
33
|
|
|
33
34
|
## Type Declaration
|
|
34
35
|
|
|
35
36
|
| Name | Type | Defined in |
|
|
36
37
|
| ------ | -------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
37
|
-
| `type` | `string` | [packages/play/src/types.ts:
|
|
38
|
+
| `type` | `string` | [packages/play/src/types.ts:72](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play/src/types.ts#L72) |
|
|
38
39
|
|
|
39
40
|
## Type Parameters
|
|
40
41
|
|
|
41
|
-
| Type Parameter | Default type | Description
|
|
42
|
-
| ---------------------------------------------------- | ------------------------------- |
|
|
43
|
-
| `TPayload` _extends_ `Record`\<`string`, `unknown`\> | `Record`\<`string`, `unknown`\> |
|
|
42
|
+
| Type Parameter | Default type | Description |
|
|
43
|
+
| ---------------------------------------------------- | ------------------------------- | ----------------------------------------------------------------- |
|
|
44
|
+
| `TPayload` _extends_ `Record`\<`string`, `unknown`\> | `Record`\<`string`, `unknown`\> | The fields after `type`. The default is `Record<string, unknown>` |
|
|
44
45
|
|
|
45
46
|
## Examples
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
The use without the type parameter, which is flexible
|
|
48
49
|
|
|
49
50
|
```typescript
|
|
50
51
|
import type { PlayEvent } from "@xmachines/play";
|
|
51
52
|
|
|
52
|
-
//
|
|
53
|
+
// It accepts every event with type: string
|
|
53
54
|
const loginEvent: PlayEvent = {
|
|
54
55
|
type: "auth.login",
|
|
55
56
|
userId: "user123",
|
|
@@ -58,12 +59,12 @@ const loginEvent: PlayEvent = {
|
|
|
58
59
|
actor.send(loginEvent);
|
|
59
60
|
```
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
The use with the type parameter, which is type-safe
|
|
62
63
|
|
|
63
64
|
```typescript
|
|
64
65
|
import type { PlayEvent } from "@xmachines/play";
|
|
65
66
|
|
|
66
|
-
//
|
|
67
|
+
// A type-safe event with a known shape
|
|
67
68
|
type LoginEvent = PlayEvent<{ userId: string; timestamp: number }>;
|
|
68
69
|
|
|
69
70
|
const loginEvent: LoginEvent = {
|
|
@@ -72,7 +73,7 @@ const loginEvent: LoginEvent = {
|
|
|
72
73
|
timestamp: Date.now(),
|
|
73
74
|
};
|
|
74
75
|
|
|
75
|
-
// TypeScript error:
|
|
76
|
+
// A TypeScript error: a necessary field is absent
|
|
76
77
|
const invalid: LoginEvent = { type: "auth.login" }; // Error!
|
|
77
78
|
```
|
|
78
79
|
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Abstract Actor base class for XMachines Play Architecture.
|
|
6
6
|
|
|
7
|
-
[](https://opensource.org/licenses/MIT) [.
|
|
7
|
+
[](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@xmachines/play-actor)
|
|
10
8
|
|
|
11
9
|
## Installation
|
|
12
10
|
|
|
@@ -14,7 +12,7 @@ Part of the [xmachines-js monorepo](../../README.md).
|
|
|
14
12
|
pnpm add @xmachines/play-actor
|
|
15
13
|
```
|
|
16
14
|
|
|
17
|
-
**Peer dependencies
|
|
15
|
+
**Peer dependencies.** Install them with the package:
|
|
18
16
|
|
|
19
17
|
```bash
|
|
20
18
|
pnpm add xstate @xmachines/play @xmachines/play-signals @xmachines/json-render-core
|
|
@@ -22,35 +20,35 @@ pnpm add xstate @xmachines/play @xmachines/play-signals @xmachines/json-render-c
|
|
|
22
20
|
|
|
23
21
|
## Overview
|
|
24
22
|
|
|
25
|
-
`@xmachines/play-actor`
|
|
23
|
+
`@xmachines/play-actor` gives you `AbstractActor`, a minimal base class. The class extends the XState `Actor` class, and it enforces the **signal protocol** of the Play Architecture (RFC section 5.3). It exposes reactive TC39 Signals for the infrastructure layer. It also keeps the complete compatibility with the XState ecosystem, which includes the devtools and the inspection.
|
|
26
24
|
|
|
27
|
-
The core protocol is
|
|
25
|
+
The core protocol is small on purpose:
|
|
28
26
|
|
|
29
27
|
| Property | Type | Description |
|
|
30
28
|
| -------- | ------------------------- | ---------------------------------------- |
|
|
31
29
|
| `state` | `Signal.State<unknown>` | Reactive snapshot of current actor state |
|
|
32
30
|
| `send` | `(event: TEvent) => void` | Event dispatch method |
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
Separate interfaces declare the optional capabilities. A concrete actor implements only the interfaces that it needs:
|
|
35
33
|
|
|
36
34
|
| Interface | Property | Description |
|
|
37
35
|
| ---------- | ----------------------------------------------- | ------------------------------------- |
|
|
38
36
|
| `Routable` | `currentRoute: Signal.Computed<string \| null>` | Current route path derived from state |
|
|
39
|
-
| `Routable` | `initialRoute: string \| null` |
|
|
37
|
+
| `Routable` | `initialRoute: string \| null` | The route where the actor starts |
|
|
40
38
|
| `Viewable` | `currentView: Signal.State<PlaySpec \| null>` | Current JSON-render view spec |
|
|
41
39
|
|
|
42
|
-
|
|
40
|
+
An adapter, such as [`@xmachines/play-xstate`](../play-xstate/README.md), makes the concrete implementations.
|
|
43
41
|
|
|
44
42
|
## API Summary
|
|
45
43
|
|
|
46
44
|
### `AbstractActor<TLogic, TEvent>`
|
|
47
45
|
|
|
48
|
-
|
|
46
|
+
The abstract base class extends the XState `Actor<TLogic>` class.
|
|
49
47
|
|
|
50
|
-
A subclass **is** the actor
|
|
51
|
-
instance holds the running machine
|
|
52
|
-
prototype
|
|
53
|
-
TypeScript forbids `super`
|
|
48
|
+
A subclass **is** the actor. Give the logic and its options to `super()`, so that one
|
|
49
|
+
instance holds the running machine. Reach the `send` method of XState through the
|
|
50
|
+
prototype. This class declares `send` as abstract for one reason only: to narrow the
|
|
51
|
+
event type. TypeScript forbids a `super` call to an abstract member.
|
|
54
52
|
|
|
55
53
|
```ts
|
|
56
54
|
import { AbstractActor } from "@xmachines/play-actor";
|
|
@@ -77,6 +75,7 @@ class MyActor extends AbstractActor<AnyActorLogic> {
|
|
|
77
75
|
With a typed event union:
|
|
78
76
|
|
|
79
77
|
```ts
|
|
78
|
+
// imports as in the previous example
|
|
80
79
|
type AuthEvent = { type: "auth.login"; username: string } | { type: "auth.logout" };
|
|
81
80
|
|
|
82
81
|
class AuthActor extends AbstractActor<AnyActorLogic, AuthEvent> {
|
|
@@ -90,9 +89,10 @@ class AuthActor extends AbstractActor<AnyActorLogic, AuthEvent> {
|
|
|
90
89
|
|
|
91
90
|
### `typedSpec(spec)`
|
|
92
91
|
|
|
93
|
-
|
|
94
|
-
`meta` field
|
|
95
|
-
|
|
92
|
+
This identity helper gives a view-spec literal the type `PlaySpec` at the definition site. The
|
|
93
|
+
XState `meta` field has the type `Record<string, unknown>`. Therefore this helper is the place
|
|
94
|
+
where the spec shape receives the compile-time check and the IDE autocomplete. The helper has no
|
|
95
|
+
cost at run time.
|
|
96
96
|
|
|
97
97
|
```ts
|
|
98
98
|
import { typedSpec } from "@xmachines/play-actor";
|
|
@@ -114,28 +114,33 @@ meta: {
|
|
|
114
114
|
|
|
115
115
|
### `PlaySpec`
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
through the ordinary `{ $state: "/context/…" }` grammar
|
|
120
|
-
`repeat.statePath
|
|
121
|
-
|
|
122
|
-
`/context` is read-only by design
|
|
123
|
-
|
|
124
|
-
send
|
|
125
|
-
`spec.state
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
`/context/username`
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
context is
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
117
|
+
This type extends the `Spec` type of `@xmachines/json-render-core`. Each derived view receives
|
|
118
|
+
the complete machine context in its state store, under the read-only **`/context` subtree**. A
|
|
119
|
+
spec therefore reads the context through the ordinary `{ $state: "/context/…" }` grammar: in a
|
|
120
|
+
prop, in a `visible` condition, and in `repeat.statePath`.
|
|
121
|
+
|
|
122
|
+
`/context` is read-only by design. Nothing can write to it. The machine context changes through
|
|
123
|
+
an event only. A `$bindState` write or a `setState` write under `/context` throws an error, and
|
|
124
|
+
the error names the event to send. This is the model: the bindable ephemeral state is at the
|
|
125
|
+
root of the store, from `spec.state`; the domain state is in the machine, and it changes through
|
|
126
|
+
events that are meaningful and easy to inspect.
|
|
127
|
+
|
|
128
|
+
The path shows the origin of each value. `/context/params/username` comes from the URL.
|
|
129
|
+
`/context/username` belongs to the machine. One value can never hide the other.
|
|
130
|
+
|
|
131
|
+
The model projects everything, and this has two consequences. The first consequence is
|
|
132
|
+
**exposure**. The complete context is visible to the client in the view store, which includes a
|
|
133
|
+
debug panel, an inspector, and a validator. The context is a client-side value in each case, so
|
|
134
|
+
keep a secret out of it.
|
|
135
|
+
|
|
136
|
+
The second consequence is **emission granularity**. The emit gate compares the context field by
|
|
137
|
+
field, at the top level only. Therefore an event that changes any field emits the view again
|
|
138
|
+
with the same `viewKey`. A provider refreshes `/context` in the live store, and it does not seed
|
|
139
|
+
the store again. The component does not remount, and the ephemeral view state and the focus
|
|
140
|
+
stay. However, a new emission is still a render pass in the framework layer. Keep
|
|
141
|
+
high-frequency ephemeral data, such as a draft for each keystroke or a timer, in the view store
|
|
142
|
+
(`spec.state` with `$bindState`) or in a child actor. The domain state belongs in the context. A
|
|
143
|
+
keystroke does not.
|
|
139
144
|
|
|
140
145
|
```ts
|
|
141
146
|
import type { PlaySpec } from "@xmachines/play-actor";
|
|
@@ -152,31 +157,33 @@ const spec: PlaySpec = {
|
|
|
152
157
|
};
|
|
153
158
|
```
|
|
154
159
|
|
|
155
|
-
> Historical note: earlier
|
|
156
|
-
> prop-enrichment pass
|
|
157
|
-
>
|
|
158
|
-
> let
|
|
159
|
-
> projection filter
|
|
160
|
-
>
|
|
161
|
-
>
|
|
162
|
-
>
|
|
160
|
+
> Historical note: an earlier version had a `contextProps` field. At first the field drove an
|
|
161
|
+
> implicit prop-enrichment pass. That pass merged the allowlisted context fields and the URL
|
|
162
|
+
> params into the props of every element. We removed it, because it put values into components
|
|
163
|
+
> that never asked for them, and it let URL data from the user hide machine-owned state. The
|
|
164
|
+
> field was then a projection filter for a short time. We removed that filter too, because a
|
|
165
|
+
> limit on what a view can read added machinery without a real problem to solve. Always
|
|
166
|
+
> validate the **derived** view (`actor.currentView.get()`), not the raw `meta.view`. The
|
|
167
|
+
> `state` of the derived spec carries the projection, so a tool such as `validateSpec` sees a
|
|
168
|
+
> spec that is consistent with itself.
|
|
163
169
|
|
|
164
170
|
### `Routable`
|
|
165
171
|
|
|
166
172
|
Interface for actors that support routing.
|
|
167
173
|
|
|
168
174
|
```ts
|
|
169
|
-
import type
|
|
175
|
+
import { AbstractActor, type Routable } from "@xmachines/play-actor";
|
|
170
176
|
import { Signal } from "@xmachines/play-signals";
|
|
177
|
+
import type { AnyActorLogic, EventObject } from "xstate";
|
|
171
178
|
|
|
172
179
|
// Implement in a concrete actor (note: RoutableActor interface is exported from @xmachines/play-router):
|
|
173
180
|
class MyRoutableActor extends AbstractActor<AnyActorLogic> implements Routable {
|
|
174
|
-
state = new Signal.State({});
|
|
175
|
-
currentRoute = new Signal.Computed(() => this.state.get().path ?? null);
|
|
181
|
+
state = new Signal.State<{ path?: string }>({});
|
|
182
|
+
currentRoute = new Signal.Computed<string | null>(() => this.state.get().path ?? null);
|
|
176
183
|
initialRoute = "/";
|
|
177
|
-
send
|
|
184
|
+
override send(event: EventObject): void {
|
|
178
185
|
/* dispatch */
|
|
179
|
-
}
|
|
186
|
+
}
|
|
180
187
|
}
|
|
181
188
|
```
|
|
182
189
|
|
|
@@ -196,7 +203,7 @@ const viewable: Viewable = { currentView: signal };
|
|
|
196
203
|
|
|
197
204
|
### `BaseActorProviderProps<TRegistry>`
|
|
198
205
|
|
|
199
|
-
|
|
206
|
+
The framework-agnostic base props. Every `ActorProvider` implementation shares them: React, Vue, Solid, and Svelte. Each framework renderer package extends this interface.
|
|
200
207
|
|
|
201
208
|
```ts
|
|
202
209
|
import type { BaseActorProviderProps } from "@xmachines/play-actor";
|
|
@@ -210,7 +217,7 @@ interface ActorProviderProps extends BaseActorProviderProps<DefineRegistryResult
|
|
|
210
217
|
|
|
211
218
|
### `BaseViewContextValue<TRegistry>`
|
|
212
219
|
|
|
213
|
-
|
|
220
|
+
The framework-agnostic base of the `ViewContextValue` type in each framework. It holds the `spec`, `handlers`, `registry`, and `store` fields. These fields are identical in React, Vue, Solid, and Svelte.
|
|
214
221
|
|
|
215
222
|
## Testing
|
|
216
223
|
|
|
@@ -233,19 +240,21 @@ pnpm --filter @xmachines/play-actor run test:watch
|
|
|
233
240
|
- **TypeScript** `>=5.7` (strict mode)
|
|
234
241
|
- **ESM only** — `"type": "module"`
|
|
235
242
|
|
|
236
|
-
@xmachines/play-actor -
|
|
243
|
+
@xmachines/play-actor - the abstract Actor base class of the Play Architecture
|
|
237
244
|
|
|
238
|
-
This package
|
|
239
|
-
|
|
245
|
+
This package gives you AbstractActor, a minimal base class. It extends the XState
|
|
246
|
+
Actor class, and it enforces the signal protocol of the Play Architecture (RFC
|
|
247
|
+
section 5.3).
|
|
240
248
|
|
|
241
|
-
The core protocol is minimal
|
|
242
|
-
|
|
249
|
+
The core protocol is minimal: state and send. Two interfaces give the optional
|
|
250
|
+
capabilities:
|
|
243
251
|
|
|
244
|
-
- Routable:
|
|
245
|
-
- Viewable:
|
|
252
|
+
- Routable: for an actor with a routing support
|
|
253
|
+
- Viewable: for an actor with a view rendering
|
|
246
254
|
|
|
247
|
-
|
|
248
|
-
reactive signals
|
|
255
|
+
The class keeps the compatibility with the XState ecosystem, such as the
|
|
256
|
+
inspection and the devtools. It also exposes the reactive signals of the
|
|
257
|
+
communication with the infrastructure layer.
|
|
249
258
|
|
|
250
259
|
## See
|
|
251
260
|
|
|
@@ -2,21 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
# Abstract Class: AbstractActor\<TLogic, TEvent\>
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-actor/src/abstract-actor.ts:
|
|
5
|
+
Defined in: [packages/play-actor/src/abstract-actor.ts:197](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L197)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The abstract base class of an actor of the Play Architecture.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
It observes the state through the signals, and it works with the tools of the
|
|
10
|
+
XState ecosystem, such as the devtools and the inspection. It also exposes the
|
|
11
|
+
reactive signals of the communication with the infrastructure layer.
|
|
12
12
|
|
|
13
|
-
**A subclass IS the actor.**
|
|
14
|
-
`super(logic, options)`, then observe `this`.
|
|
15
|
-
|
|
16
|
-
actor,
|
|
17
|
-
internal `_send` that receives
|
|
18
|
-
|
|
19
|
-
forwarded.
|
|
13
|
+
**A subclass IS the actor.** Give the logic _and_ its options to
|
|
14
|
+
`super(logic, options)`, then observe `this`. A separate actor beside this
|
|
15
|
+
instance leaves this instance as an empty second actor. Every inherited member
|
|
16
|
+
then answers from that empty actor, until you forward each one: `system`,
|
|
17
|
+
`sessionId`, `clock`, the internal `_send` that receives the traffic of
|
|
18
|
+
`sendTo()`, and each member that a later XState version adds.
|
|
20
19
|
|
|
21
20
|
## Extends
|
|
22
21
|
|
|
@@ -28,10 +27,10 @@ forwarded.
|
|
|
28
27
|
|
|
29
28
|
## Type Parameters
|
|
30
29
|
|
|
31
|
-
| Type Parameter | Default type | Description
|
|
32
|
-
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
33
|
-
| `TLogic` _extends_ [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | XState actor logic
|
|
34
|
-
| `TEvent` _extends_ [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject) | [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject) |
|
|
30
|
+
| Type Parameter | Default type | Description |
|
|
31
|
+
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------ |
|
|
32
|
+
| `TLogic` _extends_ [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | The type of the XState actor logic |
|
|
33
|
+
| `TEvent` _extends_ [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject) | [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject) | The constraint of the event type. The default is EventObject |
|
|
35
34
|
|
|
36
35
|
## Constructors
|
|
37
36
|
|
|
@@ -65,19 +64,19 @@ Actor<TLogic>.constructor
|
|
|
65
64
|
|
|
66
65
|
## Properties
|
|
67
66
|
|
|
68
|
-
| Property | Modifier | Type | Description
|
|
69
|
-
| ------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
70
|
-
| <a id="property-_parent"></a> `_parent?` | `public` | [`AnyActorRef`](https://www.jsdocs.io/package/xstate#AnyActorRef) | -
|
|
71
|
-
| <a id="property-clock"></a> `clock` | `public` | [`Clock`](https://www.jsdocs.io/package/xstate#Clock) | The clock that is responsible for setting and clearing timeouts, such as delayed events and transitions.
|
|
72
|
-
| <a id="property-id"></a> `id` | `public` | `string` | The unique identifier for this actor relative to its parent.
|
|
73
|
-
| <a id="property-logic"></a> `logic` | `public` | `TLogic` | -
|
|
74
|
-
| <a id="property-options"></a> `options` | `public` | `Readonly`\<[`ActorOptions`](https://www.jsdocs.io/package/xstate#ActorOptions)\<`TLogic`\>\> | -
|
|
75
|
-
| <a id="property-ref"></a> `ref` | `public` | [`ActorRef`](https://www.jsdocs.io/package/xstate#ActorRef)\<[`SnapshotFrom`](https://www.jsdocs.io/package/xstate#SnapshotFrom)\<`TLogic`\>, [`EventFromLogic`](https://www.jsdocs.io/package/xstate#EventFromLogic)\<`TLogic`\>, [`EmittedFrom`](https://www.jsdocs.io/package/xstate#EmittedFrom)\<`TLogic`\>\> | -
|
|
76
|
-
| <a id="property-sessionid"></a> `sessionId` | `public` | `string` | The globally unique process ID for this invocation.
|
|
77
|
-
| <a id="property-src"></a> `src` | `public` | \| `string` \| [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | -
|
|
78
|
-
| <a id="property-state"></a> `state` | `abstract` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<`unknown`\> |
|
|
79
|
-
| <a id="property-system"></a> `system` | `public` | [`AnyActorSystem`](https://www.jsdocs.io/package/xstate#AnyActorSystem) | The system to which this actor belongs.
|
|
80
|
-
| <a id="property-systemid"></a> `systemId` | `public` | `string` \| `undefined` | -
|
|
67
|
+
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
68
|
+
| ------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
69
|
+
| <a id="property-_parent"></a> `_parent?` | `public` | [`AnyActorRef`](https://www.jsdocs.io/package/xstate#AnyActorRef) | - | `Actor._parent` | - |
|
|
70
|
+
| <a id="property-clock"></a> `clock` | `public` | [`Clock`](https://www.jsdocs.io/package/xstate#Clock) | The clock that is responsible for setting and clearing timeouts, such as delayed events and transitions. | `Actor.clock` | - |
|
|
71
|
+
| <a id="property-id"></a> `id` | `public` | `string` | The unique identifier for this actor relative to its parent. | `Actor.id` | - |
|
|
72
|
+
| <a id="property-logic"></a> `logic` | `public` | `TLogic` | - | `Actor.logic` | - |
|
|
73
|
+
| <a id="property-options"></a> `options` | `public` | `Readonly`\<[`ActorOptions`](https://www.jsdocs.io/package/xstate#ActorOptions)\<`TLogic`\>\> | - | `Actor.options` | - |
|
|
74
|
+
| <a id="property-ref"></a> `ref` | `public` | [`ActorRef`](https://www.jsdocs.io/package/xstate#ActorRef)\<[`SnapshotFrom`](https://www.jsdocs.io/package/xstate#SnapshotFrom)\<`TLogic`\>, [`EventFromLogic`](https://www.jsdocs.io/package/xstate#EventFromLogic)\<`TLogic`\>, [`EmittedFrom`](https://www.jsdocs.io/package/xstate#EmittedFrom)\<`TLogic`\>\> | - | `Actor.ref` | - |
|
|
75
|
+
| <a id="property-sessionid"></a> `sessionId` | `public` | `string` | The globally unique process ID for this invocation. | `Actor.sessionId` | - |
|
|
76
|
+
| <a id="property-src"></a> `src` | `public` | \| `string` \| [`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic) | - | `Actor.src` | - |
|
|
77
|
+
| <a id="property-state"></a> `state` | `abstract` | [`State`](../../play-signals/namespaces/Signal/classes/State.md)\<`unknown`\> | The reactive snapshot of the current actor state. The infrastructure observes this signal, and it reacts to each state change. It therefore holds no coupling to the internal state machine of the actor. | - | [packages/play-actor/src/abstract-actor.ts:207](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L207) |
|
|
78
|
+
| <a id="property-system"></a> `system` | `public` | [`AnyActorSystem`](https://www.jsdocs.io/package/xstate#AnyActorSystem) | The system to which this actor belongs. | `Actor.system` | - |
|
|
79
|
+
| <a id="property-systemid"></a> `systemId` | `public` | `string` \| `undefined` | - | `Actor.systemId` | - |
|
|
81
80
|
|
|
82
81
|
## Methods
|
|
83
82
|
|
|
@@ -246,19 +245,20 @@ Actor.select;
|
|
|
246
245
|
abstract send(event): void;
|
|
247
246
|
```
|
|
248
247
|
|
|
249
|
-
Defined in: [packages/play-actor/src/abstract-actor.ts:
|
|
248
|
+
Defined in: [packages/play-actor/src/abstract-actor.ts:223](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/abstract-actor.ts#L223)
|
|
250
249
|
|
|
251
|
-
|
|
250
|
+
Sends an event to the Actor.
|
|
252
251
|
|
|
253
|
-
|
|
252
|
+
The constraint is TEvent, which gives the type safety of a concrete
|
|
253
|
+
implementation.
|
|
254
254
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
`
|
|
260
|
-
|
|
261
|
-
|
|
255
|
+
A note for an implementation that wraps `send`, to check the event or to notify a
|
|
256
|
+
hook around it: this declaration is abstract for one reason only, to narrow the
|
|
257
|
+
event type, and TypeScript forbids a `super` call to an abstract member. Reach
|
|
258
|
+
the implementation of XState with `Actor.prototype.send.call(this, event)`
|
|
259
|
+
instead. A concrete declaration permits `super.send()`, but it also forces an
|
|
260
|
+
`override` modifier in every subclass that exists now, and that is a breaking
|
|
261
|
+
change for an adapter outside this repository.
|
|
262
262
|
|
|
263
263
|
#### Parameters
|
|
264
264
|
|
|
@@ -6,35 +6,36 @@
|
|
|
6
6
|
function attachRenderErrorHandler<TRegistry>(registry, handler): TRegistry;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-actor/src/provider-guards.ts:
|
|
9
|
+
Defined in: [packages/play-actor/src/provider-guards.ts:68](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/provider-guards.ts#L68)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Copies a component registry, and puts an `onRenderError` handler into the copy.
|
|
12
12
|
|
|
13
|
-
The
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
The function defines the handler as an own property of the copy. That property is
|
|
14
|
+
not enumerable, and it is configurable (D-19 gives one convention of the
|
|
15
|
+
injection for every framework renderer). The handler therefore replaces each
|
|
16
|
+
handler of the `defineRegistry` level, and it does not appear in an enumeration of
|
|
17
|
+
the component entries of the registry.
|
|
17
18
|
|
|
18
|
-
The
|
|
19
|
-
that
|
|
20
|
-
`
|
|
21
|
-
providers
|
|
19
|
+
The function never changes the registry of the caller: it returns a shallow copy.
|
|
20
|
+
Therefore a caller that needs a handler for each instance, such as an
|
|
21
|
+
`onRenderError` prop of `ActorProvider`, can share one result of `defineRegistry`
|
|
22
|
+
between the providers in a safe way.
|
|
22
23
|
|
|
23
24
|
## Type Parameters
|
|
24
25
|
|
|
25
|
-
| Type Parameter | Description
|
|
26
|
-
| ------------------------------ |
|
|
27
|
-
| `TRegistry` _extends_ `object` | The
|
|
26
|
+
| Type Parameter | Description |
|
|
27
|
+
| ------------------------------ | --------------------------------------------- |
|
|
28
|
+
| `TRegistry` _extends_ `object` | The component registry type of the framework. |
|
|
28
29
|
|
|
29
30
|
## Parameters
|
|
30
31
|
|
|
31
|
-
| Parameter | Type | Description
|
|
32
|
-
| ---------- | ------------------------------------------------------------------------- |
|
|
33
|
-
| `registry` | `TRegistry` | The component registry from `defineRegistry().registry`.
|
|
34
|
-
| `handler` | [`RenderErrorHandler`](../../play-dom/type-aliases/RenderErrorHandler.md) |
|
|
32
|
+
| Parameter | Type | Description |
|
|
33
|
+
| ---------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
34
|
+
| `registry` | `TRegistry` | The component registry from `defineRegistry().registry`. |
|
|
35
|
+
| `handler` | [`RenderErrorHandler`](../../play-dom/type-aliases/RenderErrorHandler.md) | The renderer calls it with `(error, componentName)` when a catalog component throws during a render. |
|
|
35
36
|
|
|
36
37
|
## Returns
|
|
37
38
|
|
|
38
39
|
`TRegistry`
|
|
39
40
|
|
|
40
|
-
A shallow
|
|
41
|
+
A shallow copy of `registry`, with `onRenderError` on it.
|
|
@@ -6,20 +6,21 @@
|
|
|
6
6
|
function composePlayState(authoredState, slice): Record<string, unknown> | undefined;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-actor/src/context-projection.ts:
|
|
9
|
+
Defined in: [packages/play-actor/src/context-projection.ts:228](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-actor/src/context-projection.ts#L228)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Composes the effective state of a view: the authored `spec.state` and the
|
|
12
12
|
`/context` slice.
|
|
13
13
|
|
|
14
|
-
When the authored state
|
|
15
|
-
|
|
14
|
+
When the authored state declares the reserved key already, the function skips the
|
|
15
|
+
projection, the authored state wins, and the code writes a warning in
|
|
16
|
+
development. No spec that exists now therefore fails.
|
|
16
17
|
|
|
17
18
|
## Parameters
|
|
18
19
|
|
|
19
|
-
| Parameter | Type | Description
|
|
20
|
-
| --------------- | ---------------------------------------------- |
|
|
21
|
-
| `authoredState` | `Record`\<`string`, `unknown`\> \| `undefined` | The raw `meta.view.state`
|
|
22
|
-
| `slice` | `Record`\<`string`, `unknown`\> \| `undefined` | The machine
|
|
20
|
+
| Parameter | Type | Description |
|
|
21
|
+
| --------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
22
|
+
| `authoredState` | `Record`\<`string`, `unknown`\> \| `undefined` | The raw `meta.view.state` value. It can be anything, and the caller or toAtomState cleans it. |
|
|
23
|
+
| `slice` | `Record`\<`string`, `unknown`\> \| `undefined` | The context of the machine, as one complete value. |
|
|
23
24
|
|
|
24
25
|
## Returns
|
|
25
26
|
|