@xmachines/docs 2.0.0-alpha.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (388) hide show
  1. package/README.md +16 -17
  2. package/api/@xmachines/play/README.md +58 -66
  3. package/api/@xmachines/play/classes/NonNullableError.md +14 -14
  4. package/api/@xmachines/play/classes/PlayError.md +32 -34
  5. package/api/@xmachines/play/functions/assertNonNullable.md +17 -17
  6. package/api/@xmachines/play/type-aliases/PlayEvent.md +28 -27
  7. package/api/@xmachines/play-actor/README.md +114 -50
  8. package/api/@xmachines/play-actor/classes/AbstractActor.md +45 -30
  9. package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +19 -18
  10. package/api/@xmachines/play-actor/functions/composePlayState.md +27 -0
  11. package/api/@xmachines/play-actor/functions/createViewStoreLifecycle.md +21 -0
  12. package/api/@xmachines/play-actor/functions/guardContextWrites.md +43 -0
  13. package/api/@xmachines/play-actor/functions/refreshContextSubtree.md +28 -0
  14. package/api/@xmachines/play-actor/functions/reuseComposedState.md +42 -0
  15. package/api/@xmachines/play-actor/functions/shallowEqualExcept.md +29 -0
  16. package/api/@xmachines/play-actor/functions/toAtomState.md +16 -14
  17. package/api/@xmachines/play-actor/functions/typedSpec.md +25 -27
  18. package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +17 -15
  19. package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +15 -14
  20. package/api/@xmachines/play-actor/interfaces/PlaySpec.md +13 -15
  21. package/api/@xmachines/play-actor/interfaces/ResolveViewStoreOptions.md +11 -0
  22. package/api/@xmachines/play-actor/interfaces/Routable.md +6 -6
  23. package/api/@xmachines/play-actor/interfaces/ViewStoreLifecycle.md +50 -0
  24. package/api/@xmachines/play-actor/interfaces/ViewStoreResolution.md +15 -0
  25. package/api/@xmachines/play-actor/interfaces/Viewable.md +9 -9
  26. package/api/@xmachines/play-actor/variables/CONTEXT_STATE_KEY.md +15 -0
  27. package/api/@xmachines/play-dom/README.md +123 -86
  28. package/api/@xmachines/play-dom/classes/PlayRenderer.md +34 -32
  29. package/api/@xmachines/play-dom/functions/createPlayUI.md +10 -10
  30. package/api/@xmachines/play-dom/functions/createRenderer.md +21 -17
  31. package/api/@xmachines/play-dom/functions/createValidationRegistry.md +22 -0
  32. package/api/@xmachines/play-dom/functions/defineRegistry.md +5 -5
  33. package/api/@xmachines/play-dom/interfaces/ComponentContext.md +9 -8
  34. package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +16 -16
  35. package/api/@xmachines/play-dom/interfaces/DomRenderContext.md +2 -0
  36. package/api/@xmachines/play-dom/interfaces/FieldValidationState.md +16 -0
  37. package/api/@xmachines/play-dom/interfaces/MountOptions.md +9 -9
  38. package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +17 -17
  39. package/api/@xmachines/play-dom/interfaces/RenderSpecOptions.md +2 -0
  40. package/api/@xmachines/play-dom/interfaces/ValidationRegistry.md +21 -0
  41. package/api/@xmachines/play-dom/type-aliases/BaseComponentProps.md +10 -0
  42. package/api/@xmachines/play-dom/type-aliases/MountFn.md +5 -5
  43. package/api/@xmachines/play-dom/variables/schema.md +35 -45
  44. package/api/@xmachines/play-dom-router/README.md +68 -51
  45. package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +116 -0
  46. package/api/@xmachines/play-dom-router/functions/connectRouter.md +4 -3
  47. package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +16 -14
  48. package/api/@xmachines/play-dom-router/functions/createRouteMap.md +12 -11
  49. package/api/@xmachines/play-dom-router/functions/createRouter.md +14 -14
  50. package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +25 -26
  51. package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +21 -20
  52. package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +7 -7
  53. package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +41 -35
  54. package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +18 -17
  55. package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +9 -9
  56. package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +39 -38
  57. package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +5 -5
  58. package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +11 -10
  59. package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +27 -24
  60. package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +7 -7
  61. package/api/@xmachines/play-react/README.md +65 -55
  62. package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -13
  63. package/api/@xmachines/play-react/functions/defineRegistry.md +5 -5
  64. package/api/@xmachines/play-react/functions/useActor.md +1 -1
  65. package/api/@xmachines/play-react/functions/useFieldValidation.md +31 -0
  66. package/api/@xmachines/play-react/functions/usePlayView.md +4 -4
  67. package/api/@xmachines/play-react/functions/useSignalEffect.md +39 -39
  68. package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
  69. package/api/@xmachines/play-react/interfaces/ComponentContext.md +9 -8
  70. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
  71. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +6 -6
  72. package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +14 -14
  73. package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
  74. package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +2 -2
  75. package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +13 -0
  76. package/api/@xmachines/play-react/variables/ActorProvider.md +9 -8
  77. package/api/@xmachines/play-react/variables/PlayRenderer.md +5 -4
  78. package/api/@xmachines/play-react/variables/PlayUIProvider.md +6 -6
  79. package/api/@xmachines/play-react-router/README.md +38 -31
  80. package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +22 -19
  81. package/api/@xmachines/play-react-router/classes/RouteMap.md +50 -48
  82. package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +16 -14
  83. package/api/@xmachines/play-react-router/functions/createRouteMap.md +12 -11
  84. package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +18 -18
  85. package/api/@xmachines/play-react-router/interfaces/PlayActor.md +22 -20
  86. package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +41 -35
  87. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
  88. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +11 -11
  89. package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +5 -5
  90. package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +11 -10
  91. package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +27 -24
  92. package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  93. package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +7 -6
  94. package/api/@xmachines/play-router/README.md +99 -95
  95. package/api/@xmachines/play-router/classes/RouteMap.md +50 -48
  96. package/api/@xmachines/play-router/classes/RouterBridgeBase.md +29 -23
  97. package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +6 -5
  98. package/api/@xmachines/play-router/functions/buildRouteTree.md +16 -15
  99. package/api/@xmachines/play-router/functions/createRouteMap.md +12 -11
  100. package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +18 -18
  101. package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +18 -17
  102. package/api/@xmachines/play-router/functions/extractMachineRoutes.md +11 -10
  103. package/api/@xmachines/play-router/functions/extractQuery.md +3 -3
  104. package/api/@xmachines/play-router/functions/extractRouteParams.md +22 -19
  105. package/api/@xmachines/play-router/functions/findRouteById.md +10 -9
  106. package/api/@xmachines/play-router/functions/findRouteByPath.md +14 -12
  107. package/api/@xmachines/play-router/functions/getNavigableRoutes.md +9 -9
  108. package/api/@xmachines/play-router/functions/getRoutableRoutes.md +9 -9
  109. package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +16 -15
  110. package/api/@xmachines/play-router/functions/isRouteReachable.md +12 -11
  111. package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
  112. package/api/@xmachines/play-router/functions/routeExists.md +8 -8
  113. package/api/@xmachines/play-router/functions/sanitizePathname.md +15 -13
  114. package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -10
  115. package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
  116. package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +6 -6
  117. package/api/@xmachines/play-router/interfaces/LocationLike.md +11 -11
  118. package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +7 -9
  119. package/api/@xmachines/play-router/interfaces/MachineNodeData.md +9 -9
  120. package/api/@xmachines/play-router/interfaces/PlayActor.md +22 -20
  121. package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +41 -35
  122. package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +7 -7
  123. package/api/@xmachines/play-router/interfaces/RoutableActor.md +18 -17
  124. package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
  125. package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +5 -5
  126. package/api/@xmachines/play-router/interfaces/RouteMapping.md +11 -10
  127. package/api/@xmachines/play-router/interfaces/RouteMatch.md +5 -5
  128. package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
  129. package/api/@xmachines/play-router/interfaces/RouteObject.md +6 -6
  130. package/api/@xmachines/play-router/interfaces/RouteTree.md +11 -11
  131. package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +13 -13
  132. package/api/@xmachines/play-router/interfaces/RouterBridge.md +27 -24
  133. package/api/@xmachines/play-router/interfaces/WindowLike.md +10 -10
  134. package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +13 -0
  135. package/api/@xmachines/play-router/type-aliases/MachineGraph.md +4 -3
  136. package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
  137. package/api/@xmachines/play-signals/README.md +38 -36
  138. package/api/@xmachines/play-signals/functions/watchSignal.md +15 -15
  139. package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +6 -6
  140. package/api/@xmachines/play-signals/interfaces/SignalComputed.md +10 -10
  141. package/api/@xmachines/play-signals/interfaces/SignalOptions.md +6 -6
  142. package/api/@xmachines/play-signals/interfaces/SignalState.md +13 -13
  143. package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +18 -18
  144. package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +6 -5
  145. package/api/@xmachines/play-solid/README.md +46 -42
  146. package/api/@xmachines/play-solid/functions/useActor.md +1 -1
  147. package/api/@xmachines/play-solid/functions/usePlayView.md +3 -3
  148. package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +13 -13
  149. package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +14 -14
  150. package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +9 -9
  151. package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +2 -2
  152. package/api/@xmachines/play-solid/variables/ActorContext.md +5 -4
  153. package/api/@xmachines/play-solid/variables/ActorProvider.md +8 -7
  154. package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -4
  155. package/api/@xmachines/play-solid/variables/PlayUIProvider.md +7 -7
  156. package/api/@xmachines/play-solid-router/README.md +39 -34
  157. package/api/@xmachines/play-solid-router/classes/RouteMap.md +50 -48
  158. package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +43 -34
  159. package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +15 -13
  160. package/api/@xmachines/play-solid-router/functions/createRouteMap.md +12 -11
  161. package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +45 -30
  162. package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +22 -20
  163. package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +41 -35
  164. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +10 -10
  165. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +11 -11
  166. package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +5 -5
  167. package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +11 -10
  168. package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +27 -24
  169. package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +5 -5
  170. package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +2 -2
  171. package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +11 -11
  172. package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +9 -8
  173. package/api/@xmachines/play-svelte/README.md +60 -33
  174. package/api/@xmachines/play-svelte/functions/defineRegistry.md +9 -8
  175. package/api/@xmachines/play-svelte/functions/getActorContext.md +5 -4
  176. package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +3 -3
  177. package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
  178. package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +17 -15
  179. package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +9 -9
  180. package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +20 -18
  181. package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +12 -11
  182. package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +2 -2
  183. package/api/@xmachines/play-svelte-spa-router/README.md +43 -52
  184. package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +50 -48
  185. package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +133 -0
  186. package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -3
  187. package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +12 -11
  188. package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +7 -7
  189. package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +41 -35
  190. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +5 -5
  191. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +11 -10
  192. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +27 -24
  193. package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +10 -10
  194. package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
  195. package/api/@xmachines/play-sveltekit-router/README.md +43 -39
  196. package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +50 -48
  197. package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +132 -0
  198. package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -3
  199. package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +12 -11
  200. package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -6
  201. package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +11 -11
  202. package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +41 -35
  203. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +5 -5
  204. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +11 -10
  205. package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +27 -24
  206. package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
  207. package/api/@xmachines/play-tanstack-react-router/README.md +67 -49
  208. package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +50 -48
  209. package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +43 -38
  210. package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +16 -14
  211. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +12 -11
  212. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +18 -18
  213. package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +11 -10
  214. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +22 -20
  215. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +41 -35
  216. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
  217. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +11 -11
  218. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +5 -5
  219. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +11 -10
  220. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +16 -11
  221. package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +27 -24
  222. package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  223. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
  224. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +15 -13
  225. package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +9 -8
  226. package/api/@xmachines/play-tanstack-router/README.md +38 -16
  227. package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +43 -38
  228. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +9 -9
  229. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +15 -13
  230. package/api/@xmachines/play-tanstack-solid-router/README.md +76 -50
  231. package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +50 -48
  232. package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +38 -30
  233. package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +15 -13
  234. package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +12 -11
  235. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +22 -20
  236. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +41 -35
  237. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +11 -11
  238. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +9 -9
  239. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +5 -5
  240. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +11 -10
  241. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +27 -24
  242. package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  243. package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +2 -2
  244. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
  245. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +15 -13
  246. package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +7 -7
  247. package/api/@xmachines/play-vue/README.md +39 -39
  248. package/api/@xmachines/play-vue/functions/defineRegistry.md +10 -9
  249. package/api/@xmachines/play-vue/functions/useActor.md +1 -1
  250. package/api/@xmachines/play-vue/functions/useFieldValidation.md +31 -0
  251. package/api/@xmachines/play-vue/functions/usePlayView.md +28 -0
  252. package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +10 -9
  253. package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +13 -12
  254. package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +10 -9
  255. package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +6 -2
  256. package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +2 -2
  257. package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
  258. package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
  259. package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +4 -4
  260. package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
  261. package/api/@xmachines/play-vue/variables/getPlayViewContext.md +34 -0
  262. package/api/@xmachines/play-vue-router/README.md +66 -57
  263. package/api/@xmachines/play-vue-router/classes/RouteMap.md +50 -48
  264. package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +26 -19
  265. package/api/@xmachines/play-vue-router/functions/createRouteMap.md +12 -11
  266. package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +22 -20
  267. package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +41 -35
  268. package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +5 -5
  269. package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +11 -10
  270. package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +27 -24
  271. package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +2 -2
  272. package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +13 -0
  273. package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +5 -5
  274. package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +13 -0
  275. package/api/@xmachines/play-xstate/README.md +129 -138
  276. package/api/@xmachines/play-xstate/classes/PlayerActor.md +148 -114
  277. package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +19 -23
  278. package/api/@xmachines/play-xstate/functions/composeGuards.md +34 -33
  279. package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +27 -22
  280. package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +19 -14
  281. package/api/@xmachines/play-xstate/functions/definePlayer.md +19 -19
  282. package/api/@xmachines/play-xstate/functions/deriveRoute.md +26 -25
  283. package/api/@xmachines/play-xstate/functions/eventMatches.md +12 -7
  284. package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +17 -48
  285. package/api/@xmachines/play-xstate/functions/hasContext.md +12 -9
  286. package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +10 -10
  287. package/api/@xmachines/play-xstate/functions/negateGuard.md +26 -20
  288. package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +6 -6
  289. package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +7 -7
  290. package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +10 -11
  291. package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -14
  292. package/api/@xmachines/play-xstate/interfaces/RouteObject.md +4 -4
  293. package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +9 -25
  294. package/api/@xmachines/play-xstate/type-aliases/Guard.md +13 -11
  295. package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +8 -5
  296. package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +11 -15
  297. package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +12 -19
  298. package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
  299. package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +15 -26
  300. package/api/@xmachines/shared/README.md +12 -14
  301. package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
  302. package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
  303. package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +12 -7
  304. package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
  305. package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +9 -4
  306. package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
  307. package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
  308. package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +6 -6
  309. package/contributing/architecture.md +27 -28
  310. package/contributing/configuration.md +10 -10
  311. package/contributing/deployment.md +51 -30
  312. package/contributing/development.md +90 -21
  313. package/contributing/testing.md +36 -14
  314. package/examples/@xmachines/play-dom-demo/functions/createNavBar.md +1 -1
  315. package/examples/@xmachines/play-dom-demo/functions/initShell.md +1 -1
  316. package/examples/@xmachines/play-dom-demo/type-aliases/AuthCatalog.md +1 -1
  317. package/examples/@xmachines/play-dom-demo/variables/About.md +1 -1
  318. package/examples/@xmachines/play-dom-demo/variables/Contact.md +1 -1
  319. package/examples/@xmachines/play-dom-demo/variables/Dashboard.md +1 -1
  320. package/examples/@xmachines/play-dom-demo/variables/Home.md +1 -1
  321. package/examples/@xmachines/play-dom-demo/variables/Login.md +1 -1
  322. package/examples/@xmachines/play-dom-demo/variables/NavBarView.md +1 -1
  323. package/examples/@xmachines/play-dom-demo/variables/Navigation.md +1 -1
  324. package/examples/@xmachines/play-dom-demo/variables/Overview.md +1 -1
  325. package/examples/@xmachines/play-dom-demo/variables/Profile.md +1 -1
  326. package/examples/@xmachines/play-dom-demo/variables/Settings.md +1 -1
  327. package/examples/@xmachines/play-dom-demo/variables/Stats.md +1 -1
  328. package/examples/@xmachines/play-dom-demo/variables/authCatalog.md +1 -1
  329. package/examples/@xmachines/play-react-demo/functions/App.md +1 -1
  330. package/examples/@xmachines/play-react-demo/type-aliases/AuthCatalog.md +1 -1
  331. package/examples/@xmachines/play-react-demo/variables/About.md +1 -1
  332. package/examples/@xmachines/play-react-demo/variables/Contact.md +1 -1
  333. package/examples/@xmachines/play-react-demo/variables/Dashboard.md +1 -1
  334. package/examples/@xmachines/play-react-demo/variables/DebugPanel.md +1 -1
  335. package/examples/@xmachines/play-react-demo/variables/Home.md +1 -1
  336. package/examples/@xmachines/play-react-demo/variables/Login.md +1 -1
  337. package/examples/@xmachines/play-react-demo/variables/NavBar.md +1 -1
  338. package/examples/@xmachines/play-react-demo/variables/NavBarView.md +1 -1
  339. package/examples/@xmachines/play-react-demo/variables/Navigation.md +1 -1
  340. package/examples/@xmachines/play-react-demo/variables/Overview.md +1 -1
  341. package/examples/@xmachines/play-react-demo/variables/Profile.md +1 -1
  342. package/examples/@xmachines/play-react-demo/variables/Settings.md +1 -1
  343. package/examples/@xmachines/play-react-demo/variables/Shell.md +1 -1
  344. package/examples/@xmachines/play-react-demo/variables/Stats.md +1 -1
  345. package/examples/@xmachines/play-react-demo/variables/authCatalog.md +1 -1
  346. package/examples/@xmachines/play-solid-demo/functions/App.md +1 -1
  347. package/examples/@xmachines/play-solid-demo/type-aliases/AuthCatalog.md +1 -1
  348. package/examples/@xmachines/play-solid-demo/variables/About.md +1 -1
  349. package/examples/@xmachines/play-solid-demo/variables/Contact.md +1 -1
  350. package/examples/@xmachines/play-solid-demo/variables/Dashboard.md +1 -1
  351. package/examples/@xmachines/play-solid-demo/variables/DebugPanel.md +1 -1
  352. package/examples/@xmachines/play-solid-demo/variables/Home.md +1 -1
  353. package/examples/@xmachines/play-solid-demo/variables/Login.md +1 -1
  354. package/examples/@xmachines/play-solid-demo/variables/NavBar.md +1 -1
  355. package/examples/@xmachines/play-solid-demo/variables/NavBarView.md +1 -1
  356. package/examples/@xmachines/play-solid-demo/variables/Navigation.md +1 -1
  357. package/examples/@xmachines/play-solid-demo/variables/Overview.md +1 -1
  358. package/examples/@xmachines/play-solid-demo/variables/Profile.md +1 -1
  359. package/examples/@xmachines/play-solid-demo/variables/Settings.md +1 -1
  360. package/examples/@xmachines/play-solid-demo/variables/Shell.md +1 -1
  361. package/examples/@xmachines/play-solid-demo/variables/Stats.md +1 -1
  362. package/examples/@xmachines/play-solid-demo/variables/authCatalog.md +1 -1
  363. package/examples/@xmachines/play-svelte-demo/type-aliases/AuthCatalog.md +1 -1
  364. package/examples/@xmachines/play-svelte-demo/variables/authCatalog.md +1 -1
  365. package/examples/@xmachines/play-vue-demo/type-aliases/AuthCatalog.md +1 -1
  366. package/examples/@xmachines/play-vue-demo/variables/App.md +1 -1
  367. package/examples/@xmachines/play-vue-demo/variables/authCatalog.md +1 -1
  368. package/examples/README.md +4 -1
  369. package/examples/basic-state-machine.md +24 -24
  370. package/examples/form-validation.md +110 -121
  371. package/examples/multi-router-integration.md +0 -2
  372. package/examples/routing-patterns.md +60 -94
  373. package/examples/traffic-light.md +57 -48
  374. package/guides/README.md +6 -2
  375. package/guides/actor-model.md +1 -1
  376. package/guides/getting-started.md +89 -90
  377. package/guides/inspector.md +197 -0
  378. package/guides/state-machines.md +55 -69
  379. package/package.json +10 -7
  380. package/rfc/play.md +15 -6
  381. package/api/@xmachines/play-vue/functions/getPlayViewContext.md +0 -28
  382. package/api/@xmachines/play-xstate/functions/createRoutedMachine.md +0 -87
  383. package/api/@xmachines/play-xstate/type-aliases/PlayRoutePayload.md +0 -30
  384. package/api/@xmachines/play-xstate/type-aliases/SetupLike.md +0 -33
  385. package/api/@xmachines/play-xstate/type-aliases/WithOptional.md +0 -31
  386. package/api/@xmachines/play-xstate/variables/emptyEventSchema.md +0 -37
  387. package/api/@xmachines/play-xstate/variables/playMetaSchema.md +0 -40
  388. package/api/@xmachines/play-xstate/variables/playRouteEventSchema.md +0 -9
