@xmachines/docs 1.0.0-beta.46 → 1.0.0-beta.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/README.md +135 -7
  2. package/api/@xmachines/play/README.md +134 -57
  3. package/api/@xmachines/play/classes/NonNullableError.md +4 -4
  4. package/api/@xmachines/play/classes/PlayError.md +4 -4
  5. package/api/@xmachines/play/functions/assertNonNullable.md +1 -1
  6. package/api/@xmachines/play/type-aliases/PlayEvent.md +2 -2
  7. package/api/@xmachines/play-actor/README.md +130 -155
  8. package/api/@xmachines/play-actor/classes/AbstractActor.md +3 -3
  9. package/api/@xmachines/play-actor/functions/typedSpec.md +1 -1
  10. package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +5 -5
  11. package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +5 -5
  12. package/api/@xmachines/play-actor/interfaces/PlaySpec.md +2 -2
  13. package/api/@xmachines/play-actor/interfaces/Routable.md +3 -3
  14. package/api/@xmachines/play-actor/interfaces/Viewable.md +2 -2
  15. package/api/@xmachines/play-dom/README.md +140 -232
  16. package/api/@xmachines/play-dom/classes/PlayRenderer.md +4 -4
  17. package/api/@xmachines/play-dom/functions/connectRenderer.md +1 -1
  18. package/api/@xmachines/play-dom/functions/createPlayUI.md +1 -1
  19. package/api/@xmachines/play-dom/functions/createRenderer.md +1 -1
  20. package/api/@xmachines/play-dom/functions/defineRegistry.md +1 -1
  21. package/api/@xmachines/play-dom/functions/renderSpec.md +1 -1
  22. package/api/@xmachines/play-dom/interfaces/ComponentContext.md +7 -7
  23. package/api/@xmachines/play-dom/interfaces/ConnectRendererOptions.md +13 -13
  24. package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +6 -6
  25. package/api/@xmachines/play-dom/interfaces/DefineRegistryResult.md +4 -4
  26. package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +12 -12
  27. package/api/@xmachines/play-dom/interfaces/EventHandle.md +4 -4
  28. package/api/@xmachines/play-dom/interfaces/MountOptions.md +3 -3
  29. package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +5 -5
  30. package/api/@xmachines/play-dom/interfaces/UIProviderOptions.md +5 -5
  31. package/api/@xmachines/play-dom/type-aliases/ActionFn.md +1 -1
  32. package/api/@xmachines/play-dom/type-aliases/Actions.md +1 -1
  33. package/api/@xmachines/play-dom/type-aliases/BaseComponentProps.md +7 -7
  34. package/api/@xmachines/play-dom/type-aliases/CatalogHasActions.md +1 -1
  35. package/api/@xmachines/play-dom/type-aliases/ComponentFn.md +1 -1
  36. package/api/@xmachines/play-dom/type-aliases/ComponentRegistry.md +1 -1
  37. package/api/@xmachines/play-dom/type-aliases/DefineRegistryOptions.md +2 -2
  38. package/api/@xmachines/play-dom/type-aliases/DomComponentRenderer.md +1 -1
  39. package/api/@xmachines/play-dom/type-aliases/DomRegistry.md +1 -1
  40. package/api/@xmachines/play-dom/type-aliases/DomSchema.md +1 -1
  41. package/api/@xmachines/play-dom/type-aliases/MountFn.md +1 -1
  42. package/api/@xmachines/play-dom/type-aliases/SetState.md +1 -1
  43. package/api/@xmachines/play-dom/variables/schema.md +1 -1
  44. package/api/@xmachines/play-dom-router/README.md +160 -158
  45. package/api/@xmachines/play-dom-router/functions/connectRouter.md +1 -1
  46. package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +1 -1
  47. package/api/@xmachines/play-dom-router/functions/createRouteMap.md +1 -1
  48. package/api/@xmachines/play-dom-router/functions/createRouter.md +1 -1
  49. package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +14 -14
  50. package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +14 -14
  51. package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +4 -4
  52. package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +6 -6
  53. package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
  54. package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +3 -3
  55. package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +2 -2
  56. package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
  57. package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +3 -3
  58. package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +4 -4
  59. package/api/@xmachines/play-dom-router/type-aliases/RoutableActor.md +1 -1
  60. package/api/@xmachines/play-react/README.md +109 -320
  61. package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +5 -5
  62. package/api/@xmachines/play-react/functions/useActor.md +1 -1
  63. package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
  64. package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
  65. package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +8 -8
  66. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +4 -4
  67. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +3 -3
  68. package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +8 -8
  69. package/api/@xmachines/play-react/interfaces/ViewContextValue.md +5 -5
  70. package/api/@xmachines/play-react/type-aliases/PlayActor.md +1 -1
  71. package/api/@xmachines/play-react/variables/ActorProvider.md +1 -1
  72. package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
  73. package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
  74. package/api/@xmachines/play-react-router/README.md +107 -124
  75. package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +23 -23
  76. package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
  77. package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +1 -1
  78. package/api/@xmachines/play-react-router/functions/createRouteMap.md +1 -1
  79. package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
  80. package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +6 -6
  81. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +5 -5
  82. package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +2 -2
  83. package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
  84. package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
  85. package/api/@xmachines/play-router/README.md +235 -475
  86. package/api/@xmachines/play-router/classes/RouteMap.md +4 -4
  87. package/api/@xmachines/play-router/classes/RouterBridgeBase.md +23 -23
  88. package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +1 -1
  89. package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
  90. package/api/@xmachines/play-router/functions/createRouteMap.md +1 -1
  91. package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +1 -1
  92. package/api/@xmachines/play-router/functions/createRouteMatcher.md +1 -1
  93. package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +1 -1
  94. package/api/@xmachines/play-router/functions/extractMachineRoutes.md +1 -1
  95. package/api/@xmachines/play-router/functions/extractQuery.md +1 -1
  96. package/api/@xmachines/play-router/functions/extractRouteParams.md +1 -1
  97. package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
  98. package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
  99. package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
  100. package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
  101. package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +1 -1
  102. package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
  103. package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
  104. package/api/@xmachines/play-router/functions/routeExists.md +1 -1
  105. package/api/@xmachines/play-router/functions/sanitizePathname.md +1 -1
  106. package/api/@xmachines/play-router/functions/validateRouteFormat.md +1 -1
  107. package/api/@xmachines/play-router/functions/validateStateExists.md +1 -1
  108. package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
  109. package/api/@xmachines/play-router/interfaces/LocationLike.md +3 -3
  110. package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +3 -3
  111. package/api/@xmachines/play-router/interfaces/MachineNodeData.md +5 -5
  112. package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +6 -6
  113. package/api/@xmachines/play-router/interfaces/RouteInfo.md +8 -8
  114. package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +2 -2
  115. package/api/@xmachines/play-router/interfaces/RouteMapping.md +3 -3
  116. package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
  117. package/api/@xmachines/play-router/interfaces/RouteMatcher.md +4 -4
  118. package/api/@xmachines/play-router/interfaces/RouteNode.md +10 -10
  119. package/api/@xmachines/play-router/interfaces/RouteObject.md +2 -2
  120. package/api/@xmachines/play-router/interfaces/RouteTree.md +5 -5
  121. package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +3 -3
  122. package/api/@xmachines/play-router/interfaces/RouterBridge.md +3 -3
  123. package/api/@xmachines/play-router/interfaces/WindowLike.md +3 -3
  124. package/api/@xmachines/play-router/type-aliases/MachineGraph.md +1 -1
  125. package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
  126. package/api/@xmachines/play-signals/README.md +105 -73
  127. package/api/@xmachines/play-signals/functions/watchSignal.md +1 -1
  128. package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +2 -2
  129. package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
  130. package/api/@xmachines/play-signals/interfaces/SignalOptions.md +2 -2
  131. package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
  132. package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
  133. package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
  134. package/api/@xmachines/play-solid/README.md +117 -263
  135. package/api/@xmachines/play-solid/functions/useActor.md +1 -1
  136. package/api/@xmachines/play-solid/functions/usePlayView.md +1 -1
  137. package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +8 -8
  138. package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +8 -8
  139. package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +5 -5
  140. package/api/@xmachines/play-solid/type-aliases/PlayActor.md +1 -1
  141. package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
  142. package/api/@xmachines/play-solid/variables/ActorProvider.md +1 -1
  143. package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
  144. package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
  145. package/api/@xmachines/play-solid-router/README.md +93 -606
  146. package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
  147. package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +24 -24
  148. package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +1 -1
  149. package/api/@xmachines/play-solid-router/functions/createRouteMap.md +1 -1
  150. package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +3 -3
  151. package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +6 -6
  152. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
  153. package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +2 -2
  154. package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
  155. package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
  156. package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
  157. package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
  158. package/api/@xmachines/play-svelte/README.md +111 -103
  159. package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
  160. package/api/@xmachines/play-svelte/functions/getActorContext.md +1 -1
  161. package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +1 -1
  162. package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
  163. package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +8 -8
  164. package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
  165. package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +11 -11
  166. package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +5 -5
  167. package/api/@xmachines/play-svelte/type-aliases/PlayActor.md +1 -1
  168. package/api/@xmachines/play-svelte-spa-router/README.md +156 -17
  169. package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +4 -4
  170. package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +1 -1
  171. package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +1 -1
  172. package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +4 -4
  173. package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +6 -6
  174. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +2 -2
  175. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
  176. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
  177. package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
  178. package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
  179. package/api/@xmachines/play-sveltekit-router/README.md +168 -17
  180. package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +4 -4
  181. package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +1 -1
  182. package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +1 -1
  183. package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +4 -4
  184. package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
  185. package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +6 -6
  186. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +2 -2
  187. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
  188. package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +3 -3
  189. package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
  190. package/api/@xmachines/play-tanstack-react-router/README.md +147 -122
  191. package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
  192. package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +23 -23
  193. package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +1 -1
  194. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +1 -1
  195. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +1 -1
  196. package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +1 -1
  197. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +6 -6
  198. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +5 -5
  199. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +2 -2
  200. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
  201. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +3 -3
  202. package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +3 -3
  203. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
  204. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +4 -4
  205. package/api/@xmachines/play-tanstack-solid-router/README.md +195 -173
  206. package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
  207. package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +24 -24
  208. package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +1 -1
  209. package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
  210. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +6 -6
  211. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +5 -5
  212. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +2 -2
  213. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
  214. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
  215. package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +1 -1
  216. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
  217. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +3 -3
  218. package/api/@xmachines/play-vue/README.md +126 -271
  219. package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
  220. package/api/@xmachines/play-vue/functions/getPlayViewContext.md +1 -1
  221. package/api/@xmachines/play-vue/functions/useActor.md +1 -1
  222. package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +5 -5
  223. package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +8 -8
  224. package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +5 -5
  225. package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +1 -1
  226. package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
  227. package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
  228. package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
  229. package/api/@xmachines/play-vue/type-aliases/PlayActor.md +1 -1
  230. package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
  231. package/api/@xmachines/play-vue-router/README.md +148 -528
  232. package/api/@xmachines/play-vue-router/classes/RouteMap.md +4 -4
  233. package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +24 -24
  234. package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
  235. package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +6 -6
  236. package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +2 -2
  237. package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +3 -3
  238. package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +3 -3
  239. package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +1 -1
  240. package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +1 -1
  241. package/api/@xmachines/play-xstate/README.md +167 -496
  242. package/api/@xmachines/play-xstate/classes/PlayerActor.md +12 -12
  243. package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +1 -1
  244. package/api/@xmachines/play-xstate/functions/composeGuards.md +1 -1
  245. package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +1 -1
  246. package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +1 -1
  247. package/api/@xmachines/play-xstate/functions/definePlayer.md +1 -1
  248. package/api/@xmachines/play-xstate/functions/deriveRoute.md +1 -1
  249. package/api/@xmachines/play-xstate/functions/eventMatches.md +1 -1
  250. package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +1 -1
  251. package/api/@xmachines/play-xstate/functions/hasContext.md +1 -1
  252. package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +1 -1
  253. package/api/@xmachines/play-xstate/functions/negateGuard.md +1 -1
  254. package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +3 -3
  255. package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
  256. package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +6 -6
  257. package/api/@xmachines/play-xstate/interfaces/RouteContext.md +5 -5
  258. package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +1 -1
  259. package/api/@xmachines/play-xstate/type-aliases/Guard.md +1 -1
  260. package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +1 -1
  261. package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +1 -1
  262. package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +4 -4
  263. package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
  264. package/api/@xmachines/shared/README.md +81 -294
  265. package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
  266. package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
  267. package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
  268. package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
  269. package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
  270. package/examples/@xmachines/play-dom-demo/README.md +3 -3
  271. package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +1 -1
  272. package/examples/@xmachines/play-dom-demo/functions/initShell.md +1 -1
  273. package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +1 -1
  274. package/examples/@xmachines/play-dom-demo/variables/About.md +1 -1
  275. package/examples/@xmachines/play-dom-demo/variables/Contact.md +1 -1
  276. package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +1 -1
  277. package/examples/@xmachines/play-dom-demo/variables/Home.md +1 -1
  278. package/examples/@xmachines/play-dom-demo/variables/Login.md +1 -1
  279. package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +1 -1
  280. package/examples/@xmachines/play-dom-demo/variables/Navigation.md +1 -1
  281. package/examples/@xmachines/play-dom-demo/variables/Overview.md +1 -1
  282. package/examples/@xmachines/play-dom-demo/variables/Profile.md +1 -1
  283. package/examples/@xmachines/play-dom-demo/variables/Settings.md +1 -1
  284. package/examples/@xmachines/play-dom-demo/variables/Stats.md +1 -1
  285. package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +1 -1
  286. package/examples/@xmachines/play-dom-router-demo/README.md +2 -2
  287. package/examples/@xmachines/play-react-demo/README.md +1 -1
  288. package/examples/@xmachines/play-react-demo/functions/App.md +1 -1
  289. package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +1 -1
  290. package/examples/@xmachines/play-react-demo/variables/About.md +1 -1
  291. package/examples/@xmachines/play-react-demo/variables/Contact.md +1 -1
  292. package/examples/@xmachines/play-react-demo/variables/Dashboard.md +1 -1
  293. package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +1 -1
  294. package/examples/@xmachines/play-react-demo/variables/Home.md +1 -1
  295. package/examples/@xmachines/play-react-demo/variables/Login.md +1 -1
  296. package/examples/@xmachines/play-react-demo/variables/NavBar.md +1 -1
  297. package/examples/@xmachines/play-react-demo/variables/NavBarView.md +1 -1
  298. package/examples/@xmachines/play-react-demo/variables/Navigation.md +1 -1
  299. package/examples/@xmachines/play-react-demo/variables/Overview.md +1 -1
  300. package/examples/@xmachines/play-react-demo/variables/Profile.md +1 -1
  301. package/examples/@xmachines/play-react-demo/variables/Settings.md +1 -1
  302. package/examples/@xmachines/play-react-demo/variables/Shell.md +1 -1
  303. package/examples/@xmachines/play-react-demo/variables/Stats.md +1 -1
  304. package/examples/@xmachines/play-react-demo/variables/authCatalog.md +1 -1
  305. package/examples/@xmachines/play-react-router-demo/README.md +1 -1
  306. package/examples/@xmachines/play-solid-demo/README.md +1 -1
  307. package/examples/@xmachines/play-solid-demo/functions/App.md +1 -1
  308. package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +1 -1
  309. package/examples/@xmachines/play-solid-demo/variables/About.md +1 -1
  310. package/examples/@xmachines/play-solid-demo/variables/Contact.md +1 -1
  311. package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +1 -1
  312. package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +1 -1
  313. package/examples/@xmachines/play-solid-demo/variables/Home.md +1 -1
  314. package/examples/@xmachines/play-solid-demo/variables/Login.md +1 -1
  315. package/examples/@xmachines/play-solid-demo/variables/NavBar.md +1 -1
  316. package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +1 -1
  317. package/examples/@xmachines/play-solid-demo/variables/Navigation.md +1 -1
  318. package/examples/@xmachines/play-solid-demo/variables/Overview.md +1 -1
  319. package/examples/@xmachines/play-solid-demo/variables/Profile.md +1 -1
  320. package/examples/@xmachines/play-solid-demo/variables/Settings.md +1 -1
  321. package/examples/@xmachines/play-solid-demo/variables/Shell.md +1 -1
  322. package/examples/@xmachines/play-solid-demo/variables/Stats.md +1 -1
  323. package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +1 -1
  324. package/examples/@xmachines/play-svelte-demo/README.md +1 -1
  325. package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +1 -1
  326. package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +1 -1
  327. package/examples/@xmachines/play-svelte-spa-router-demo/README.md +2 -2
  328. package/examples/@xmachines/play-sveltekit-router-demo/README.md +2 -2
  329. package/examples/@xmachines/play-vue-demo/README.md +1 -1
  330. package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +1 -1
  331. package/examples/@xmachines/play-vue-demo/variables/App.md +1 -1
  332. package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +1 -1
  333. package/examples/README.md +24 -25
  334. package/examples/form-validation.md +2 -2
  335. package/guides/README.md +7 -7
  336. package/guides/actor-model.md +18 -18
  337. package/guides/architecture.md +500 -0
  338. package/guides/configuration.md +556 -0
  339. package/guides/deployment.md +336 -0
  340. package/guides/development.md +617 -0
  341. package/guides/getting-started.md +351 -142
  342. package/guides/signals.md +19 -19
  343. package/guides/state-machines.md +16 -16
  344. package/guides/testing.md +460 -0
  345. package/package.json +5 -5
  346. package/guides/installation.md +0 -257
