@xmachines/docs 2.2.0 → 4.0.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 +8 -16
- package/api/@xmachines/play/README.md +75 -97
- package/api/@xmachines/play/errors/README.md +8 -0
- package/api/@xmachines/play/{classes → errors/classes}/NonNullableError.md +6 -6
- package/api/@xmachines/play/{classes → errors/classes}/PlayError.md +35 -10
- package/api/@xmachines/play/index/README.md +75 -0
- package/api/@xmachines/play/index/functions/asCleanup.md +78 -0
- package/api/@xmachines/play/{functions → index/functions}/assertNonNullable.md +2 -2
- package/api/@xmachines/{play-actor → play/index}/functions/shallowEqualExcept.md +3 -3
- package/api/@xmachines/play/index/type-aliases/Cleanup.md +38 -0
- package/api/@xmachines/play/index/type-aliases/DisposeKey.md +32 -0
- package/api/@xmachines/play/{type-aliases → index/type-aliases}/PlayEvent.md +4 -4
- package/api/@xmachines/play/index/variables/DISPOSE.md +34 -0
- package/api/@xmachines/play-actor/README.md +78 -222
- package/api/@xmachines/play-actor/interfaces/ActorEvent.md +18 -0
- package/api/@xmachines/play-actor/interfaces/PlayActor.md +73 -0
- package/api/@xmachines/play-dom/README.md +99 -43
- package/api/@xmachines/play-dom/classes/PlayRenderer.md +12 -11
- package/api/@xmachines/play-dom/functions/asCleanup.md +78 -0
- package/api/@xmachines/play-dom/functions/createPlayUI.md +6 -6
- package/api/@xmachines/play-dom/functions/createRenderer.md +3 -3
- package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +17 -11
- package/api/@xmachines/play-dom/interfaces/MountOptions.md +5 -4
- package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +14 -12
- package/api/@xmachines/play-dom/type-aliases/Cleanup.md +38 -0
- package/api/@xmachines/play-dom/type-aliases/MountFn.md +30 -8
- package/api/@xmachines/play-dom-router/README.md +99 -73
- package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +22 -21
- package/api/@xmachines/{play-vue-router → play-dom-router}/classes/RouteMap.md +12 -6
- package/api/@xmachines/play-dom-router/functions/asCleanup.md +78 -0
- package/api/@xmachines/play-dom-router/functions/connectRouter.md +3 -8
- package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +7 -1
- package/api/@xmachines/play-dom-router/functions/createRouter.md +12 -6
- package/api/@xmachines/play-dom-router/interfaces/BasePathOptions.md +5 -5
- package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +73 -19
- package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +16 -16
- package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +8 -8
- package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +24 -21
- package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-dom-router/interfaces/RouterConnection.md +36 -7
- package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +40 -6
- package/api/@xmachines/play-dom-router/type-aliases/Cleanup.md +38 -0
- package/api/@xmachines/play-dom-router/variables/DISPOSE.md +34 -0
- package/api/@xmachines/play-react/README.md +18 -40
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +50 -11
- package/api/@xmachines/play-react/functions/useActor.md +1 -1
- package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
- package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
- package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +8 -6
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +6 -5
- package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-react/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-react/variables/schema.md +52 -0
- package/api/@xmachines/play-react-router/README.md +22 -50
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +17 -16
- package/api/@xmachines/play-react-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +11 -8
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +16 -9
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +10 -10
- package/api/@xmachines/play-react-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-react-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-router/README.md +108 -189
- package/api/@xmachines/play-router/errors/README.md +15 -0
- package/api/@xmachines/play-router/errors/classes/DuplicateBridgeError.md +191 -0
- package/api/@xmachines/play-router/errors/classes/DuplicateRoutePathError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/EmptyRoutePathError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/InvalidBasePathError.md +200 -0
- package/api/@xmachines/play-router/errors/classes/InvalidRoutePatternError.md +203 -0
- package/api/@xmachines/play-router/errors/classes/InvalidStateIdError.md +175 -0
- package/api/@xmachines/play-router/errors/classes/MissingBasePathParamError.md +199 -0
- package/api/@xmachines/play-router/errors/classes/RouterSyncError.md +192 -0
- package/api/@xmachines/play-router/errors/classes/UnknownStateTypeError.md +182 -0
- package/api/@xmachines/play-router/index/README.md +75 -0
- package/api/@xmachines/play-router/{classes → index/classes}/RouteMap.md +12 -6
- package/api/@xmachines/play-router/{classes → index/classes}/RouterBridgeBase.md +19 -17
- package/api/@xmachines/play-router/{functions → index/functions}/buildPlayRouteEvent.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/buildRouteTree.md +14 -4
- package/api/@xmachines/play-router/{functions → index/functions}/cleanFrameworkParams.md +3 -4
- package/api/@xmachines/play-router/{functions → index/functions}/createRouteMapFromTree.md +13 -6
- package/api/@xmachines/play-router/{functions → index/functions}/createRouterConnection.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/detectDuplicateRoutes.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/extractQuery.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/extractRouteParams.md +3 -3
- package/api/@xmachines/play-router/{functions → index/functions}/findRouteById.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/findRouteByPath.md +2 -2
- package/api/@xmachines/play-router/index/functions/getPatternParamNames.md +29 -0
- package/api/@xmachines/play-router/index/functions/getRequiredPatternParamNames.md +39 -0
- package/api/@xmachines/play-router/{functions → index/functions}/isMountableBridge.md +2 -2
- package/api/@xmachines/play-router/index/functions/joinBasePath.md +37 -0
- package/api/@xmachines/play-router/{functions → index/functions}/mountKey.md +2 -2
- package/api/@xmachines/play-router/index/functions/normalizeBasePath.md +43 -0
- package/api/@xmachines/play-router/{functions → index/functions}/openProviderBridge.md +14 -14
- package/api/@xmachines/play-router/index/functions/pickOwnParams.md +41 -0
- package/api/@xmachines/play-router/{functions → index/functions}/repointProviderBridge.md +2 -2
- package/api/@xmachines/play-router/index/functions/resolveBasePath.md +51 -0
- package/api/@xmachines/play-router/{functions → index/functions}/resolveFrameworkParams.md +11 -13
- package/api/@xmachines/play-router/{functions → index/functions}/sanitizePathname.md +2 -2
- package/api/@xmachines/play-router/index/functions/stripBasePath.md +44 -0
- package/api/@xmachines/play-router/{functions → index/functions}/validateRouteFormat.md +2 -2
- package/api/@xmachines/play-router/{functions → index/functions}/validateStateExists.md +2 -2
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/BasePathOptions.md +6 -6
- package/api/@xmachines/play-router/index/interfaces/BuildPlayRouteEventOptions.md +13 -0
- package/api/@xmachines/play-router/index/interfaces/FrameworkParamsSource.md +47 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/LocationLike.md +6 -6
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/MountableRouterBridge.md +9 -9
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/OpenProviderBridgeArgs.md +13 -13
- package/api/@xmachines/play-router/index/interfaces/PlayRouteEvent.md +130 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/PlayRouterProviderBaseProps.md +15 -15
- package/api/@xmachines/play-router/index/interfaces/ResolvedBasePath.md +14 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/ResolvedRoutePath.md +6 -6
- package/api/@xmachines/play-router/index/interfaces/Routable.md +26 -0
- package/api/@xmachines/play-router/index/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteInfo.md +11 -11
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteMapping.md +6 -6
- package/api/@xmachines/play-router/index/interfaces/RouteMatch.md +12 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteNode.md +13 -13
- package/api/@xmachines/play-router/index/interfaces/RouteObject.md +34 -0
- package/api/@xmachines/play-router/index/interfaces/RouteTree.md +27 -0
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouteWatcherHandle.md +7 -7
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouterBridge.md +5 -5
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/RouterConnection.md +38 -9
- package/api/@xmachines/play-router/{interfaces → index/interfaces}/WindowLike.md +4 -4
- package/api/@xmachines/play-router/index/type-aliases/PlayRouterBridgeConstructor.md +46 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteData.md +12 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteDataResolver.md +31 -0
- package/api/@xmachines/play-router/index/type-aliases/RouteMetadata.md +11 -0
- package/api/@xmachines/play-router/index/variables/DISPOSE.md +34 -0
- package/api/@xmachines/play-router/index/variables/NO_BASE_PATH.md +18 -0
- package/api/@xmachines/play-router/index/variables/ROOT_NODE_ID.md +18 -0
- package/api/@xmachines/play-router/xstate/README.md +53 -0
- package/api/@xmachines/{play-dom-router → play-router/xstate}/functions/createRouteMap.md +8 -6
- package/api/@xmachines/play-router/{functions → xstate/functions}/extractMachineRoutes.md +4 -4
- package/api/@xmachines/play-router/xstate/functions/getNavigableRoutes.md +35 -0
- package/api/@xmachines/play-router/{functions → xstate/functions}/getRoutableRoutes.md +6 -6
- package/api/@xmachines/play-router/{functions → xstate/functions}/getRouteMappings.md +7 -7
- package/api/@xmachines/play-router/{functions → xstate/functions}/getTransitionReachableRoutes.md +2 -2
- package/api/@xmachines/play-router/{functions → xstate/functions}/isRouteReachable.md +2 -2
- package/api/@xmachines/play-router/{functions → xstate/functions}/machineToGraph.md +2 -2
- package/api/@xmachines/play-router/xstate/functions/routeExists.md +26 -0
- package/api/@xmachines/play-router/xstate/interfaces/MachineEdgeData.md +15 -0
- package/api/@xmachines/play-router/xstate/interfaces/MachineNodeData.md +17 -0
- package/api/@xmachines/play-router/{type-aliases → xstate/type-aliases}/MachineGraph.md +2 -2
- package/api/@xmachines/play-signals/README.md +5 -25
- package/api/@xmachines/play-signals/functions/watchSignal.md +27 -4
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +2 -2
- package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
- package/api/@xmachines/play-signals/type-aliases/Cleanup.md +38 -0
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
- package/api/@xmachines/play-solid/README.md +36 -35
- package/api/@xmachines/play-solid/functions/useActor.md +1 -1
- package/api/@xmachines/play-solid/functions/usePlayView.md +14 -1
- package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +11 -11
- package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +13 -13
- package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +16 -8
- package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
- package/api/@xmachines/play-solid/variables/ActorProvider.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
- package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
- package/api/@xmachines/play-solid/variables/schema.md +71 -0
- package/api/@xmachines/play-solid-router/README.md +31 -52
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +30 -53
- package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +9 -8
- package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +38 -35
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +12 -12
- package/api/@xmachines/play-solid-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +5 -5
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-solid-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
- package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-svelte/README.md +13 -28
- package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-svelte/functions/getActorContext.md +1 -1
- package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +7 -1
- package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
- package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +12 -12
- package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
- package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +14 -14
- package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +11 -3
- package/api/@xmachines/play-svelte/variables/schema.md +16 -0
- package/api/@xmachines/play-svelte-spa-router/README.md +22 -41
- package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +22 -21
- package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -2
- package/api/@xmachines/play-svelte-spa-router/interfaces/BasePathOptions.md +5 -5
- package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +8 -8
- package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-svelte-spa-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-svelte-spa-router/interfaces/RouterConnection.md +36 -7
- package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/README.md +17 -35
- package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +22 -21
- package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -2
- package/api/@xmachines/play-sveltekit-router/interfaces/BasePathOptions.md +5 -5
- package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +8 -8
- package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-sveltekit-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-sveltekit-router/interfaces/RouterConnection.md +36 -7
- package/api/@xmachines/play-tanstack-react-router/README.md +19 -43
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +18 -17
- package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +11 -8
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +16 -9
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +10 -10
- package/api/@xmachines/play-tanstack-react-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-tanstack-router/README.md +6 -4
- package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +17 -20
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +3 -3
- package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/README.md +26 -52
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +11 -5
- package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +49 -45
- package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +9 -8
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +9 -14
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +10 -10
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +4 -4
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +17 -7
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterProviderBaseProps.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +5 -5
- package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-url/README.md +69 -0
- package/api/@xmachines/play-url/errors/README.md +17 -0
- package/api/@xmachines/play-url/errors/classes/InvalidBasePathError.md +200 -0
- package/api/@xmachines/play-url/errors/classes/InvalidRoutePatternError.md +203 -0
- package/api/@xmachines/play-url/errors/classes/MissingBasePathParamError.md +199 -0
- package/api/@xmachines/play-url/index/README.md +65 -0
- package/api/@xmachines/play-url/index/functions/cleanFrameworkParams.md +39 -0
- package/api/@xmachines/play-url/index/functions/getCandidates.md +29 -0
- package/api/@xmachines/play-url/index/functions/getCompiledPattern.md +31 -0
- package/api/@xmachines/play-url/index/functions/getIndexKey.md +30 -0
- package/api/@xmachines/play-url/index/functions/getNormalizedParamNameMap.md +32 -0
- package/api/@xmachines/play-url/index/functions/getPatternParamNames.md +29 -0
- package/api/@xmachines/play-url/index/functions/getRequiredPatternParamNames.md +39 -0
- package/api/@xmachines/play-url/index/functions/holdsUnsubstitutedParam.md +36 -0
- package/api/@xmachines/play-url/index/functions/isParameterizedPattern.md +36 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/joinBasePath.md +2 -2
- package/api/@xmachines/{play-router → play-url/index}/functions/normalizeBasePath.md +2 -2
- package/api/@xmachines/play-url/index/functions/normalizeParamNames.md +36 -0
- package/api/@xmachines/play-url/index/functions/parsePattern.md +27 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/pickOwnParams.md +4 -4
- package/api/@xmachines/{play-router → play-url/index}/functions/resolveBasePath.md +2 -2
- package/api/@xmachines/play-url/index/functions/resolveFrameworkParams.md +49 -0
- package/api/@xmachines/{play-router → play-url/index}/functions/stripBasePath.md +2 -2
- package/api/@xmachines/play-url/index/interfaces/BasePathOptions.md +28 -0
- package/api/@xmachines/{play-router → play-url/index}/interfaces/FrameworkParamsSource.md +9 -9
- package/api/@xmachines/play-url/index/interfaces/GroupPart.md +15 -0
- package/api/@xmachines/play-url/index/interfaces/LiteralPart.md +14 -0
- package/api/@xmachines/play-url/index/interfaces/ParamPart.md +21 -0
- package/api/@xmachines/play-url/index/interfaces/ParsedPattern.md +23 -0
- package/api/@xmachines/play-url/index/interfaces/PatternParam.md +15 -0
- package/api/@xmachines/{play-router → play-url/index}/interfaces/ResolvedBasePath.md +6 -6
- package/api/@xmachines/play-url/index/type-aliases/PatternModifier.md +11 -0
- package/api/@xmachines/play-url/index/type-aliases/PatternPart.md +9 -0
- package/api/@xmachines/play-url/index/type-aliases/URLPatternCtor.md +22 -0
- package/api/@xmachines/play-url/index/type-aliases/URLPatternLike.md +68 -0
- package/api/@xmachines/{play-router → play-url/index}/variables/NO_BASE_PATH.md +2 -2
- package/api/@xmachines/play-url/index/variables/URLPattern.md +21 -0
- package/api/@xmachines/play-view/README.md +165 -0
- package/api/@xmachines/play-view/errors/README.md +17 -0
- package/api/@xmachines/play-view/errors/classes/ReadOnlyContextError.md +192 -0
- package/api/@xmachines/play-view/index/README.md +55 -0
- package/api/@xmachines/{play-actor → play-view/index}/functions/attachRenderErrorHandler.md +6 -6
- package/api/@xmachines/{play-actor → play-view/index}/functions/composePlayState.md +2 -2
- package/api/@xmachines/play-view/index/functions/createFailureLatch.md +20 -0
- package/api/@xmachines/play-view/index/functions/createReportGuard.md +26 -0
- package/api/@xmachines/{play-actor → play-view/index}/functions/createViewStoreLifecycle.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/guardContextWrites.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/refreshContextSubtree.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/reuseComposedState.md +3 -3
- package/api/@xmachines/play-view/index/functions/sameViewInputs.md +25 -0
- package/api/@xmachines/{play-actor → play-view/index}/functions/toAtomState.md +2 -2
- package/api/@xmachines/{play-actor → play-view/index}/functions/typedSpec.md +2 -2
- package/api/@xmachines/play-view/index/interfaces/BaseActorProviderProps.md +49 -0
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/BaseViewContextValue.md +12 -12
- package/api/@xmachines/play-view/index/interfaces/FailureLatch.md +60 -0
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/PlaySpec.md +8 -8
- package/api/@xmachines/play-view/index/interfaces/ReportGuard.md +92 -0
- package/api/@xmachines/play-view/index/interfaces/ReportGuardMessages.md +18 -0
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ResolveViewStoreOptions.md +5 -5
- package/api/@xmachines/play-view/index/interfaces/ViewInputs.md +19 -0
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ViewStoreLifecycle.md +6 -5
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/ViewStoreResolution.md +7 -7
- package/api/@xmachines/{play-actor → play-view/index}/interfaces/Viewable.md +5 -5
- package/api/@xmachines/play-view/index/type-aliases/ViewActor.md +26 -0
- package/api/@xmachines/{play-actor → play-view/index}/variables/CONTEXT_STATE_KEY.md +2 -2
- package/api/@xmachines/play-vue/README.md +46 -42
- package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
- package/api/@xmachines/play-vue/functions/useActor.md +1 -1
- package/api/@xmachines/play-vue/functions/usePlayView.md +6 -1
- package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +13 -8
- package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +15 -10
- package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +8 -8
- package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +11 -3
- 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/schema.md +71 -0
- package/api/@xmachines/play-vue-router/README.md +34 -77
- package/api/@xmachines/play-vue-router/errors/README.md +8 -0
- package/api/@xmachines/play-vue-router/errors/classes/VueRouterNavigationError.md +193 -0
- package/api/@xmachines/play-vue-router/errors/classes/VueRouterSendError.md +177 -0
- package/api/@xmachines/play-vue-router/index/README.md +20 -0
- package/api/@xmachines/play-vue-router/index/classes/RouteMap.md +157 -0
- package/api/@xmachines/play-vue-router/{classes → index/classes}/VueRouterBridge.md +24 -43
- package/api/@xmachines/play-vue-router/index/interfaces/PlayRouteEvent.md +130 -0
- package/api/@xmachines/play-vue-router/index/interfaces/RoutableActor.md +72 -0
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouteMapOptions.md +5 -5
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouteMapping.md +6 -6
- package/api/@xmachines/play-vue-router/{interfaces → index/interfaces}/RouterBridge.md +5 -5
- package/api/@xmachines/play-vue-router/{variables → index/variables}/PlayRouterProvider.md +4 -4
- package/api/@xmachines/play-xstate/README.md +163 -98
- package/api/@xmachines/play-xstate/errors/README.md +13 -0
- package/api/@xmachines/play-xstate/errors/classes/ActorThrewNonErrorError.md +199 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidEventError.md +198 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidMachineError.md +169 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidRouteHandlerError.md +197 -0
- package/api/@xmachines/play-xstate/errors/classes/InvalidRouteMetadataError.md +176 -0
- package/api/@xmachines/play-xstate/errors/classes/MissingRouteParamError.md +199 -0
- package/api/@xmachines/play-xstate/errors/classes/MissingStateIdError.md +203 -0
- package/api/@xmachines/play-xstate/index/README.md +38 -0
- package/api/@xmachines/play-xstate/index/classes/PlayerActor.md +584 -0
- package/api/@xmachines/play-xstate/index/functions/compose.md +224 -0
- package/api/@xmachines/play-xstate/index/functions/definePlayer.md +158 -0
- package/api/@xmachines/play-xstate/index/interfaces/PlayerConfig.md +22 -0
- package/api/@xmachines/play-xstate/{interfaces → index/interfaces}/PlayerFactoryResumeOptions.md +3 -3
- package/api/@xmachines/play-xstate/{interfaces → index/interfaces}/PlayerOptions.md +8 -8
- package/api/@xmachines/play-xstate/index/type-aliases/Capability.md +33 -0
- package/api/@xmachines/play-xstate/index/type-aliases/PlayerConstructor.md +39 -0
- package/api/@xmachines/play-xstate/index/type-aliases/PlayerFactory.md +27 -0
- package/api/@xmachines/play-xstate/index/variables/DISPOSE.md +34 -0
- package/api/@xmachines/play-xstate/with-routing/README.md +46 -0
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/buildRouteUrl.md +2 -2
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/deriveRoute.md +4 -4
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/formatPlayRouteTransitions.md +2 -2
- package/api/@xmachines/play-xstate/{functions → with-routing/functions}/isAbsoluteRoute.md +3 -3
- package/api/@xmachines/play-xstate/with-routing/functions/withRouting.md +36 -0
- package/api/@xmachines/play-xstate/{interfaces → with-routing/interfaces}/RouteContext.md +6 -6
- package/api/@xmachines/play-xstate/with-routing/interfaces/RouteObject.md +34 -0
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteData.md +12 -0
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteDataResolver.md +31 -0
- package/api/@xmachines/play-xstate/{type-aliases → with-routing/type-aliases}/RouteMachineConfig.md +5 -5
- package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteMetadata.md +11 -0
- package/api/@xmachines/play-xstate/{type-aliases → with-routing/type-aliases}/RouteStateNode.md +21 -7
- package/api/@xmachines/play-xstate/with-view/README.md +31 -0
- package/api/@xmachines/play-xstate/with-view/functions/withView.md +32 -0
- package/api/@xmachines/shared/README.md +10 -32
- 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 +2 -1
- package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
- package/api/README.md +2 -0
- package/api/llms.txt +15 -10
- package/contributing/architecture.md +97 -65
- package/contributing/configuration.md +142 -41
- package/contributing/deployment.md +30 -28
- package/contributing/development.md +94 -31
- package/contributing/testing.md +90 -31
- package/examples/README.md +9 -7
- package/examples/form-validation.md +3 -2
- package/examples/multi-router-integration.md +61 -39
- package/examples/routing-patterns.md +15 -14
- package/examples/traffic-light.md +11 -5
- package/guides/README.md +1 -0
- package/guides/actor-model.md +35 -26
- package/guides/getting-started.md +47 -44
- package/guides/inspector.md +4 -4
- package/guides/routing.md +245 -0
- package/guides/signals.md +43 -0
- package/guides/state-machines.md +16 -17
- package/package.json +10 -9
- package/rfc/play.md +35 -22
- package/api/@xmachines/play-actor/classes/AbstractActor.md +0 -505
- package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +0 -48
- package/api/@xmachines/play-actor/interfaces/Routable.md +0 -14
- package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +0 -122
- package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +0 -13
- package/api/@xmachines/play-react-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-react-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +0 -35
- package/api/@xmachines/play-router/functions/getPatternParamNames.md +0 -24
- package/api/@xmachines/play-router/functions/getRequiredPatternParamNames.md +0 -36
- package/api/@xmachines/play-router/functions/routeExists.md +0 -26
- package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +0 -13
- package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +0 -15
- package/api/@xmachines/play-router/interfaces/MachineNodeData.md +0 -17
- package/api/@xmachines/play-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +0 -135
- package/api/@xmachines/play-router/interfaces/RoutableActor.md +0 -65
- package/api/@xmachines/play-router/interfaces/RouteMatch.md +0 -12
- package/api/@xmachines/play-router/interfaces/RouteObject.md +0 -21
- package/api/@xmachines/play-router/interfaces/RouteTree.md +0 -21
- package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +0 -13
- package/api/@xmachines/play-router/type-aliases/PlayRouterBridgeConstructor.md +0 -36
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +0 -11
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +0 -471
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +0 -9
- package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +0 -9
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +0 -29
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +0 -31
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +0 -9
- package/api/@xmachines/play-vue/variables/getPlayViewContext.md +0 -34
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +0 -40
- package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +0 -70
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +0 -135
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +0 -13
- package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +0 -13
- package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +0 -13
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +0 -532
- package/api/@xmachines/play-xstate/functions/composeGuards.md +0 -86
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +0 -72
- package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +0 -43
- package/api/@xmachines/play-xstate/functions/definePlayer.md +0 -78
- package/api/@xmachines/play-xstate/functions/eventMatches.md +0 -45
- package/api/@xmachines/play-xstate/functions/hasContext.md +0 -45
- package/api/@xmachines/play-xstate/functions/negateGuard.md +0 -67
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +0 -20
- package/api/@xmachines/play-xstate/interfaces/RouteObject.md +0 -17
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +0 -19
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +0 -36
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +0 -23
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +0 -26
- package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +0 -9
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-view](../../README.md) / [index](../README.md) / FailureLatch
|
|
2
|
+
|
|
3
|
+
# Interface: FailureLatch
|
|
4
|
+
|
|
5
|
+
Defined in: [packages/play-view/src/failure-latch.ts:174](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L174)
|
|
6
|
+
|
|
7
|
+
The record of what a provider reported. See [createFailureLatch](../functions/createFailureLatch.md).
|
|
8
|
+
|
|
9
|
+
## Methods
|
|
10
|
+
|
|
11
|
+
### clear()
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
clear(): void;
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Defined in: [packages/play-view/src/failure-latch.ts:191](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L191)
|
|
18
|
+
|
|
19
|
+
Forgets the record, so the next failure reports again.
|
|
20
|
+
|
|
21
|
+
A caller clears it on EVERY emission of a view, the null emission included: a view,
|
|
22
|
+
then null, then the same view is a real sequence of an actor, and the second failure
|
|
23
|
+
of that view is a second attempt that the host must hear about. It also clears it on
|
|
24
|
+
a resolution that works, and on a retry that the host starts — the host asked for
|
|
25
|
+
that attempt, so it must hear the result.
|
|
26
|
+
|
|
27
|
+
#### Returns
|
|
28
|
+
|
|
29
|
+
`void`
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
### shouldReport()
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
shouldReport(
|
|
37
|
+
actor,
|
|
38
|
+
view,
|
|
39
|
+
store
|
|
40
|
+
): boolean;
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Defined in: [packages/play-view/src/failure-latch.ts:181](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L181)
|
|
44
|
+
|
|
45
|
+
Answers whether a failure of these three inputs is new, and records it.
|
|
46
|
+
|
|
47
|
+
#### Parameters
|
|
48
|
+
|
|
49
|
+
| Parameter | Type |
|
|
50
|
+
| --------- | --------- |
|
|
51
|
+
| `actor` | `unknown` |
|
|
52
|
+
| `view` | `unknown` |
|
|
53
|
+
| `store` | `unknown` |
|
|
54
|
+
|
|
55
|
+
#### Returns
|
|
56
|
+
|
|
57
|
+
`boolean`
|
|
58
|
+
|
|
59
|
+
`true` the first time for one set of inputs, and `false` for every repeat
|
|
60
|
+
of the same set. A caller reports only when it returns `true`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-view](../../README.md) / [index](../README.md) / PlaySpec
|
|
2
2
|
|
|
3
3
|
# Interface: PlaySpec
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-
|
|
5
|
+
Defined in: [packages/play-view/src/view-types.ts:32](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/view-types.ts#L32)
|
|
6
6
|
|
|
7
7
|
The XMachines extension of the `Spec` type of `@xmachines/json-render-core`.
|
|
8
8
|
|
|
@@ -18,9 +18,9 @@ spec reads only the paths that it needs.
|
|
|
18
18
|
|
|
19
19
|
## Properties
|
|
20
20
|
|
|
21
|
-
| Property | Modifier | Type | Description | Inherited from | Defined in
|
|
22
|
-
| ----------------------------------------- | ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------- |
|
|
23
|
-
| <a id="property-elements"></a> `elements` | `public` | `Record`\<`string`, `UIElement`\> | Flat map of elements by key | `Spec.elements` | -
|
|
24
|
-
| <a id="property-root"></a> `root` | `public` | `string` | Root element key | `Spec.root` | -
|
|
25
|
-
| <a id="property-state"></a> `state?` | `public` | `Record`\<`string`, `unknown`\> | Optional initial state to seed the state model. Components using statePath will read from / write to this state. | `Spec.state` | -
|
|
26
|
-
| <a id="property-viewkey"></a> `viewKey?` | `readonly` | `string` | The identity of the view of this derived spec. `deriveCurrentView` sets it from the meta entry that the derivation selected. A provider uses it as the key of its store lifecycle: a new `viewKey` seeds the store again, and the same `viewKey` refreshes `/context` in place, which keeps the ephemeral view state. Never write this field in `meta.view`. | - | [packages/play-
|
|
21
|
+
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
22
|
+
| ----------------------------------------- | ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| <a id="property-elements"></a> `elements` | `public` | `Record`\<`string`, `UIElement`\> | Flat map of elements by key | `Spec.elements` | - |
|
|
24
|
+
| <a id="property-root"></a> `root` | `public` | `string` | Root element key | `Spec.root` | - |
|
|
25
|
+
| <a id="property-state"></a> `state?` | `public` | `Record`\<`string`, `unknown`\> | Optional initial state to seed the state model. Components using statePath will read from / write to this state. | `Spec.state` | - |
|
|
26
|
+
| <a id="property-viewkey"></a> `viewKey?` | `readonly` | `string` | The identity of the view of this derived spec. `deriveCurrentView` sets it from the meta entry that the derivation selected. A provider uses it as the key of its store lifecycle: a new `viewKey` seeds the store again, and the same `viewKey` refreshes `/context` in place, which keeps the ephemeral view state. Never write this field in `meta.view`. | - | [packages/play-view/src/view-types.ts:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/view-types.ts#L40) |
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-view](../../README.md) / [index](../README.md) / ReportGuard
|
|
2
|
+
|
|
3
|
+
# Interface: ReportGuard
|
|
4
|
+
|
|
5
|
+
Defined in: [packages/play-view/src/failure-latch.ts:59](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L59)
|
|
6
|
+
|
|
7
|
+
A report guard of one provider.
|
|
8
|
+
|
|
9
|
+
The rule it holds: a provider reports a contained failure to the host, and it must do
|
|
10
|
+
that without letting the host defeat the containment. Two things follow — a reset that
|
|
11
|
+
the host calls from INSIDE the report does nothing, because no input changed between
|
|
12
|
+
the two attempts; and every callback that the provider handed out does nothing once the
|
|
13
|
+
provider is gone, because a host can keep a reset (a "Retry" button of a toast outlives
|
|
14
|
+
the route that opened it).
|
|
15
|
+
|
|
16
|
+
## Methods
|
|
17
|
+
|
|
18
|
+
### blocked()
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
blocked(): boolean;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Defined in: [packages/play-view/src/failure-latch.ts:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L61)
|
|
25
|
+
|
|
26
|
+
True when a reset that the host starts must do nothing.
|
|
27
|
+
|
|
28
|
+
#### Returns
|
|
29
|
+
|
|
30
|
+
`boolean`
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
### dispose()
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
dispose(): void;
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Defined in: [packages/play-view/src/failure-latch.ts:74](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L74)
|
|
41
|
+
|
|
42
|
+
The provider is gone.
|
|
43
|
+
|
|
44
|
+
#### Returns
|
|
45
|
+
|
|
46
|
+
`void`
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
### disposed()
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
disposed(): boolean;
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Defined in: [packages/play-view/src/failure-latch.ts:72](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L72)
|
|
57
|
+
|
|
58
|
+
True once [ReportGuard.dispose](#dispose) ran, and never for a report that runs.
|
|
59
|
+
|
|
60
|
+
[ReportGuard.blocked](#blocked) answers a different question: it is true for the
|
|
61
|
+
re-entry of a report as well, and it goes back to false when that report ends. A
|
|
62
|
+
caller that asks whether the guard is SPENT — play-react builds one again after the
|
|
63
|
+
cleanup of `<StrictMode>` disposed it — must read this one: `blocked()` there would
|
|
64
|
+
replace a live guard that is reporting, and the `finally` of that report would then
|
|
65
|
+
clear the re-entry flag of a guard that nobody holds.
|
|
66
|
+
|
|
67
|
+
#### Returns
|
|
68
|
+
|
|
69
|
+
`boolean`
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### report()
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
report(error, deliver): void;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Defined in: [packages/play-view/src/failure-latch.ts:86](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L86)
|
|
80
|
+
|
|
81
|
+
Delivers one report, with the re-entry flag held for the call.
|
|
82
|
+
|
|
83
|
+
#### Parameters
|
|
84
|
+
|
|
85
|
+
| Parameter | Type | Description |
|
|
86
|
+
| --------- | ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
87
|
+
| `error` | `unknown` | The contained failure. |
|
|
88
|
+
| `deliver` | (() => `void`) \| `undefined` | The call of the handler of the host, or `undefined` when the host gave none. Without a handler the guard writes [ReportGuardMessages.noHandler](ReportGuardMessages.md#property-nohandler) to `console.error`: a contained failure that reaches no handler and no caller is the one result that nobody can debug. A handler that THROWS is contained where the guard carries [ReportGuardMessages.handlerThrew](ReportGuardMessages.md#property-handlerthrew), and it reaches the caller where it does not. |
|
|
89
|
+
|
|
90
|
+
#### Returns
|
|
91
|
+
|
|
92
|
+
`void`
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-view](../../README.md) / [index](../README.md) / ReportGuardMessages
|
|
2
|
+
|
|
3
|
+
# Interface: ReportGuardMessages
|
|
4
|
+
|
|
5
|
+
Defined in: [packages/play-view/src/failure-latch.ts:96](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L96)
|
|
6
|
+
|
|
7
|
+
What a [ReportGuard](ReportGuard.md) writes to `console.error`, and what it therefore contains.
|
|
8
|
+
|
|
9
|
+
Each message is optional, and each one is a DECISION of the renderer that builds the
|
|
10
|
+
guard. The rule that both serve is one rule: a contained failure is never silent, and
|
|
11
|
+
a handler of the host never defeats the containment.
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
| Property | Type | Description | Defined in |
|
|
16
|
+
| -------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| <a id="property-handlerthrew"></a> `handlerThrew?` | `string` | What `console.error` says when the handler of the host THROWS. A guard that carries this message CONTAINS such a throw. All five renderers carry it, so a host learns one rule: a handler of the host never defeats the containment, and a host that must escalate raises the failure from a task of its own — `queueMicrotask(() => { throw error; })`. Omit it only where a throw must reach the caller, which no renderer of this workspace asks for today. A renderer needs the containment when a throw that leaves the report also stops the screen of the fallback: the flag of play-vue schedules a render, the fallback of play-solid is the RETURN of the callback that reports, `componentDidCatch` of play-react can take the complete React root down, and a throw that leaves the `onerror` of Svelte leaves its own `calling_on_error` flag raised, which makes every later reset of the host raise `svelte_boundary_reset_onerror`. | [packages/play-view/src/failure-latch.ts:120](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L120) |
|
|
18
|
+
| <a id="property-nohandler"></a> `noHandler?` | `string` | What `console.error` says when the host gave no handler. Omit it where the framework writes such a failure itself: React logs an error that a boundary caught, so play-react would report the same failure two times. | [packages/play-view/src/failure-latch.ts:103](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L103) |
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-view](../../README.md) / [index](../README.md) / ResolveViewStoreOptions
|
|
2
2
|
|
|
3
3
|
# Interface: ResolveViewStoreOptions
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-
|
|
5
|
+
Defined in: [packages/play-view/src/view-store-lifecycle.ts:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/view-store-lifecycle.ts#L57)
|
|
6
6
|
|
|
7
7
|
## Properties
|
|
8
8
|
|
|
9
|
-
| Property | Type | Description | Defined in
|
|
10
|
-
| ------------------------------------------------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
11
|
-
| <a id="property-refreshexternalstore"></a> `refreshExternalStore?` | `boolean` | The controlled mode only: refresh the /context subtree of the external store during this resolve. The default is true. Give false where the call site permits no notification of the store subscribers, which is the render path of React, and refresh from an effect instead. | [packages/play-
|
|
9
|
+
| Property | Type | Description | Defined in |
|
|
10
|
+
| ------------------------------------------------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| <a id="property-refreshexternalstore"></a> `refreshExternalStore?` | `boolean` | The controlled mode only: refresh the /context subtree of the external store during this resolve. The default is true. Give false where the call site permits no notification of the store subscribers, which is the render path of React, and refresh from an effect instead. | [packages/play-view/src/view-store-lifecycle.ts:64](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/view-store-lifecycle.ts#L64) |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-view](../../README.md) / [index](../README.md) / ViewInputs
|
|
2
|
+
|
|
3
|
+
# Interface: ViewInputs
|
|
4
|
+
|
|
5
|
+
Defined in: [packages/play-view/src/failure-latch.ts:33](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L33)
|
|
6
|
+
|
|
7
|
+
The three inputs that a provider resolves a store from.
|
|
8
|
+
|
|
9
|
+
`ViewStoreLifecycle.resolve` takes exactly these, and every provider names all three in
|
|
10
|
+
its reset rule. The type gives the rule one name, so the comparison below stands one
|
|
11
|
+
time instead of once for each renderer that needs it.
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
| Property | Type | Defined in |
|
|
16
|
+
| ----------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| <a id="property-actor"></a> `actor` | `unknown` | [packages/play-view/src/failure-latch.ts:34](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L34) |
|
|
18
|
+
| <a id="property-store"></a> `store` | `unknown` | [packages/play-view/src/failure-latch.ts:36](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L36) |
|
|
19
|
+
| <a id="property-view"></a> `view` | `unknown` | [packages/play-view/src/failure-latch.ts:35](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/failure-latch.ts#L35) |
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-view](../../README.md) / [index](../README.md) / ViewStoreLifecycle
|
|
2
2
|
|
|
3
3
|
# Interface: ViewStoreLifecycle
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-
|
|
5
|
+
Defined in: [packages/play-view/src/view-store-lifecycle.ts:67](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/view-store-lifecycle.ts#L67)
|
|
6
6
|
|
|
7
7
|
## Methods
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ Defined in: [packages/play-actor/src/view-store-lifecycle.ts:67](https://gitlab.
|
|
|
12
12
|
reset(): void;
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Defined in: [packages/play-
|
|
15
|
+
Defined in: [packages/play-view/src/view-store-lifecycle.ts:84](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/view-store-lifecycle.ts#L84)
|
|
16
16
|
|
|
17
17
|
Drops everything, on an unmount or a disconnect. The next resolve makes a new seed.
|
|
18
18
|
|
|
@@ -29,10 +29,11 @@ resolve(
|
|
|
29
29
|
actor,
|
|
30
30
|
view,
|
|
31
31
|
externalStore?,
|
|
32
|
-
options?
|
|
32
|
+
options?
|
|
33
|
+
): ViewStoreResolution;
|
|
33
34
|
```
|
|
34
35
|
|
|
35
|
-
Defined in: [packages/play-
|
|
36
|
+
Defined in: [packages/play-view/src/view-store-lifecycle.ts:77](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/view-store-lifecycle.ts#L77)
|
|
36
37
|
|
|
37
38
|
Brings the store in line with an emission, and returns it with its guard.
|
|
38
39
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-view](../../README.md) / [index](../README.md) / ViewStoreResolution
|
|
2
2
|
|
|
3
3
|
# Interface: ViewStoreResolution
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-
|
|
5
|
+
Defined in: [packages/play-view/src/view-store-lifecycle.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/view-store-lifecycle.ts#L38)
|
|
6
6
|
|
|
7
7
|
The result of a resolve — see [ViewStoreLifecycle.resolve](ViewStoreLifecycle.md#resolve).
|
|
8
8
|
|
|
9
9
|
## Properties
|
|
10
10
|
|
|
11
|
-
| Property | Type | Description | Defined in
|
|
12
|
-
| ------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
-
| <a id="property-guardedstore"></a> `guardedStore` | `StateStore` | The store to give to the children ($bindState, setState, and a chained set): a write under /context throws. There is one wrapper for each store below it, and the code caches the identity. Therefore a consumer in the style of `useSyncExternalStore` stays stable. | [packages/play-
|
|
14
|
-
| <a id="property-reseeded"></a> `reseeded` | `boolean` | It is true when this resolve made a new store: at the first resolve, on a change of the viewKey, in the fallback for each emission, and on a change of the actor. A provider that mounts a subtree again for each store, such as the storeKey of Vue, uses this field as its key. | [packages/play-
|
|
15
|
-
| <a id="property-store"></a> `store` | `StateStore` | The store WITHOUT the guard — the reference of the machinery for its own refresh. | [packages/play-
|
|
11
|
+
| Property | Type | Description | Defined in |
|
|
12
|
+
| ------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| <a id="property-guardedstore"></a> `guardedStore` | `StateStore` | The store to give to the children ($bindState, setState, and a chained set): a write under /context throws. There is one wrapper for each store below it, and the code caches the identity. Therefore a consumer in the style of `useSyncExternalStore` stays stable. | [packages/play-view/src/view-store-lifecycle.ts:47](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/view-store-lifecycle.ts#L47) |
|
|
14
|
+
| <a id="property-reseeded"></a> `reseeded` | `boolean` | It is true when this resolve made a new store: at the first resolve, on a change of the viewKey, in the fallback for each emission, and on a change of the actor. A provider that mounts a subtree again for each store, such as the storeKey of Vue, uses this field as its key. | [packages/play-view/src/view-store-lifecycle.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/view-store-lifecycle.ts#L54) |
|
|
15
|
+
| <a id="property-store"></a> `store` | `StateStore` | The store WITHOUT the guard — the reference of the machinery for its own refresh. | [packages/play-view/src/view-store-lifecycle.ts:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/view-store-lifecycle.ts#L40) |
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-view](../../README.md) / [index](../README.md) / Viewable
|
|
2
2
|
|
|
3
3
|
# Interface: Viewable
|
|
4
4
|
|
|
5
|
-
Defined in: [packages/play-
|
|
5
|
+
Defined in: [packages/play-view/src/view-types.ts:88](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/view-types.ts#L88)
|
|
6
6
|
|
|
7
7
|
The actor capability that exposes a renderable view state.
|
|
8
8
|
|
|
@@ -13,6 +13,6 @@ therefore holds no view logic.
|
|
|
13
13
|
|
|
14
14
|
## Properties
|
|
15
15
|
|
|
16
|
-
| Property | Modifier | Type
|
|
17
|
-
| ----------------------------------------------- | ---------- |
|
|
18
|
-
| <a id="property-currentview"></a> `currentView` | `readonly` | [`State`](
|
|
16
|
+
| Property | Modifier | Type | Description | Defined in |
|
|
17
|
+
| ----------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
18
|
+
| <a id="property-currentview"></a> `currentView` | `readonly` | [`State`](../../../play-signals/namespaces/Signal/classes/State.md)\<[`PlaySpec`](PlaySpec.md) \| `null`\> | The signal of the current view. It holds the json-render PlaySpec of the current machine state, or null when no view is active. The infrastructure renders the view. This is the Logic-Driven UI invariant. | [packages/play-view/src/view-types.ts:95](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/view-types.ts#L95) |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-view](../../README.md) / [index](../README.md) / ViewActor
|
|
2
|
+
|
|
3
|
+
# Type Alias: ViewActor\<TSnapshot, TEvent\>
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
type ViewActor<TSnapshot, TEvent> = PlayActor<TSnapshot, TEvent> & Viewable;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/play-view/src/view-types.ts:135](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/view-types.ts#L135)
|
|
10
|
+
|
|
11
|
+
The actor that a view provider reads: the contract, and the view capability.
|
|
12
|
+
|
|
13
|
+
It names NO engine. A provider reads `currentView` and `send`, and nothing else — the
|
|
14
|
+
measurement is 20 reads of `currentView` and 16 of `send` across the five renderers, and
|
|
15
|
+
no read of any other member. The type said `ViewActor`
|
|
16
|
+
before, which named XState in every renderer AND erased the snapshot and the event union
|
|
17
|
+
of the machine at the same time.
|
|
18
|
+
|
|
19
|
+
It does NOT name `Routable`. The view implies no routing.
|
|
20
|
+
|
|
21
|
+
## Type Parameters
|
|
22
|
+
|
|
23
|
+
| Type Parameter | Default type | Description |
|
|
24
|
+
| ------------------------------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------- |
|
|
25
|
+
| `TSnapshot` | `unknown` | The snapshot type that `state` holds. |
|
|
26
|
+
| `TEvent` _extends_ [`ActorEvent`](../../../play-actor/interfaces/ActorEvent.md) | [`ActorEvent`](../../../play-actor/interfaces/ActorEvent.md) | The event union that `send` accepts. |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[API](
|
|
1
|
+
[API](../../../../README.md) / [@xmachines/play-view](../../README.md) / [index](../README.md) / CONTEXT\_STATE\_KEY
|
|
2
2
|
|
|
3
3
|
# Variable: CONTEXT\_STATE\_KEY
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const CONTEXT_STATE_KEY: "context" = "context";
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-
|
|
9
|
+
Defined in: [packages/play-view/src/context-projection.ts:34](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-view/src/context-projection.ts#L34)
|
|
10
10
|
|
|
11
11
|
The reserved top-level state key of the projection.
|
|
12
12
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> Vue 3 renderer for the XMachines Play Architecture. It observes the actor signals and renders the UI through `@xmachines/json-render-vue`.
|
|
6
6
|
|
|
7
|
-
[](https://opensource.org/licenses/MIT) [](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@xmachines/play-vue)
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -29,7 +29,7 @@ pnpm add @xmachines/play-vue
|
|
|
29
29
|
**Peer dependencies.** Install them with the package:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
pnpm add vue@^3.5.0
|
|
32
|
+
pnpm add vue@^3.5.0 @xstate/store@^3.17.0 @xmachines/json-render-vue@^0.20.0-xm.4 @xmachines/json-render-core@^0.20.0-xm.4 @xmachines/json-render-xstate@^0.20.0-xm.4
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
---
|
|
@@ -46,13 +46,15 @@ pnpm add vue@^3.5.0 xstate@^5.31.0 @xstate/store@^3.17.0 @xmachines/json-render-
|
|
|
46
46
|
|
|
47
47
|
<script setup lang="ts">
|
|
48
48
|
import { defineRegistry, PlayUIProvider, PlayRenderer } from "@xmachines/play-vue";
|
|
49
|
-
import { definePlayer } from "@xmachines/play-xstate";
|
|
49
|
+
import { definePlayer, compose, PlayerActor } from "@xmachines/play-xstate";
|
|
50
|
+
import { withView } from "@xmachines/play-xstate/view";
|
|
50
51
|
import { myMachine } from "./machine.js";
|
|
51
52
|
import { myCatalog } from "./catalog.js";
|
|
52
53
|
import HomeSFC from "./views/Home.vue";
|
|
53
54
|
import LoginSFC from "./views/Login.vue";
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
// A renderer needs the view capability
|
|
57
|
+
const createPlayer = definePlayer({ machine: myMachine, actor: compose(PlayerActor, withView) });
|
|
56
58
|
const actor = createPlayer();
|
|
57
59
|
actor.start();
|
|
58
60
|
|
|
@@ -79,17 +81,32 @@ const registryResult = defineRegistry(myCatalog, {
|
|
|
79
81
|
|
|
80
82
|
The composite provider. It wraps `<ActorProvider>` and `JSONUIProvider` in one component. **Use it in most applications.**
|
|
81
83
|
|
|
82
|
-
| Prop | Type
|
|
83
|
-
| --------------------- |
|
|
84
|
-
| `actor` | `
|
|
85
|
-
| `registryResult` | `DefineRegistryResult`
|
|
86
|
-
| `store` | `StateStore`
|
|
87
|
-
| `onRenderError` | `RenderErrorHandler`
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
90
|
-
| `
|
|
84
|
+
| Prop | Type | Required | Description |
|
|
85
|
+
| --------------------- | --------------------------------------------- | -------- | ---------------------------------------------------------------------- |
|
|
86
|
+
| `actor` | `PlayActor & Viewable` | ✅ | The XMachines actor instance |
|
|
87
|
+
| `registryResult` | `DefineRegistryResult` | ✅ | Result of `defineRegistry()` |
|
|
88
|
+
| `store` | `StateStore` | — | External controlled state store (optional) |
|
|
89
|
+
| `onRenderError` | `RenderErrorHandler` | — | Error handler for render failures |
|
|
90
|
+
| `onError` | `(error: unknown, reset: () => void) => void` | — | Error handler of the outer boundary; the second parameter is the reset |
|
|
91
|
+
| `navigate` | `(path: string) => void` | — | Link navigation function |
|
|
92
|
+
| `validationFunctions` | `Record<string, Function>` | — | Custom validation functions |
|
|
93
|
+
| `functions` | `Record<string, Function>` | — | Named functions for `$computed` expressions |
|
|
91
94
|
|
|
92
|
-
**Slots:** `default` (the rendered content), `fallback` (the content while the actor view is `null
|
|
95
|
+
**Slots:** `default` (the rendered content), `fallback` (the content while the actor view is `null`, and while the boundary holds an error)
|
|
96
|
+
|
|
97
|
+
The provider contains an error of the **render** of a descendant — the render function, the setup function, and a lifecycle hook — so that a subtree that throws cannot take the whole application down. It calls `onError`, and it renders the `fallback` slot instead of the children. The next view emission clears the error, so a view transition retries the render. A throw of a catalog component reaches the per-element boundary of `@xmachines/json-render-vue` first, and `onRenderError` reports it; this boundary is the outer net for everything else.
|
|
98
|
+
|
|
99
|
+
The boundary stops a render error, so `app.config.errorHandler` sees it no longer. Without an `onError` prop the provider therefore writes the error to `console.error`.
|
|
100
|
+
|
|
101
|
+
The second parameter is the **reset**, for a retry that the host starts. It renders the view that the actor holds at the moment of the call, so a retry cannot rewind the screen to the view that failed. A reset that the host calls from inside the handler does nothing, because no input changed between the two attempts, and a reset after the provider goes away does nothing. The five renderers hold the same three rules.
|
|
102
|
+
|
|
103
|
+
**A handler that throws reaches no caller.** The provider contains that throw, and it writes the throw to `console.error`. The errored flag schedules a render, so a throw that left the handler would stop that render and skip the `return false` of `onErrorCaptured`: the subtree that threw stays on the screen and the error reaches `app.config.errorHandler` as well. Report a failure from `onError`. To escalate one, raise it from a task of your own — `queueMicrotask(() => { throw error; })` — which reaches the global handler of the page and leaves the containment whole. The five renderers hold this one rule.
|
|
104
|
+
|
|
105
|
+
`onErrorCaptured` of Vue also fires for an error of an **event handler** and of a **watcher callback**, which the boundaries of React, Solid, and Svelte each see never. The provider leaves such an error alone: the view stays on the screen, `onError` stays silent, and the error continues to `app.config.errorHandler` exactly as it does without this provider. A click handler that throws therefore does not replace your view with the fallback, and it reaches your global handler one time. `onError` reports a failure of the render, in every renderer.
|
|
106
|
+
|
|
107
|
+
Vue reports such an error a **second** time where the application wires no `app.config.errorHandler`: it re-throws the error, and a queued job carries it back as a failure of a render. The provider recognises that repeat and holds the view. It writes the error value to `console.error` with the name of this package, because Vue writes that value nowhere on this path, and `onError` stays silent. A development build re-throws every time, and a production build only where the application sets `app.config.throwUnhandledErrorInProduction`.
|
|
108
|
+
|
|
109
|
+
**One case escapes that rule.** An ancestor `errorCaptured` hook that returns `false` stops Vue before the re-throw, so the record of the provider waits for a repeat that never comes. A second failure in the same flush can take that record. It must carry the same error value, and it must unwind out of the update job of a parent. Vue reports such a failure as a component update. The provider then holds the stale subtree on the screen, and `onError` stays silent.
|
|
93
110
|
|
|
94
111
|
#### `<PlayRenderer>`
|
|
95
112
|
|
|
@@ -105,12 +122,12 @@ The leaf component without props. It reads the current `spec` and `registry` fro
|
|
|
105
122
|
|
|
106
123
|
The low-level provider for a custom provider composition. It owns the complete actor lifecycle: the signal subscription, the state store of each view, the handler resolution, and the Vue context. Use `<PlayUIProvider>` when you do not need this control.
|
|
107
124
|
|
|
108
|
-
| Prop | Type
|
|
109
|
-
| ---------------- |
|
|
110
|
-
| `actor` | `
|
|
111
|
-
| `registryResult` | `DefineRegistryResult`
|
|
112
|
-
| `store` | `StateStore`
|
|
113
|
-
| `onRenderError` | `RenderErrorHandler`
|
|
125
|
+
| Prop | Type | Required | Description |
|
|
126
|
+
| ---------------- | ---------------------- | -------- | ------------------------------- |
|
|
127
|
+
| `actor` | `PlayActor & Viewable` | ✅ | The XMachines actor instance |
|
|
128
|
+
| `registryResult` | `DefineRegistryResult` | ✅ | Result of `defineRegistry()` |
|
|
129
|
+
| `store` | `StateStore` | — | External controlled state store |
|
|
130
|
+
| `onRenderError` | `RenderErrorHandler` | — | Override render error handler |
|
|
114
131
|
|
|
115
132
|
---
|
|
116
133
|
|
|
@@ -169,7 +186,14 @@ const view = usePlayView();
|
|
|
169
186
|
// view.spec, view.handlers, view.registry, view.store
|
|
170
187
|
```
|
|
171
188
|
|
|
172
|
-
> **
|
|
189
|
+
> **Read a field where you use it, and destructure it not.** The value is a live view of
|
|
190
|
+
> the provider, so `const { spec } = usePlayView()` freezes at the first read and the
|
|
191
|
+
> screen stops following the actor — with no error and no warning. Write `view.spec` at
|
|
192
|
+
> the place that needs it.
|
|
193
|
+
|
|
194
|
+
`usePlayView()` returns a **Proxy**: every property read goes to the live context of the provider.
|
|
195
|
+
|
|
196
|
+
> **Note:** `usePlayView` was named `getPlayViewContext` before. That alias is gone.
|
|
173
197
|
|
|
174
198
|
---
|
|
175
199
|
|
|
@@ -185,25 +209,6 @@ This package re-exports the following, so that a consumer imports everything fro
|
|
|
185
209
|
|
|
186
210
|
---
|
|
187
211
|
|
|
188
|
-
## Testing
|
|
189
|
-
|
|
190
|
-
Run tests for this package in isolation:
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
# From the monorepo root
|
|
194
|
-
pnpm --filter @xmachines/play-vue test
|
|
195
|
-
|
|
196
|
-
# Watch mode
|
|
197
|
-
pnpm --filter @xmachines/play-vue run test:watch
|
|
198
|
-
|
|
199
|
-
# With coverage (80% threshold enforced on lines, functions, branches, statements)
|
|
200
|
-
pnpm exec vitest run --coverage --config packages/play-vue/vitest.config.ts
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
The tests use [Vitest](https://vitest.dev/) in a `jsdom` environment. They mount the components with `@vue/test-utils`.
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
212
|
## License
|
|
208
213
|
|
|
209
214
|
MIT — see [LICENSE](LICENSE).
|
|
@@ -231,7 +236,6 @@ everything from `@xmachines/play-vue`, and not from `@xmachines/json-render-vue`
|
|
|
231
236
|
- [StateProviderProps](interfaces/StateProviderProps.md)
|
|
232
237
|
- [ValidationProviderProps](interfaces/ValidationProviderProps.md)
|
|
233
238
|
- [ViewContextValue](interfaces/ViewContextValue.md)
|
|
234
|
-
- [~~VisibilityProviderProps~~](interfaces/VisibilityProviderProps.md)
|
|
235
239
|
|
|
236
240
|
## Type Aliases
|
|
237
241
|
|
|
@@ -245,10 +249,10 @@ everything from `@xmachines/play-vue`, and not from `@xmachines/json-render-vue`
|
|
|
245
249
|
## Variables
|
|
246
250
|
|
|
247
251
|
- [ActionProvider](variables/ActionProvider.md)
|
|
248
|
-
- [~~getPlayViewContext~~](variables/getPlayViewContext.md)
|
|
249
252
|
- [JSONUIProvider](variables/JSONUIProvider.md)
|
|
250
253
|
- [PlayRenderer](variables/PlayRenderer.md)
|
|
251
254
|
- [Renderer](variables/Renderer.md)
|
|
255
|
+
- [schema](variables/schema.md)
|
|
252
256
|
- [StateProvider](variables/StateProvider.md)
|
|
253
257
|
- [ValidationProvider](variables/ValidationProvider.md)
|
|
254
258
|
- [VisibilityProvider](variables/VisibilityProvider.md)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function defineRegistry<C>(catalog, options): DefineRegistryResult;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-vue/src/define-registry.ts:138](https://gitlab.com/xmachin-es/xmachines-js/-/blob/
|
|
9
|
+
Defined in: [packages/play-vue/src/define-registry.ts:138](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-vue/src/define-registry.ts#L138)
|
|
10
10
|
|
|
11
11
|
Creates a component registry. It wraps each `.vue` SFC, so that the SFC works
|
|
12
12
|
correctly with the render pipeline of `@xmachines/json-render-vue`.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function useActor(): AnyPlayActor;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-vue/src/useActor.ts:
|
|
9
|
+
Defined in: [packages/play-vue/src/useActor.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-vue/src/useActor.ts#L71)
|
|
10
10
|
|
|
11
11
|
## Returns
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
function usePlayView(): ViewContextValue;
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/play-vue/src/actor-provider-context.ts:
|
|
9
|
+
Defined in: [packages/play-vue/src/actor-provider-context.ts:51](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v4.0.0/packages/play-vue/src/actor-provider-context.ts#L51)
|
|
10
10
|
|
|
11
11
|
Returns the current ViewContextValue inside an ActorProvider tree.
|
|
12
12
|
|
|
@@ -26,3 +26,8 @@ import { usePlayView } from "@xmachines/play-vue";
|
|
|
26
26
|
const view = usePlayView();
|
|
27
27
|
// view.spec, view.handlers, view.registry
|
|
28
28
|
```
|
|
29
|
+
|
|
30
|
+
**Read a field where you use it, and destructure it not.** The return value is a Proxy
|
|
31
|
+
over the live context of the provider, so `const { spec } = usePlayView()` freezes at
|
|
32
|
+
the first read and the screen stops following the actor — with no error and no
|
|
33
|
+
warning. play-svelte and play-solid hold the same rule, for the same reason.
|