package/README.md CHANGED
@@ -1,17 +1,12 @@
1
- <!-- generated-by: gsd-doc-writer -->
2
-
3
1
  # @xmachines/docs
4
2
 
5
3
  > Documentation, guides, RFCs, and generated API reference for XMachines.
6
4
 
7
- Part of the `XMachines Play monorepo`.
8
-
9
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
10
- [![Version](https://img.shields.io/badge/version-1.0.0--beta.51-blue)](https://www.npmjs.com/package/@xmachines/docs)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Version](https://img.shields.io/badge/version-2.1.0-blue)](https://www.npmjs.com/package/@xmachines/docs)
11
6
 
12
7
  ## Overview
13
8
 
14
- `@xmachines/docs` is the documentation package for the XMachines Play monorepo. It ships five categories of content:
9
+ `@xmachines/docs` is the documentation package of the XMachines Play monorepo. It ships five categories of content:
15
10
 
16
11
  | Location | Contents |
17
12
  | --------------- | ---------------------------------------------------------------- |
@@ -19,7 +14,7 @@ Part of the `XMachines Play monorepo`.
19
14
  | `guides/` | Concept guides, tutorials, and getting-started docs |
20
15
  | `contributing/` | Operational docs for contributors and maintainers |
21
16
  | `examples/` | Runnable code examples and demo application references |
22
- | `api/` | TypeDoc-generated API reference for all public packages |
17
+ | `api/` | The API reference for every public package, generated by TypeDoc |
23
18
 
24
19
  ## Installation
25
20
 
@@ -31,7 +26,7 @@ pnpm add @xmachines/docs
31
26
 
32
27
  ### Import the package URL
33
28
 
34
- The package default export is its own module URL useful for resolving doc assets at runtime:
29
+ The default export of the package is its own module URL. Use it to resolve documentation assets at run time:
35
30
 
36
31
  ```typescript
37
32
  import docsUrl from "@xmachines/docs";
@@ -40,7 +35,7 @@ import docsUrl from "@xmachines/docs";
40
35
 
41
36
  ### Access documentation files directly
42
37
 
43
- All documentation directories are exposed as package exports:
38
+ The package exports every documentation directory:
44
39
 
45
40
  ```typescript
46
41
  // Access RFC files
@@ -65,7 +60,7 @@ Architectural specifications that define the XMachines system:
65
60
  | File | Title | Description |
66
61
  | ---------------------------------- | ------- | -------------------------------------------------------------------- |
67
62
  | [`rfc/play.md`](rfc/play.md) | Play | Universal Player Architecture — core protocol, roles, and invariants |
68
- | [`rfc/streams.md`](rfc/streams.md) | Streams | WHATWG Streams as integration boundary |
63
+ | [`rfc/streams.md`](rfc/streams.md) | Streams | WHATWG Streams as the integration boundary |
69
64
  | [`rfc/broker.md`](rfc/broker.md) | Broker | Event broker specification |
70
65
  | [`rfc/git.md`](rfc/git.md) | Git | Git-compatible ID and history model |
71
66
  | [`rfc/run.md`](rfc/run.md) | Run | Runtime execution model |
@@ -77,7 +72,7 @@ Architectural specifications that define the XMachines system:
77
72
 
78
73
  ### Guides
79
74
 
80
- Concept guides and tutorials for working with XMachines:
75
+ Concept guides and tutorials that show how to use XMachines:
81
76
 
82
77
  **Learning:**
83
78
 
@@ -86,6 +81,10 @@ Concept guides and tutorials for working with XMachines:
86
81
  - **[Understanding the Actor Model](guides/actor-model.md)** — Actor/infrastructure split, `AbstractActor`, and the reset invariant
87
82
  - **[Understanding TC39 Signals](guides/signals.md)** — Signal primitives and the five architectural invariants they enforce
88
83
 
84
+ **Tooling:**
85
+
86
+ - **[Inspecting a Running Actor](guides/inspector.md)** — `PlayerOptions.inspect`, the Stately inspector, late attachment, and browser-free transports
87
+
89
88
  ### Contributing & Operations
90
89
 
91
90
  Reference documentation for contributors and maintainers:
@@ -98,19 +97,19 @@ Reference documentation for contributors and maintainers:
98
97
 
99
98
  ### Examples
100
99
 
101
- Practical code examples demonstrating XMachines patterns:
100
+ Practical code examples that show the XMachines patterns:
102
101
 
103
102
  - **[Basic State Machine](examples/basic-state-machine.md)** — `setup().createMachine()` + `definePlayer()` + TC39 Signals
104
103
  - **[Traffic Light](examples/traffic-light.md)** — Multi-state machine with `meta.route` and `formatPlayRouteTransitions`
105
- - **[Form Validation](examples/form-validation.md)** — Typed context patches, guard logic in transition functions, and `$bindState`
104
+ - **[Form Validation](examples/form-validation.md)** — Typed context mutations with `setup.assign`, guards, and `$bindState`
106
105
  - **[Routing Patterns](examples/routing-patterns.md)** — `meta.route`, `play.route` events, `always` auth guards
107
106
  - **[Multi-Router Integration](examples/multi-router-integration.md)** — All 8 router adapters
108
107
 
109
108
  ### API Reference
110
109
 
111
- TypeDoc-generated API reference for all public packages see [`api/README.md`](api/README.md).
110
+ TypeDoc generates the API reference for every public package. See [`api/README.md`](api/README.md).
112
111
 
113
- Packages documented:
112
+ The documented packages:
114
113
 
115
114
  - [`@xmachines/play`](../play/README.md) — Core protocols (`PlayEvent`, `PlayError`)
116
115
  - [`@xmachines/play-actor`](../play-actor/README.md) — `AbstractActor`, `Routable`, `Viewable`
@@ -134,7 +133,7 @@ pnpm test
134
133
 
135
134
  ## Regenerating API Docs
136
135
 
137
- The `api/` directory is auto-generated by TypeDoc and must not be edited directly. Regenerate it from the monorepo root:
136
+ TypeDoc generates the `api/` directory. Never edit it by hand. Generate it again from the monorepo root:
138
137
 
139
138
  ```bash
140
139
  pnpm run docs
@@ -1,15 +1,10 @@
1
1
  [API](../../README.md) / @xmachines/play
2
2
 
3
- <!-- generated-by: gsd-doc-writer -->
4
-
5
3
  # `@xmachines/play`
6
4
 
7
- > Core protocol layer for the Universal Player Architecture defines `PlayEvent`, `PlayError`, and architectural contracts enabling loose coupling between business logic and runtime adapters.
8
-
9
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
10
- [![npm](https://img.shields.io/npm/v/@xmachines/play)](https://www.npmjs.com/package/@xmachines/play)
5
+ > Core protocol layer for the Universal Player Architecture. It defines `PlayEvent`, `PlayError`, and the contracts that keep the business logic loosely coupled to the runtime adapters.
11
6
 
12
- Part of the [XMachines JS monorepo](../../README.md).
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Version](https://img.shields.io/badge/version-2.1.0-blue)](https://www.npmjs.com/package/@xmachines/play)
13
8
 
14
9
  ---
15
10
 
@@ -19,27 +14,27 @@ Part of the [XMachines JS monorepo](../../README.md).
19
14
  pnpm add @xmachines/play
20
15
  ```
21
16
 
22
- > **Node.js `>= 22.0.0` required.** All packages are ES modules (`"type": "module"`).
17
+ > **This package requires Node.js `>= 22.0.0`.** Every package is an ES module (`"type": "module"`).
23
18
 
24
19
  ---
25
20
 
26
21
  ## Overview
27
22
 
28
- `@xmachines/play` is the foundational package in the XMachines ecosystem. It defines the minimal set of types and utilities that all other `@xmachines/*` packages build upon:
23
+ `@xmachines/play` is the base package of the XMachines ecosystem. It defines the smallest set of types and utilities that every other `@xmachines/*` package builds on:
29
24
 
30
25
  - **`PlayEvent<TPayload>`** — the universal event contract for Actor ↔ Infrastructure communication
31
26
  - **`PlayError`** — the typed base class for all `@xmachines/*` runtime errors
32
- - **`NonNullableError`** — thrown when a required value is `null` or `undefined`
33
- - **`assertNonNullable()`** — assertion utility that narrows `T | null | undefined` to `T`
27
+ - **`NonNullableError`** — the error that a package throws when a required value is `null` or `undefined`
28
+ - **`assertNonNullable()`** — the assertion utility that narrows `T | null | undefined` to `T`
34
29
 
35
- These protocols implement the architectural invariants defined in the Play RFC:
30
+ These protocols implement the architectural invariants that the Play RFC defines:
36
31
 
37
- | # | Invariant | Description |
38
- | ------ | -------------------------- | ------------------------------------------------------------------ |
39
- | INV-01 | **Actor Authority** | The Actor is the final authority; guards decide all transitions |
40
- | INV-02 | **Strict Separation** | Business logic never imports UI frameworks or routing libraries |
41
- | INV-04 | **Passive Infrastructure** | Infrastructure observes Actor signals; it never enforces guards |
42
- | INV-05 | **Signal-Only Reactivity** | TC39 Signals are the exclusive cross-boundary communication medium |
32
+ | # | Invariant | Description |
33
+ | ------ | -------------------------- | ------------------------------------------------------------------------ |
34
+ | INV-01 | **Actor Authority** | The Actor is the final authority. Guards decide all transitions |
35
+ | INV-02 | **Strict Separation** | The business logic never imports a UI framework or a routing library |
36
+ | INV-04 | **Passive Infrastructure** | The infrastructure observes the Actor signals. It never enforces a guard |
37
+ | INV-05 | **Signal-Only Reactivity** | TC39 Signals are the only medium that crosses a boundary |
43
38
 
44
39
  ---
45
40
 
@@ -47,7 +42,7 @@ These protocols implement the architectural invariants defined in the Play RFC:
47
42
 
48
43
  ### `PlayEvent<TPayload>`
49
44
 
50
- The minimal event contract: any object with a `type: string` property. Framework-agnostic works with XState, Robot, and any other state machine library.
45
+ The minimal event contract is any object with a `type: string` property. The contract is framework-agnostic. It works with XState, with Robot, and with every other state machine library.
51
46
 
52
47
  ```typescript
53
48
  import type { PlayEvent } from "@xmachines/play";
@@ -70,14 +65,14 @@ const invalid: LoginEvent = { type: "auth.login" }; // Error!
70
65
 
71
66
  ### `PlayError`
72
67
 
73
- Base class for all `@xmachines/*` runtime errors. Every error has a stable `scope` (throwing class/module) and `code` (machine-readable identifier). Always branch on `.code` or subclass never on `.message`.
68
+ Base class for every `@xmachines/*` runtime error. Each error has a stable `scope` (the class or the module that throws it) and a stable `code` (a machine-readable identifier). Always branch on `.code` or on the subclass. Never branch on `.message`.
74
69
 
75
70
  ```typescript
76
- import { PlayError } from "@xmachines/play";
71
+ import { PlayError, assertNonNullable } from "@xmachines/play";
77
72
  import { NonNullableError } from "@xmachines/play/errors";
78
73
 
79
74
  try {
80
- bridge.connect();
75
+ assertNonNullable(document.getElementById("app"), "#app");
81
76
  } catch (err) {
82
77
  if (err instanceof NonNullableError) {
83
78
  // err.scope === "assertNonNullable"
@@ -107,15 +102,12 @@ export class MyPackageError extends PlayError {
107
102
 
108
103
  ### `assertNonNullable(value, name?)`
109
104
 
110
- Assertion utility that returns `value` typed as `NonNullable<V>` or throws `NonNullableError`. Eliminates unsafe `!` non-null assertions.
105
+ The assertion utility returns `value` with the type `NonNullable<V>`, or it throws `NonNullableError`. It removes the unsafe `!` non-null assertion.
111
106
 
112
107
  ```typescript
113
108
  import { assertNonNullable } from "@xmachines/play";
114
109
 
115
- // Inject + assert in one line — no intermediate variable or `!` needed:
116
- const actor = assertNonNullable(inject<AuthActor>("actor"), "actor");
117
-
118
- // DOM element lookup:
110
+ // DOM element lookup — no intermediate variable or `!` needed:
119
111
  const el = assertNonNullable(document.getElementById("app"), "#app");
120
112
  ```
121
113
 
@@ -125,18 +117,18 @@ const el = assertNonNullable(document.getElementById("app"), "#app");
125
117
 
126
118
  ### Exported from `@xmachines/play`
127
119
 
128
- | Export | Kind | Description |
129
- | --------------------- | ---------- | ---------------------------------------------------------------- |
130
- | `PlayEvent<TPayload>` | `type` | Universal event contract — `{ type: string } & TPayload` |
131
- | `PlayError` | `class` | Base class for all `@xmachines/*` typed errors |
132
- | `NonNullableError` | `class` | Thrown by `assertNonNullable` when a value is `null`/`undefined` |
133
- | `assertNonNullable` | `function` | Asserts non-null, returns narrowed value |
120
+ | Export | Kind | Description |
121
+ | --------------------- | ---------- | ------------------------------------------------------------------- |
122
+ | `PlayEvent<TPayload>` | `type` | Universal event contract — `{ type: string } & TPayload` |
123
+ | `PlayError` | `class` | Base class for all `@xmachines/*` typed errors |
124
+ | `NonNullableError` | `class` | `assertNonNullable` throws it when a value is `null` or `undefined` |
125
+ | `assertNonNullable` | `function` | Asserts that the value is not null. It returns the narrowed value |
134
126
 
135
127
  ### Exported from `@xmachines/play/errors`
136
128
 
137
129
  | Export | Kind | Description |
138
130
  | ------------------ | ------- | --------------------------------------------------------- |
139
- | `PlayError` | `class` | Re-exported base error class |
131
+ | `PlayError` | `class` | The base error class, re-exported |
140
132
  | `NonNullableError` | `class` | `scope: "assertNonNullable"`, `code: "PLAY_NON_NULLABLE"` |
141
133
 
142
134
  ---
@@ -147,15 +139,13 @@ const el = assertNonNullable(document.getElementById("app"), "#app");
147
139
  | ------------------- | ------------------ | ---------------------------------------------------- |
148
140
  | `PLAY_NON_NULLABLE` | `NonNullableError` | `assertNonNullable()` receives `null` or `undefined` |
149
141
 
150
- Other `@xmachines/*` packages export their own error subclasses from their respective `./errors` subpath:
142
+ Every other `@xmachines/*` package exports its own error subclasses from its `./errors` subpath:
151
143
 
152
144
  | Package | Import path |
153
145
  | ---------------------------- | ----------------------------------- |
154
146
  | `@xmachines/play` | `@xmachines/play/errors` |
155
147
  | `@xmachines/play-router` | `@xmachines/play-router/errors` |
156
148
  | `@xmachines/play-xstate` | `@xmachines/play-xstate/errors` |
157
- | `@xmachines/play-react` | `@xmachines/play-react/errors` |
158
- | `@xmachines/play-solid` | `@xmachines/play-solid/errors` |
159
149
  | `@xmachines/play-vue-router` | `@xmachines/play-vue-router/errors` |
160
150
 
161
151
  ---
@@ -184,59 +174,61 @@ MIT © [Mikael Karon](mailto:mikael@karon.se)
184
174
 
185
175
  See [LICENSE](./LICENSE) for details.
186
176
 
187
- @xmachines/play - Core Protocol Layer
177
+ @xmachines/play - the core protocol layer
188
178
 
189
- Defines architectural contracts enabling Actor Infrastructure communication
190
- without direct dependencies. Per RFC section 5.2, these protocols establish
191
- the foundation for loose coupling between business logic and runtime adapters.
179
+ This package defines the architectural contracts that carry the communication
180
+ between the Actor and the infrastructure, with no direct dependency between them.
181
+ RFC section 5.2 gives these protocols. They are the base of the loose coupling
182
+ between the business logic and the runtime adapters.
192
183
 
193
- ## Exports
184
+ ## The exports
194
185
 
195
- **PlayEvent<TPayload>** - Generic event type for Actor communication
186
+ **PlayEvent<TPayload>** - the generic event type of the Actor communication
196
187
 
197
- - Any object with a `type: string` property
198
- - Generic `TPayload` parameter for type-safe event shapes (optional)
199
- - Defaults to `Record<string, unknown>` for maximum flexibility
200
- - Framework-agnostic (not tied to XState or any specific library)
188
+ - It is every object with a `type: string` property
189
+ - The generic `TPayload` parameter gives a type-safe event shape, and it is optional
190
+ - The default is `Record<string, unknown>`, which accepts each shape
191
+ - It is framework-agnostic, and it is not bound to XState or to another library
201
192
 
202
- **Usage:**
193
+ **Use:**
203
194
 
204
195
  ```typescript
205
- // Flexible (default):
196
+ // Flexible, the default:
206
197
  const event: PlayEvent = { type: "auth.login", userId: "123" };
207
198
 
208
- // Type-safe (with generic):
199
+ // Type-safe, with the generic parameter:
209
200
  type LoginEvent = PlayEvent<{ userId: string }>;
210
201
  const event: LoginEvent = { type: "auth.login", userId: "123" };
211
202
  ```
212
203
 
213
- **Common Event Patterns:**
204
+ **The common event patterns:**
214
205
 
215
- - Domain events: `{ type: 'auth.login', userId: '123' }`
216
- - Custom events: `{ type: 'form.submit', data: {...} }`
206
+ - A domain event: `{ type: 'auth.login', userId: '123' }`
207
+ - Your own event: `{ type: 'form.submit', data: {...} }`
217
208
 
218
- **Routing Events** are provided by @xmachines/play-router:
209
+ **The routing events** come from @xmachines/play-router:
219
210
 
220
- - PlayRouteEvent: Enhanced routing with parameters and state ID targeting
221
- - RouterBridge: Protocol for router adapters to connect with actors
211
+ - PlayRouteEvent: the routing event with the parameters and the target state ID
212
+ - RouterBridge: the protocol that connects a router adapter to an actor
222
213
 
223
- **Browser Navigation:** Browser back/forward buttons are handled by router adapters
224
- via the `popstate` event. When users press back/forward, the router detects the URL
225
- change and sends a PlayRouteEvent to the actor for validation.
214
+ **The browser navigation:** a router adapter handles the browser BACK and FORWARD
215
+ buttons, through the `popstate` event. The user presses BACK or FORWARD, the
216
+ router detects the new URL, and it sends a PlayRouteEvent to the actor. The actor
217
+ then checks the event.
226
218
 
227
219
  ```typescript
228
220
  import type { PlayRouteEvent, RouterBridge } from "@xmachines/play-router";
229
221
  ```
230
222
 
231
- ## Architectural Invariants
223
+ ## The architectural invariants
232
224
 
233
- These protocols enforce the following invariants:
225
+ These protocols enforce the invariants below:
234
226
 
235
- 1. **Actor Authority**: Infrastructure proposes intents, Actor decides validity
236
- 2. **Strict Separation**: No direct dependencies between layers
237
- 3. **Passive Infrastructure**: Infrastructure observes Actor signals, never controls
238
- 4. **Signal-Only Reactivity**: All state changes flow through TC39 Signals
239
- 5. **State-Driven Reset**: Navigation follows state machine transition rules
227
+ 1. **Actor Authority**: the infrastructure makes a request, and the Actor decides the validity
228
+ 2. **Strict Separation**: no layer depends on another layer directly
229
+ 3. **Passive Infrastructure**: the infrastructure observes the Actor signals. It never controls them
230
+ 4. **Signal-Only Reactivity**: every state change goes through a TC39 Signal
231
+ 5. **State-Driven Reset**: each navigation follows the transition rules of the state machine
240
232
 
241
233
  ## Classes
242
234
 
@@ -2,12 +2,12 @@
2
2
 
3
3
  # Class: NonNullableError
4
4
 
5
- Defined in: [packages/play/src/errors.ts:111](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play/src/errors.ts#L111)
5
+ Defined in: [packages/play/src/errors.ts:110](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play/src/errors.ts#L110)
6
6
 
7
- Thrown by [assertNonNullable](../functions/assertNonNullable.md) when a value is `null` or `undefined`.
7
+ [assertNonNullable](../functions/assertNonNullable.md) throws this error when a value is `null` or `undefined`.
8
8
 
9
- Catch this specifically to distinguish a missing-value assertion failure from
10
- other runtime errors:
9
+ Catch it to separate a failed assertion of a missing value from every other
10
+ runtime error:
11
11
 
12
12
  ```ts
13
13
  import { NonNullableError } from "@xmachines/play/errors";
@@ -35,7 +35,7 @@ try {
35
35
  new NonNullableError(message, options?): NonNullableError;
36
36
  ```
37
37
 
38
- Defined in: [packages/play/src/errors.ts:112](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play/src/errors.ts#L112)
38
+ Defined in: [packages/play/src/errors.ts:111](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play/src/errors.ts#L111)
39
39
 
40
40
  #### Parameters
41
41
 
@@ -54,15 +54,15 @@ Defined in: [packages/play/src/errors.ts:112](https://gitlab.com/xmachin-es/xmac
54
54
 
55
55
  ## Properties
56
56
 
57
- | Property | Modifier | Type | Description | Inherited from | Defined in |
58
- | ------------------------------------------------------- | ---------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
59
- | <a id="property-cause"></a> `cause?` | `public` | `unknown` | - | [`PlayError`](PlayError.md).[`cause`](PlayError.md#property-cause) | - |
60
- | <a id="property-code"></a> `code` | `readonly` | `string` | A stable, machine-readable error identifier. Error codes follow the `PLAY_<PACKAGE>_<DESCRIPTION>` naming convention and are guaranteed stable across patch and minor releases within a major version. Never match on `.message` always match on `.code` or the subclass. | [`PlayError`](PlayError.md).[`code`](PlayError.md#property-code) | [packages/play/src/errors.ts:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play/src/errors.ts#L75) |
61
- | <a id="property-message"></a> `message` | `public` | `string` | - | [`PlayError`](PlayError.md).[`message`](PlayError.md#property-message) | - |
62
- | <a id="property-name"></a> `name` | `public` | `string` | - | [`PlayError`](PlayError.md).[`name`](PlayError.md#property-name) | - |
63
- | <a id="property-scope"></a> `scope` | `readonly` | `string` | The class or module that threw this error (e.g. `"RouterBridgeBase"`). | [`PlayError`](PlayError.md).[`scope`](PlayError.md#property-scope) | [packages/play/src/errors.ts:66](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play/src/errors.ts#L66) |
64
- | <a id="property-stack"></a> `stack?` | `public` | `string` | - | [`PlayError`](PlayError.md).[`stack`](PlayError.md#property-stack) | - |
65
- | <a id="property-stacktracelimit"></a> `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | [`PlayError`](PlayError.md).[`stackTraceLimit`](PlayError.md#property-stacktracelimit) | - |
57
+ | Property | Modifier | Type | Description | Inherited from | Defined in |
58
+ | ------------------------------------------------------- | ---------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
59
+ | <a id="property-cause"></a> `cause?` | `public` | `unknown` | - | [`PlayError`](PlayError.md).[`cause`](PlayError.md#property-cause) | - |
60
+ | <a id="property-code"></a> `code` | `readonly` | `string` | A stable, machine-readable identifier of the error. An error code follows the naming convention `PLAY_<PACKAGE>_<DESCRIPTION>`. It stays the same across each patch release and each minor release of one major version. Never match on `.message`. Always match on `.code`, or on the subclass. | [`PlayError`](PlayError.md).[`code`](PlayError.md#property-code) | [packages/play/src/errors.ts:74](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play/src/errors.ts#L74) |
61
+ | <a id="property-message"></a> `message` | `public` | `string` | - | [`PlayError`](PlayError.md).[`message`](PlayError.md#property-message) | - |
62
+ | <a id="property-name"></a> `name` | `public` | `string` | - | [`PlayError`](PlayError.md).[`name`](PlayError.md#property-name) | - |
63
+ | <a id="property-scope"></a> `scope` | `readonly` | `string` | The class or the module that threw this error, for example `"RouterBridgeBase"`. | [`PlayError`](PlayError.md).[`scope`](PlayError.md#property-scope) | [packages/play/src/errors.ts:64](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play/src/errors.ts#L64) |
64
+ | <a id="property-stack"></a> `stack?` | `public` | `string` | - | [`PlayError`](PlayError.md).[`stack`](PlayError.md#property-stack) | - |
65
+ | <a id="property-stacktracelimit"></a> `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | [`PlayError`](PlayError.md).[`stackTraceLimit`](PlayError.md#property-stacktracelimit) | - |
66
66
 
67
67
  ## Methods
68
68
 
@@ -2,21 +2,21 @@
2
2
 
3
3
  # Class: PlayError
4
4
 
5
- Defined in: [packages/play/src/errors.ts:64](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play/src/errors.ts#L64)
5
+ Defined in: [packages/play/src/errors.ts:62](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play/src/errors.ts#L62)
6
6
 
7
- Base class for all typed runtime errors thrown by `@xmachines/*` packages.
7
+ The base class of every typed runtime error of an `@xmachines/*` package.
8
8
 
9
- `PlayError` gives every error two structured fields:
9
+ `PlayError` gives each error two structured fields:
10
10
 
11
- - `scope` — the class or module that threw (e.g. `"RouterBridgeBase"`)
12
- - `code` — a stable, machine-readable identifier (e.g. `"PLAY_ROUTER_SYNC_FAILED"`)
11
+ - `scope` — the class or the module that threw the error, for example `"RouterBridgeBase"`
12
+ - `code` — a stable, machine-readable identifier, for example `"PLAY_ROUTER_SYNC_FAILED"`
13
13
 
14
- These fields let application code branch on error type without parsing `.message`
15
- strings, which change across releases.
14
+ Your application code therefore branches on the type of an error, and it does not
15
+ parse the `.message` string. A message changes between releases.
16
16
 
17
- ## Error codes
17
+ ## The error codes
18
18
 
19
- Each `@xmachines/*` package exports its own typed subclasses from an
19
+ An `@xmachines/*` package that defines typed subclasses exports them from an
20
20
  `"./errors"` subpath:
21
21
 
22
22
  | Package | Import |
@@ -25,13 +25,11 @@ Each `@xmachines/*` package exports its own typed subclasses from an
25
25
  | `@xmachines/play-router` | `@xmachines/play-router/errors` |
26
26
  | `@xmachines/play-vue-router` | `@xmachines/play-vue-router/errors` |
27
27
  | `@xmachines/play-xstate` | `@xmachines/play-xstate/errors` |
28
- | `@xmachines/play-react` | `@xmachines/play-react/errors` |
29
- | `@xmachines/play-solid` | `@xmachines/play-solid/errors` |
30
28
 
31
- `PlayError` itself is exported from the root `@xmachines/play` and is the base
32
- for all of those subclasses.
29
+ The root `@xmachines/play` exports `PlayError` itself, and it is the base of every
30
+ subclass above.
33
31
 
34
- ## Catching errors by type
32
+ ## How to catch an error by its type
35
33
 
36
34
  ```typescript
37
35
  import { PlayError } from "@xmachines/play";
@@ -43,18 +41,18 @@ try {
43
41
  if (err instanceof RouterSyncError) {
44
42
  // err.scope === "RouterBridgeBase"
45
43
  // err.code === "PLAY_ROUTER_SYNC_FAILED"
46
- // err.cause — the original error that triggered the sync failure
44
+ // err.cause — the original error of the failed synchronization
47
45
  reportToMonitoring(err);
48
46
  } else if (err instanceof PlayError) {
49
- // Any other @xmachines/* error
47
+ // Every other @xmachines/* error
50
48
  console.error(`[${err.scope}:${err.code}] ${err.message}`);
51
49
  } else {
52
- throw err; // Re-throw unknown errors
50
+ throw err; // Throw an unknown error again
53
51
  }
54
52
  }
55
53
  ```
56
54
 
57
- ## Extending PlayError
55
+ ## How to extend PlayError
58
56
 
59
57
  ```typescript
60
58
  import { PlayError } from "@xmachines/play";
@@ -87,16 +85,16 @@ new PlayError(
87
85
  options?): PlayError;
88
86
  ```
89
87
 
90
- Defined in: [packages/play/src/errors.ts:83](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play/src/errors.ts#L83)
88
+ Defined in: [packages/play/src/errors.ts:82](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play/src/errors.ts#L82)
91
89
 
92
90
  #### Parameters
93
91
 
94
- | Parameter | Type | Description |
95
- | ---------- | -------------- | ------------------------------------------------------------------------- |
96
- | `scope` | `string` | The class or module throwing this error. |
97
- | `code` | `string` | Machine-readable error identifier (e.g. `"PLAY_ROUTER_SYNC_FAILED"`). |
98
- | `message` | `string` | Human-readable description. Do not match on this in code. |
99
- | `options?` | `ErrorOptions` | Standard `ErrorOptions`; pass `{ cause: originalError }` to chain errors. |
92
+ | Parameter | Type | Description |
93
+ | ---------- | -------------- | --------------------------------------------------------------------------------------- |
94
+ | `scope` | `string` | The class or the module that throws this error. |
95
+ | `code` | `string` | The machine-readable identifier of the error, for example `"PLAY_ROUTER_SYNC_FAILED"`. |
96
+ | `message` | `string` | The description for a person. Never match on it in your code. |
97
+ | `options?` | `ErrorOptions` | The standard `ErrorOptions`. Give `{ cause: originalError }` to make a chain of errors. |
100
98
 
101
99
  #### Returns
102
100
 
@@ -110,15 +108,15 @@ Error.constructor;
110
108
 
111
109
  ## Properties
112
110
 
113
- | Property | Modifier | Type | Description | Inherited from | Defined in |
114
- | ------------------------------------------------------- | ---------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
115
- | <a id="property-cause"></a> `cause?` | `public` | `unknown` | - | `Error.cause` | - |
116
- | <a id="property-code"></a> `code` | `readonly` | `string` | A stable, machine-readable error identifier. Error codes follow the `PLAY_<PACKAGE>_<DESCRIPTION>` naming convention and are guaranteed stable across patch and minor releases within a major version. Never match on `.message` always match on `.code` or the subclass. | - | [packages/play/src/errors.ts:75](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play/src/errors.ts#L75) |
117
- | <a id="property-message"></a> `message` | `public` | `string` | - | `Error.message` | - |
118
- | <a id="property-name"></a> `name` | `public` | `string` | - | `Error.name` | - |
119
- | <a id="property-scope"></a> `scope` | `readonly` | `string` | The class or module that threw this error (e.g. `"RouterBridgeBase"`). | - | [packages/play/src/errors.ts:66](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play/src/errors.ts#L66) |
120
- | <a id="property-stack"></a> `stack?` | `public` | `string` | - | `Error.stack` | - |
121
- | <a id="property-stacktracelimit"></a> `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | `Error.stackTraceLimit` | - |
111
+ | Property | Modifier | Type | Description | Inherited from | Defined in |
112
+ | ------------------------------------------------------- | ---------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------- |
113
+ | <a id="property-cause"></a> `cause?` | `public` | `unknown` | - | `Error.cause` | - |
114
+ | <a id="property-code"></a> `code` | `readonly` | `string` | A stable, machine-readable identifier of the error. An error code follows the naming convention `PLAY_<PACKAGE>_<DESCRIPTION>`. It stays the same across each patch release and each minor release of one major version. Never match on `.message`. Always match on `.code`, or on the subclass. | - | [packages/play/src/errors.ts:74](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play/src/errors.ts#L74) |
115
+ | <a id="property-message"></a> `message` | `public` | `string` | - | `Error.message` | - |
116
+ | <a id="property-name"></a> `name` | `public` | `string` | - | `Error.name` | - |
117
+ | <a id="property-scope"></a> `scope` | `readonly` | `string` | The class or the module that threw this error, for example `"RouterBridgeBase"`. | - | [packages/play/src/errors.ts:64](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play/src/errors.ts#L64) |
118
+ | <a id="property-stack"></a> `stack?` | `public` | `string` | - | `Error.stack` | - |
119
+ | <a id="property-stacktracelimit"></a> `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | `Error.stackTraceLimit` | - |
122
120
 
123
121
  ## Methods
124
122