@@ -1,50 +1,95 @@
1
1
  <!-- generated-by: gsd-doc-writer -->
2
2
 
3
- # Getting Started
3
+ # Getting Started with XMachines Play
4
4
 
5
- Welcome to XMachines! This guide gets you from zero to a running actor using the current XState v5 + XMachines API.
5
+ This guide walks you through installing XMachines packages, wiring a state machine with [`definePlayer`](../api/@xmachines/play-xstate/functions/definePlayer.md), connecting a view renderer, and plugging in a router adapter from zero to a running actor-driven application.
6
6
 
7
- ## What is XMachines?
7
+ ---
8
8
 
9
- XMachines is a TypeScript implementation of the Universal Player Architecture — a state machine system that strictly separates business logic from infrastructure. State machines (actors) control routing, views, and navigation through TC39 Signals. Infrastructure (routers, renderers, React components) passively observes and reflects actor state.
9
+ ## Prerequisites
10
10
 
11
- Your state machines have **zero framework dependencies**. Routers and renderers are optional adapters.
11
+ - **Node.js** `>= 22.0.0`
12
+ - **npm** `>= 10.0.0`
13
+ - **TypeScript** `>= 5.7` (strict mode recommended)
14
+ - **XState** `v5` (required peer dependency for [`@xmachines/play-xstate`](../api/@xmachines/play-xstate/README.md))
15
+
16
+ All packages are ES modules (`"type": "module"`). Use `.js` extensions in all TypeScript imports.
17
+
18
+ ---
12
19
 
13
20
  ## Installation
14
21
 
15
- Install the core packages (see [Installation →](installation.md) for the full package guide):
22
+ ### Step 1: Install the core packages
23
+
24
+ Every XMachines application needs these three packages plus XState:
25
+
26
+ ```bash
27
+ npm install xstate @xmachines/play-xstate @xmachines/play-actor @xmachines/play-signals
28
+ ```
29
+
30
+ | Package | Role |
31
+ | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
32
+ | `xstate` | XState v5 state machine engine (peer dependency) |
33
+ | [`@xmachines/play-xstate`](../api/@xmachines/play-xstate/README.md) | [`definePlayer()`](../api/@xmachines/play-xstate/functions/definePlayer.md), [`PlayerActor`](../api/@xmachines/play-xstate/classes/PlayerActor.md), routing helpers |
34
+ | [`@xmachines/play-actor`](../api/@xmachines/play-actor/README.md) | Abstract actor base class and interface types |
35
+ | [`@xmachines/play-signals`](../api/@xmachines/play-signals/README.md) | TC39 Signals polyfill (`Signal.State`, `Signal.Computed`, [`watchSignal`](../api/@xmachines/play-signals/functions/watchSignal.md)) |
36
+
37
+ ### Step 2: Install a router adapter (pick one)
38
+
39
+ ```bash
40
+ # Framework-integrated routers (provider pattern)
41
+ npm install @xmachines/play-tanstack-react-router # TanStack Router (React)
42
+ npm install @xmachines/play-tanstack-solid-router # TanStack Router (SolidJS)
43
+ npm install @xmachines/play-react-router # React Router v7
44
+ npm install @xmachines/play-vue-router # Vue Router 4.x/5.x
45
+ npm install @xmachines/play-solid-router # SolidJS Router
46
+
47
+ # connectRouter pattern (framework-agnostic)
48
+ npm install @xmachines/play-dom-router # Vanilla DOM (Browser History API)
49
+ npm install @xmachines/play-sveltekit-router # SvelteKit
50
+ npm install @xmachines/play-svelte-spa-router # Svelte SPA Router
51
+ ```
52
+
53
+ ### Step 3: Install a view renderer (pick one)
16
54
 
17
55
  ```bash
18
- npm install @xmachines/play-xstate @xmachines/play-actor @xmachines/play-signals xstate
56
+ npm install @xmachines/play-react # React 18/19
57
+ npm install @xmachines/play-vue # Vue 3
58
+ npm install @xmachines/play-solid # SolidJS
59
+ npm install @xmachines/play-svelte # Svelte 5
60
+ npm install @xmachines/play-dom # Vanilla DOM
19
61
  ```
20
62
 
21
- ## Step 1: Define a Machine
63
+ ---
64
+
65
+ ## First Run: Core Actor (No Router, No Renderer)
22
66
 
23
- Use `setup({ types })` from XState v5 to declare types, then call `setup.createMachine()`:
67
+ The minimum viable XMachines actor no framework dependencies:
24
68
 
25
69
  ```typescript
26
70
  import { setup } from "xstate";
71
+ import { definePlayer } from "@xmachines/play-xstate";
27
72
 
28
- const toggleSetup = setup({
73
+ // 1. Declare types with setup() — the XState v5 typed entry point
74
+ const appSetup = setup({
29
75
  types: {
30
76
  context: {} as { count: number },
31
77
  events: {} as { type: "toggle" },
32
- input: {} as { count?: number } | undefined,
78
+ input: {} as undefined,
33
79
  },
34
80
  });
35
81
 
36
- const toggleMachine = toggleSetup.createMachine({
37
- id: "toggle",
82
+ // 2. Create the machine using setup().createMachine()
83
+ const machine = appSetup.createMachine({
84
+ id: "app",
38
85
  initial: "off",
39
- context: ({ input }) => ({
40
- count: input?.count ?? 0,
41
- }),
86
+ context: { count: 0 },
42
87
  states: {
43
88
  off: {
44
89
  on: {
45
90
  toggle: {
46
91
  target: "on",
47
- actions: toggleSetup.assign({ count: ({ context }) => context.count + 1 }),
92
+ actions: appSetup.assign({ count: ({ context }) => context.count + 1 }),
48
93
  },
49
94
  },
50
95
  },
@@ -52,70 +97,46 @@ const toggleMachine = toggleSetup.createMachine({
52
97
  on: {
53
98
  toggle: {
54
99
  target: "off",
55
- actions: toggleSetup.assign({ count: ({ context }) => context.count + 1 }),
100
+ actions: appSetup.assign({ count: ({ context }) => context.count + 1 }),
56
101
  },
57
102
  },
58
103
  },
59
104
  },
60
105
  });
61
- ```
62
106
 
63
- **Key rules:**
107
+ // 3. Create a player factory
108
+ const createPlayer = definePlayer({ machine });
64
109
 
65
- - Always use `setup({ types })` before `createMachine` — not the bare `createMachine` from xstate.
66
- - Use `setup.assign(...)` (not the bare `assign` from xstate) for context mutations.
67
- - Event types use lowercase dot-separated names: `"toggle"`, `"auth.login"`, `"play.route"`.
68
-
69
- ## Step 2: Define a Player
70
-
71
- `definePlayer` wraps the machine in a factory. Each call to the factory creates an independent `PlayerActor` instance:
72
-
73
- ```typescript
74
- import { definePlayer } from "@xmachines/play-xstate";
75
-
76
- const createPlayer = definePlayer({ machine: toggleMachine });
77
- ```
78
-
79
- ## Step 3: Create and Start an Actor
80
-
81
- ```typescript
110
+ // 4. Create and start an actor
82
111
  const actor = createPlayer();
83
112
  actor.start();
84
113
 
85
- // Read initial state
114
+ // 5. Read state
86
115
  console.log(actor.getSnapshot().value); // "off"
87
- console.log(actor.getSnapshot().context); // { count: 0 }
116
+ console.log(actor.state.get().value); // "off" (TC39 Signal)
88
117
 
89
- // Send events
118
+ // 6. Send events — the machine's guards decide all transitions
90
119
  actor.send({ type: "toggle" });
91
120
  console.log(actor.getSnapshot().value); // "on"
92
- console.log(actor.getSnapshot().context.count); // 1
93
121
 
94
- // Cleanup
122
+ // 7. Cleanup
95
123
  actor.stop();
96
124
  ```
97
125
 
98
- ## Step 4: Read State via TC39 Signals
126
+ **Key rules:**
99
127
 
100
- `actor.state` is a `Signal.State<Snapshot>`. Use it when wiring infrastructure that needs to react to state changes:
128
+ - Always use `setup({ types })` before `createMachine` never bare `createMachine` from xstate.
129
+ - Use `setup.assign(...)` for context mutations — not the bare `assign` from xstate.
130
+ - Call `actor.start()` before sending events.
131
+ - Call `actor.stop()` when done to clean up signal subscriptions.
101
132
 
102
- ```typescript
103
- import { watchSignal } from "@xmachines/play-signals";
133
+ ---
104
134
 
105
- // Watch the state signal — callback fires on every transition
106
- const unwatch = watchSignal(actor.state, () => {
107
- console.log("State changed to:", actor.state.get().value);
108
- });
135
+ ## Adding Routing
109
136
 
110
- actor.send({ type: "toggle" }); // logs "State changed to: on"
137
+ State machines control navigation through `meta.route` on states and `play.route` events. The router is passive infrastructure that observes `actor.currentRoute`.
111
138
 
112
- // Stop watching
113
- unwatch();
114
- ```
115
-
116
- ## Step 5: Add Routing (Optional)
117
-
118
- Add `meta.route` to states and wrap the config with `formatPlayRouteTransitions`. The machine's context must include `params` and `query` fields:
139
+ ### Define a routable machine
119
140
 
120
141
  ```typescript
121
142
  import { setup } from "xstate";
@@ -124,24 +145,55 @@ import type { PlayRouteEvent } from "@xmachines/play-router";
124
145
 
125
146
  const appSetup = setup({
126
147
  types: {
148
+ // params and query are REQUIRED for formatPlayRouteTransitions
127
149
  context: {} as {
128
150
  isAuthenticated: boolean;
129
151
  params: Record<string, string>;
130
152
  query: Record<string, string>;
131
153
  },
132
- events: {} as PlayRouteEvent | { type: "auth.login"; username: string },
154
+ events: {} as
155
+ | PlayRouteEvent
156
+ | { type: "auth.login"; username: string }
157
+ | { type: "auth.logout" },
133
158
  input: {} as undefined,
134
159
  },
135
160
  });
136
161
 
137
162
  const appMachine = appSetup.createMachine(
163
+ // formatPlayRouteTransitions auto-generates play.route handlers from id + meta.route pairs
138
164
  formatPlayRouteTransitions({
139
165
  id: "app",
140
166
  initial: "home",
141
167
  context: { isAuthenticated: false, params: {}, query: {} },
142
168
  states: {
143
169
  home: { id: "home", meta: { route: "/" } },
170
+ about: { id: "about", meta: { route: "/about" } },
144
171
  login: { id: "login", meta: { route: "/login" } },
172
+ dashboard: {
173
+ id: "dashboard",
174
+ meta: { route: "/dashboard" },
175
+ // always guard: redirect to /login if not authenticated
176
+ always: {
177
+ guard: ({ context }) => !context.isAuthenticated,
178
+ target: "login",
179
+ },
180
+ },
181
+ profile: { id: "profile", meta: { route: "/profile/:username" } },
182
+ },
183
+ on: {
184
+ "auth.login": {
185
+ target: ".dashboard",
186
+ guard: ({ context }) => !context.isAuthenticated,
187
+ actions: appSetup.assign({
188
+ isAuthenticated: true,
189
+ username: ({ event }) => (event.type === "auth.login" ? event.username : null),
190
+ }),
191
+ },
192
+ "auth.logout": {
193
+ target: ".home",
194
+ guard: ({ context }) => context.isAuthenticated,
195
+ actions: appSetup.assign({ isAuthenticated: false }),
196
+ },
145
197
  },
146
198
  }),
147
199
  );
@@ -150,30 +202,118 @@ const createPlayer = definePlayer({ machine: appMachine });
150
202
  const actor = createPlayer();
151
203
  actor.start();
152
204
 
205
+ // Read the current route via TC39 Signal
153
206
  console.log(actor.currentRoute.get()); // "/"
154
207
 
155
- actor.send({ type: "play.route", to: "#login" });
156
- console.log(actor.currentRoute.get()); // "/login"
208
+ // Navigate — actor guards validate the transition
209
+ actor.send({ type: "play.route", to: "#about" });
210
+ console.log(actor.currentRoute.get()); // "/about"
211
+
212
+ // Attempt a protected route — always guard redirects to login
213
+ actor.send({ type: "play.route", to: "#dashboard" });
214
+ console.log(actor.getSnapshot().value); // "login" (guard fired)
215
+
216
+ // Navigate with params
217
+ actor.send({ type: "auth.login", username: "alice" });
218
+ actor.send({ type: "play.route", to: "#profile", params: { username: "alice" } });
219
+ console.log(actor.currentRoute.get()); // "/profile/alice"
157
220
 
158
221
  actor.stop();
159
222
  ```
160
223
 
161
- ## Step 6: Add a View Registry (Optional)
224
+ **Routing rules:**
225
+
226
+ - Every routable state **must** have an `id` — [`formatPlayRouteTransitions`](../api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md) throws `MissingStateIdError` if absent.
227
+ - Send `play.route` events with `to: "#stateId"` — always use the `id` field prefixed with `#`, never raw URL paths.
228
+ - The machine's context must include `params: Record<string, string>` and `query: Record<string, string>` for [`formatPlayRouteTransitions`](../api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md) to work.
229
+ - Use `always` guards to protect states from direct URL access — these fire even on browser back/forward.
230
+
231
+ ---
232
+
233
+ ## Connecting a Router Adapter
234
+
235
+ Router adapters synchronize `actor.currentRoute` with the browser URL bidirectionally. There are two integration patterns:
162
236
 
163
- Connect a renderer to map `meta.view` specs to real components.
237
+ ### Pattern 1: Provider pattern (React, Vue, SolidJS)
164
238
 
165
- **Vanilla DOM** — use `createRenderer` (one-call pattern):
239
+ ```typescript
240
+ // React + TanStack Router example
241
+ import { useMemo, useEffect } from "react";
242
+ import { createRouter, createRootRoute } from "@tanstack/react-router";
243
+ import {
244
+ PlayRouterProvider,
245
+ createRouteMapFromTree,
246
+ } from "@xmachines/play-tanstack-react-router";
247
+ import { extractMachineRoutes } from "@xmachines/play-router";
248
+
249
+ // Build these OUTSIDE of JSX — must be stable references
250
+ const routeTree = extractMachineRoutes(appMachine);
251
+ const routeMap = createRouteMapFromTree(routeTree);
252
+ const router = createRouter({ routeTree: createRootRoute() });
253
+
254
+ export function App() {
255
+ const actor = useMemo(() => {
256
+ const a = createPlayer();
257
+ a.start();
258
+ return a;
259
+ }, []);
260
+
261
+ useEffect(() => () => { actor.stop(); }, [actor]);
262
+
263
+ return (
264
+ <PlayRouterProvider
265
+ actor={actor}
266
+ router={router}
267
+ routeMap={routeMap}
268
+ renderer={(currentActor) => (
269
+ // Your shell/layout component here
270
+ <Shell actor={currentActor} />
271
+ )}
272
+ />
273
+ );
274
+ }
275
+ ```
276
+
277
+ ### Pattern 2: `connectRouter` pattern (Vanilla DOM, SvelteKit, Svelte)
166
278
 
167
279
  ```typescript
168
- import { createRenderer, schema } from "@xmachines/play-dom";
280
+ import { connectRouter, createRouteMap } from "@xmachines/play-dom-router";
281
+
282
+ const routeMap = createRouteMap(appMachine);
283
+ const actor = createPlayer();
284
+ actor.start();
285
+
286
+ // connectRouter handles bidirectional sync:
287
+ // - actor.currentRoute signal → browser URL
288
+ // - browser URL changes → play.route event sent to actor
289
+ const disconnectRouter = connectRouter({ actor, routeMap });
290
+
291
+ // Cleanup on unload
292
+ window.addEventListener("beforeunload", () => {
293
+ disconnectRouter();
294
+ actor.stop();
295
+ });
296
+ ```
297
+
298
+ ---
299
+
300
+ ## Connecting a View Renderer
301
+
302
+ View renderers map `meta.view` specs from your machine states to real UI components. Each framework has a [`defineRegistry`](../api/@xmachines/play-dom/functions/defineRegistry.md) function that binds components and actions to a catalog.
303
+
304
+ ### Vanilla DOM
305
+
306
+ ```typescript
307
+ import { createPlayUI, defineRegistry, schema } from "@xmachines/play-dom";
169
308
  import { defineCatalog } from "@json-render/core";
170
309
  import { z } from "zod";
171
310
  import type { ComponentFn } from "@xmachines/play-dom";
172
311
 
312
+ // 1. Define a catalog (schema of components and actions)
173
313
  const catalog = defineCatalog(schema, {
174
314
  components: {
175
315
  Home: { props: z.object({ title: z.string() }) },
176
- Login: { props: z.object({ title: z.string() }) },
316
+ Login: { props: z.object({}) },
177
317
  },
178
318
  actions: {
179
319
  login: { params: z.object({ username: z.string() }) },
@@ -181,42 +321,46 @@ const catalog = defineCatalog(schema, {
181
321
  },
182
322
  });
183
323
 
324
+ // 2. Implement components
184
325
  const Home: ComponentFn<typeof catalog, "Home"> = ({ props }) => {
185
326
  const el = document.createElement("section");
186
327
  el.textContent = props.title;
187
328
  return el;
188
329
  };
189
- const Login: ComponentFn<typeof catalog, "Login"> = ({ props, on }) => {
190
- const el = document.createElement("section");
330
+ const Login: ComponentFn<typeof catalog, "Login"> = ({ on }) => {
331
+ const el = document.createElement("div");
191
332
  const btn = document.createElement("button");
192
- const submit = on("submit");
193
- btn.addEventListener("click", () => submit.emit());
333
+ btn.textContent = "Log in";
334
+ btn.addEventListener("click", () => on("submit").emit());
194
335
  el.append(btn);
195
336
  return el;
196
337
  };
197
338
 
198
- // Build factory once, mount when actor + container are ready
199
- const mount = createRenderer(catalog, { Home, Login });
200
- const disconnectRenderer = mount(actor, document.getElementById("app")!);
339
+ // 3. Build registry and mount
340
+ const registryResult = defineRegistry(catalog, {
341
+ components: { Home, Login },
342
+ actions: {
343
+ login: async ({ username }) => actor.send({ type: "auth.login", username }),
344
+ logout: async () => actor.send({ type: "auth.logout" }),
345
+ },
346
+ });
347
+
348
+ const mount = createPlayUI(registryResult);
349
+ const disconnect = mount(actor, document.getElementById("app")!);
201
350
 
202
351
  // Cleanup
203
- window.addEventListener("beforeunload", () => {
204
- disconnectRenderer();
205
- actor.stop();
206
- });
352
+ window.addEventListener("beforeunload", () => disconnect());
207
353
  ```
208
354
 
209
- **React** — use `PlayUIProvider` + `PlayRenderer` from `@xmachines/play-react`:
355
+ ### React
210
356
 
211
357
  ```tsx
212
358
  import { PlayUIProvider, PlayRenderer, defineRegistry } from "@xmachines/play-react";
213
- import { authCatalog } from "@xmachines/play-actor-shared";
214
- import { Home, Login } from "./components/index.js";
215
359
 
216
- const registryResult = defineRegistry(authCatalog, {
360
+ const registryResult = defineRegistry(catalog, {
217
361
  components: { Home, Login },
218
362
  actions: {
219
- login: async (params) => actor.send({ type: "auth.login", username: params!.username }),
363
+ login: async ({ username }) => actor.send({ type: "auth.login", username }),
220
364
  logout: async () => actor.send({ type: "auth.logout" }),
221
365
  },
222
366
  });
@@ -230,83 +374,148 @@ function App() {
230
374
  }
231
375
  ```
232
376
 
233
- ## Complete Toggle Example
377
+ ### Vue 3
234
378
 
235
- ```typescript
236
- import { setup } from "xstate";
237
- import { definePlayer } from "@xmachines/play-xstate";
238
- import { watchSignal } from "@xmachines/play-signals";
379
+ ```html
380
+ <!-- App.vue -->
381
+ <template>
382
+ <PlayUIProvider :actor="actor" :registry-result="registryResult">
383
+ <PlayRenderer />
384
+ </PlayUIProvider>
385
+ </template>
239
386
 
240
- const toggleSetup = setup({
241
- types: {
242
- context: {} as { count: number },
243
- events: {} as { type: "toggle" },
244
- input: {} as undefined,
245
- },
246
- });
387
+ <script setup lang="ts">
388
+ import { PlayUIProvider, PlayRenderer, defineRegistry } from "@xmachines/play-vue";
247
389
 
248
- const toggleMachine = toggleSetup.createMachine({
249
- id: "toggle",
250
- initial: "off",
251
- context: { count: 0 },
252
- states: {
253
- off: {
254
- on: {
255
- toggle: {
256
- target: "on",
257
- actions: toggleSetup.assign({ count: ({ context }) => context.count + 1 }),
258
- },
259
- },
260
- },
261
- on: {
262
- on: {
263
- toggle: {
264
- target: "off",
265
- actions: toggleSetup.assign({ count: ({ context }) => context.count + 1 }),
266
- },
267
- },
390
+ const registryResult = defineRegistry(catalog, {
391
+ components: { Home, Login },
392
+ actions: {
393
+ login: async ({ username }) => actor.send({ type: "auth.login", username }),
394
+ logout: async () => actor.send({ type: "auth.logout" }),
268
395
  },
396
+ });
397
+ </script>
398
+ ```
399
+
400
+ ### SolidJS
401
+
402
+ ```tsx
403
+ import { PlayUIProvider, PlayRenderer, defineRegistry } from "@xmachines/play-solid";
404
+
405
+ const registryResult = defineRegistry(catalog, {
406
+ components: { Home, Login },
407
+ actions: {
408
+ login: async ({ username }) => actor.send({ type: "auth.login", username }),
409
+ logout: async () => actor.send({ type: "auth.logout" }),
269
410
  },
270
411
  });
271
412
 
272
- const createPlayer = definePlayer({ machine: toggleMachine });
273
- const actor = createPlayer();
413
+ function App() {
414
+ return (
415
+ <PlayUIProvider actor={actor} registryResult={registryResult}>
416
+ <PlayRenderer />
417
+ </PlayUIProvider>
418
+ );
419
+ }
420
+ ```
274
421
 
275
- const unwatch = watchSignal(actor.state, () => {
276
- const snap = actor.state.get();
277
- console.log(`State: ${String(snap.value)}, Count: ${snap.context.count}`);
278
- });
422
+ ---
279
423
 
280
- actor.start();
281
- // logs: State: off, Count: 0
424
+ ## Common Setup Issues
282
425
 
283
- actor.send({ type: "toggle" });
284
- // logs: State: on, Count: 1
426
+ ### Missing `params` / `query` in context
427
+
428
+ **Error:** `MissingQueryContextError` at runtime when using [`formatPlayRouteTransitions`](../api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md).
429
+
430
+ **Fix:** Add `params` and `query` fields to your machine context:
431
+
432
+ ```typescript
433
+ context: {} as {
434
+ params: Record<string, string>;
435
+ query: Record<string, string>;
436
+ // ...other fields
437
+ }
438
+ // and initialize them:
439
+ context: { params: {}, query: {}, /* ...other fields */ }
440
+ ```
441
+
442
+ ### Missing `id` on routable states
443
+
444
+ **Error:** `MissingStateIdError: State "home" has meta.route "/" but no id`.
445
+
446
+ **Fix:** Every state with `meta.route` must declare an explicit `id`:
447
+
448
+ ```typescript
449
+ // ❌ Missing id
450
+ home: { meta: { route: "/" } }
451
+
452
+ // ✅ Correct
453
+ home: { id: "home", meta: { route: "/" } }
454
+ ```
455
+
456
+ ### Actor sends events before `start()`
285
457
 
458
+ **Symptom:** Events are silently dropped; state never changes.
459
+
460
+ **Fix:** Always call `actor.start()` before `actor.send()`:
461
+
462
+ ```typescript
463
+ const actor = createPlayer();
464
+ actor.start(); // required before any send()
286
465
  actor.send({ type: "toggle" });
287
- // logs: State: off, Count: 2
466
+ ```
288
467
 
289
- unwatch();
290
- actor.stop();
468
+ ### `routeMap` or `actor` recreated on every render (React/Solid)
469
+
470
+ **Symptom:** The router bridge disconnects and reconnects on every render.
471
+
472
+ **Fix:** Construct stable references outside JSX or memoize them:
473
+
474
+ ```typescript
475
+ // ✅ Built outside the component
476
+ const routeTree = extractMachineRoutes(appMachine);
477
+ const routeMap = createRouteMapFromTree(routeTree);
478
+
479
+ // ✅ Or memoized inside the component
480
+ const routeMap = useMemo(() => createRouteMapFromTree(routeTree), [routeTree]);
291
481
  ```
292
482
 
293
- ## Glossary
483
+ ### Wrong Node.js version
484
+
485
+ **Error:** `SyntaxError: Cannot use import statement in a module` or TC39 Signals not available.
486
+
487
+ **Fix:** Use Node.js `>= 22.0.0`. Check with:
488
+
489
+ ```bash
490
+ node --version
491
+ ```
492
+
493
+ ---
494
+
495
+ ## Key Concepts Reference
496
+
497
+ | Term | Description |
498
+ | ----------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
499
+ | `setup({ types })` | XState v5 entry point — declares TypeScript types for context, events, and input |
500
+ | [`definePlayer({ machine })`](../api/@xmachines/play-xstate/functions/definePlayer.md) | Creates a factory that produces [`PlayerActor`](../api/@xmachines/play-xstate/classes/PlayerActor.md) instances |
501
+ | `actor.start()` | Activates the machine — always call before sending events |
502
+ | `actor.send({ type })` | Sends an event; machine guards decide whether a transition occurs |
503
+ | `actor.getSnapshot()` | Synchronous read of current state and context |
504
+ | `actor.state` | `Signal.State<Snapshot>` — TC39 Signal for reactive state observation |
505
+ | `actor.currentRoute` | `Signal.Computed<string \| null>` — resolved URL from active state's `meta.route` |
506
+ | `actor.currentView` | `Signal.State<PlaySpec \| null>` — view spec from active state's `meta.view` |
507
+ | [`formatPlayRouteTransitions`](../api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md) | Generates `play.route` handlers from `id` + `meta.route` state pairs |
508
+ | `play.route` event | Navigation event — `to: "#stateId"`, `params`, `query` |
509
+ | `always` guard | Protects states — fires on entry before any event, even on direct URL access |
294
510
 
295
- | Term | Description |
296
- | ---------------------------- | -------------------------------------------------------------------------------------------------- |
297
- | `setup({ types })` | XState v5 entry point — declares TypeScript types for context, events, and input |
298
- | `definePlayer({ machine })` | Creates a factory that produces `PlayerActor` instances from the machine |
299
- | `actor.start()` | Activates the machine — always call before sending events |
300
- | `actor.send({ type })` | Sends an event to the machine |
301
- | `actor.getSnapshot()` | Synchronous snapshot of the current state and context |
302
- | `actor.state` | `Signal.State<Snapshot>` — TC39 Signal for reactive state observation |
303
- | `actor.currentRoute` | `Signal.Computed<string \| null>` — resolved URL from the active state's `meta.route` |
304
- | `actor.currentView` | `Signal.State<PlaySpec \| null>` — view spec from the active state's `meta.view`; drives renderers |
305
- | `formatPlayRouteTransitions` | Utility that generates `play.route` handlers from `id` + `meta.route` state pairs |
511
+ ---
306
512
 
307
513
  ## Next Steps
308
514
 
309
- - **[Installation Guide](installation.md)** — Framework-specific packages, TypeScript config
310
- - **[Examples](../examples/README.md)** — Routing patterns, form validation, multi-router demos
311
- - **[API Reference](../api/README.md)** — Generated API docs for all packages
515
+ - **[ARCHITECTURE.md](ARCHITECTURE.md)** — System design, component diagram, data flow, and architectural invariants
516
+ - **[CONFIGURATION.md](CONFIGURATION.md)** — Environment variables and configuration options
517
+ - **[Routing Patterns](../packages/docs/examples/routing-patterns.md)** — `meta.route`, `play.route`, `always` guards, and parameter routes
518
+ - **[Multi-Router Integration](../packages/docs/examples/multi-router-integration.md)** — All 8 router adapters with full code examples
519
+ - **[Examples Index](../packages/docs/examples/README.md)** — Basic state machine, form validation, and traffic light demos
520
+ - **[API Reference](../packages/docs/api/README.md)** — Auto-generated API docs for all packages
312
521
  - **[Play RFC](../rfc/play.md)** — Complete architectural specification