@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
@@ -2,21 +2,23 @@
2
2
 
3
3
  # Interface: RouterBridge
4
4
 
5
- Defined in: [play-router/src/types.ts:360](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L360)
5
+ Defined in: [play-router/src/types.ts:358](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L358)
6
6
 
7
- RouterBridge interface for runtime infrastructure adapters
7
+ The RouterBridge interface of a runtime infrastructure adapter
8
8
 
9
- Defines the lifecycle connection between Infrastructure (e.g., a framework router) and
10
- the Actor. Infrastructure "bridges" to the Actor by observing its signals and
11
- managing its own lifecycle accordingly.
9
+ The interface defines the connection of the lifecycle between the infrastructure,
10
+ for example a framework router, and the Actor. The infrastructure builds a "bridge"
11
+ to the Actor: it observes the signals of the Actor, and it manages its own
12
+ lifecycle accordingly.
12
13
 
13
- **Architectural Context:** Implements **Passive Infrastructure (INV-04)** by establishing
14
- a unidirectional observation pattern. Infrastructure connects to observe Actor signals
15
- (currentRoute, currentView, state) and reflects changes without making state decisions.
14
+ **Architectural context:** the interface implements **Passive Infrastructure
15
+ (INV-04)**, because it gives an observation in one direction. The infrastructure
16
+ connects to observe the signals of the Actor (currentRoute, currentView, and
17
+ state), and it reflects each change. It makes no decision about the state.
16
18
 
17
19
  ## Example
18
20
 
19
- Framework router bridge implementation
21
+ The implementation of a framework router bridge
20
22
 
21
23
  ```typescript
22
24
  import type { RouterBridge } from "@xmachines/play-router";
@@ -26,7 +28,7 @@ class MyRouterBridge implements RouterBridge {
26
28
  private watcher: Signal.Watcher | null = null;
27
29
 
28
30
  async connect(): Promise<void> {
29
- // Start observing actor.currentRoute signal
31
+ // Start the observation of the actor.currentRoute signal
30
32
  this.watcher = new Signal.subtle.Watcher(() => {
31
33
  const route = actor.currentRoute.get();
32
34
  if (route) router.navigate(route);
@@ -35,7 +37,7 @@ class MyRouterBridge implements RouterBridge {
35
37
  }
36
38
 
37
39
  async disconnect(): Promise<void> {
38
- // Stop observing, cleanup watchers
40
+ // Stop the observation, and clean the watchers up
39
41
  this.watcher?.unwatch(actor.currentRoute);
40
42
  this.watcher = null;
41
43
  }
@@ -44,7 +46,7 @@ class MyRouterBridge implements RouterBridge {
44
46
 
45
47
  ## See
46
48
 
47
- [Play RFC](../../../../rfc/play.md) - Invariant INV-04
49
+ [Play RFC](../../../../rfc/play.md) - invariant INV-04
48
50
 
49
51
  ## Methods
50
52
 
@@ -54,25 +56,26 @@ class MyRouterBridge implements RouterBridge {
54
56
  connect(): void | Promise<void>;
55
57
  ```
56
58
 
57
- Defined in: [play-router/src/types.ts:376](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L376)
59
+ Defined in: [play-router/src/types.ts:375](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L375)
58
60
 
59
- Connect the router bridge to the Actor
61
+ Connects the router bridge to the Actor
60
62
 
61
- Called when Infrastructure should begin observing Actor signals and
62
- synchronizing its state (e.g., browser URL) with Actor state.
63
+ The infrastructure calls it when it must start the observation of the Actor
64
+ signals, and when it must bring its own state, for example the browser URL, in line
65
+ with the Actor state.
63
66
 
64
67
  #### Returns
65
68
 
66
69
  `void` \| `Promise`\<`void`\>
67
70
 
68
- Promise that resolves when connection is established, or void for synchronous connection
71
+ The promise that resolves after the connection, or void for a synchronous connection
69
72
 
70
73
  #### Example
71
74
 
72
75
  ```typescript
73
76
  const bridge: RouterBridge = createBridge(actor, router);
74
77
  await bridge.connect();
75
- // Bridge now observing actor.currentRoute signal
78
+ // The bridge observes the actor.currentRoute signal now
76
79
  ```
77
80
 
78
81
  ---
@@ -83,22 +86,22 @@ await bridge.connect();
83
86
  disconnect(): void | Promise<void>;
84
87
  ```
85
88
 
86
- Defined in: [play-router/src/types.ts:392](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-router/src/types.ts#L392)
89
+ Defined in: [play-router/src/types.ts:391](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L391)
87
90
 
88
- Disconnect the router bridge from the Actor
91
+ Disconnects the router bridge from the Actor
89
92
 
90
- Called when Infrastructure should stop observing and clean up resources
91
- (e.g., signal watchers, event listeners).
93
+ The infrastructure calls it when it must stop the observation and free its
94
+ resources, for example a signal watcher and an event listener.
92
95
 
93
96
  #### Returns
94
97
 
95
98
  `void` \| `Promise`\<`void`\>
96
99
 
97
- Promise that resolves when disconnection is complete, or void for synchronous disconnection
100
+ The promise that resolves after the disconnection, or void for a synchronous disconnection
98
101
 
99
102
  #### Example
100
103
 
101
104
  ```typescript
102
105
  await bridge.disconnect();
103
- // Bridge stopped observing, resources cleaned up
106
+ // The bridge stopped its observation, and it freed its resources
104
107
  ```
@@ -6,9 +6,9 @@
6
6
  type PlayRouterBridgeConstructor<TRouter> = (router, actor, routeMap) => RouterBridge;
7
7
  ```
8
8
 
9
- Defined in: [play-react-router/src/create-play-router-provider.tsx:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-react-router/src/create-play-router-provider.tsx#L20)
9
+ Defined in: [play-react-router/src/create-play-router-provider.tsx:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react-router/src/create-play-router-provider.tsx#L20)
10
10
 
11
- Constructor shape a bridge class must satisfy to be used with
11
+ The constructor shape that a bridge class must satisfy for
12
12
  `createPlayRouterProvider`: `(router, actor, routeMap) → RouterBridge`.
13
13
 
14
14
  ## Type Parameters
@@ -6,14 +6,15 @@
6
6
  const PlayRouterProvider: <TActor>(__namedParameters) => Element;
7
7
  ```
8
8
 
9
- Defined in: [play-react-router/src/play-router-provider.tsx:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0-alpha.1/packages/play-react-router/src/play-router-provider.tsx#L38)
9
+ Defined in: [play-react-router/src/play-router-provider.tsx:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-react-router/src/play-router-provider.tsx#L40)
10
10
 
11
- Connects a `PlayerActor` to React Router, keeping actor state and browser URL
12
- in sync bidirectionally.
11
+ Connects a `PlayerActor` to React Router. It keeps the actor state and the browser
12
+ URL in step, in both directions.
13
13
 
14
- The bridge is created once on mount and torn down on unmount. It is also
15
- rebuilt if `actor`, `router`, or `routeMap` change identity so all three
16
- props must be **stable references** (created outside JSX or memoized).
14
+ The component creates the bridge one time, on mount, and it disconnects the bridge
15
+ on unmount. It also builds the bridge again on a change of the identity of `actor`,
16
+ of `router`, or of `routeMap`. Therefore all three props must be **stable
17
+ references**: create them outside the JSX, or hold them with `useMemo`.
17
18
 
18
19
  ## Type Parameters
19
20
 
@@ -1,31 +1,29 @@
1
1
  [API](../../README.md) / @xmachines/play-router
2
2
 
3
- <!-- generated-by: gsd-doc-writer -->
4
-
5
3
  # @xmachines/play-router
6
4
 
7
- Route tree extraction from XState v6 state machines. Part of [@xmachines/play](../play/README.md) Universal Player Architecture.
5
+ Route tree extraction from XState v5 state machines. Part of [@xmachines/play](../play/README.md) Universal Player Architecture.
8
6
 
9
- Graph-based route extraction and bidirectional lookup enabling Actor Authority over navigation.
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-router)
10
8
 
11
- Part of the [xmachines-js monorepo](../../README.md).
9
+ This package extracts the routes from a machine graph and looks them up in both directions. The Actor therefore keeps the authority over the navigation.
12
10
 
13
11
  ## Installation
14
12
 
15
13
  ```bash
16
- pnpm add xstate@^6.0.0-alpha.19
14
+ pnpm add xstate@^5.31.0
17
15
  pnpm add @xmachines/play-router
18
16
  ```
19
17
 
20
18
  **Peer dependencies:**
21
19
 
22
- - `xstate` ^6.0.0-alpha.19 — XState v6 state machine runtime
20
+ - `xstate` ^5.31.0 — XState v5 state machine runtime
23
21
 
24
22
  **URLPattern polyfill (Node.js < 24 / older browsers):**
25
23
 
26
- `@xmachines/play-router` uses the [URLPattern API](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern) for dynamic route matching. URLPattern is available natively on Node.js 24+ and modern browsers (Chrome 95+, Firefox 117+, Safari 16.4+).
24
+ `@xmachines/play-router` matches each dynamic route with the [URLPattern API](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern). URLPattern is native in Node.js 24+ and in a modern browser (Chrome 95+, Firefox 117+, Safari 16.4+).
27
25
 
28
- On environments without native support, load a polyfill **before** importing this package:
26
+ In an environment without the native API, load a polyfill **before** you import this package:
29
27
 
30
28
  ```typescript
31
29
  // Entry point — must run before any @xmachines/play-router import
@@ -38,23 +36,17 @@ Install the polyfill:
38
36
  pnpm add urlpattern-polyfill
39
37
  ```
40
38
 
41
- `urlpattern-polyfill` is declared as an optional peer dependency. Package managers will not install it automatically consumers must install and load it when their runtime lacks native URLPattern support.
39
+ `urlpattern-polyfill` is an optional peer dependency. A package manager does not install it for you. Install it and load it yourself when your runtime has no native URLPattern.
42
40
 
43
41
  ## Usage
44
42
 
45
43
  ### Extract routes from a machine
46
44
 
47
45
  ```typescript
48
- import { setup, types } from "xstate";
46
+ import { createMachine } from "xstate";
49
47
  import { extractMachineRoutes, createRouteMap } from "@xmachines/play-router";
50
48
 
51
- // meta.route on state nodes needs a declared meta schema —
52
- // without it, XState v6 types `meta` as `never`.
53
- const machine = setup({
54
- schemas: {
55
- meta: types<{ route?: string }>(),
56
- },
57
- }).createMachine({
49
+ const machine = createMachine({
58
50
  id: "app",
59
51
  initial: "home",
60
52
  states: {
@@ -103,8 +95,13 @@ routeMap.getPathByStateId("profile"); // "/profile/:userId"
103
95
  ### Sending `play.route` events
104
96
 
105
97
  ```typescript
98
+ import { definePlayer } from "@xmachines/play-xstate";
106
99
  import type { PlayRouteEvent } from "@xmachines/play-router";
107
100
 
101
+ // machine: your routable machine (states carry meta.route)
102
+ const actor = definePlayer({ machine })();
103
+ actor.start();
104
+
108
105
  // Navigate to a state by ID
109
106
  const event: PlayRouteEvent = {
110
107
  type: "play.route",
@@ -128,14 +125,21 @@ actor.send({
128
125
  });
129
126
  ```
130
127
 
131
- ### Implementing a `RouterBridgeBase` adapter
128
+ ### How to write a `RouterBridgeBase` adapter
132
129
 
133
- Extend `RouterBridgeBase` and implement the three abstract methods for your framework:
130
+ Extend `RouterBridgeBase`, then implement the three abstract methods for your framework:
134
131
 
135
132
  ```typescript
136
- import { RouterBridgeBase } from "@xmachines/play-router";
133
+ import { RouterBridgeBase, createRouteMap } from "@xmachines/play-router";
137
134
  import type { RoutableActor } from "@xmachines/play-router";
138
135
 
136
+ // Shape of your framework's router — adjust to its real API
137
+ type MyRouter = {
138
+ navigate(path: string): void;
139
+ subscribe(handler: (location: { pathname: string; search: string }) => void): () => void;
140
+ state: { location: { pathname: string } };
141
+ };
142
+
139
143
  export class MyRouterBridge extends RouterBridgeBase {
140
144
  private unsubscribe: (() => void) | null = null;
141
145
 
@@ -171,7 +175,8 @@ export class MyRouterBridge extends RouterBridgeBase {
171
175
  }
172
176
  }
173
177
 
174
- // Usage
178
+ // Usage — myRouter: your framework's router instance;
179
+ // machine/actor: your routable machine and its started actor
175
180
  const routeMap = createRouteMap(machine);
176
181
  const bridge = new MyRouterBridge(myRouter, actor, routeMap);
177
182
  bridge.connect();
@@ -183,81 +188,79 @@ bridge.disconnect();
183
188
 
184
189
  ### Route Extraction
185
190
 
186
- | Export | Description |
187
- | ---------------------------------------- | ---------------------------------------------------------------------------------- |
188
- | `extractMachineRoutes(machine)` | Convert an XState machine to a `RouteTree` with bidirectional state ID ↔ path maps |
189
- | `createRouteMap(machine, options?)` | Build a `RouteMap` directly from a machine (preferred form for adapters) |
190
- | `createRouteMapFromTree(tree, options?)` | Build a `RouteMap` from an already-extracted `RouteTree` |
191
- | `buildRouteTree(routes)` | Build a `RouteTree` from an array of `RouteInfo` objects |
192
- | `machineToGraph(machine)` | Convert a machine to a typed `@statelyai/graph` `Graph` for graph algorithm access |
193
-
194
- > **Graph shape under XState v6:** machines wired by `formatPlayRouteTransitions` expose their route navigation as statically-targeted `xstate.route` edges (one per routed state) plus a single dynamic `play.route` forwarder edge — tooling that previously filtered for per-route `play.route` edges should query `xstate.route` instead. Edge data marks guard presence with `guarded: true`; guard _names_ are unrecoverable under v6 (`guardType` is never populated).
191
+ | Export | Description |
192
+ | ---------------------------------------- | --------------------------------------------------------------------------------- |
193
+ | `extractMachineRoutes(machine)` | Converts an XState machine into a `RouteTree` with the state ID ↔ path maps |
194
+ | `createRouteMap(machine, options?)` | Builds a `RouteMap` directly from a machine. An adapter uses this form |
195
+ | `createRouteMapFromTree(tree, options?)` | Builds a `RouteMap` from a `RouteTree` that you extracted before |
196
+ | `buildRouteTree(routes)` | Builds a `RouteTree` from an array of `RouteInfo` objects |
197
+ | `machineToGraph(machine)` | Converts a machine into a typed `@statelyai/graph` `Graph`, for a graph algorithm |
195
198
 
196
199
  ### Route Matching
197
200
 
198
- | Export | Description |
199
- | ----------------------------- | ------------------------------------------------------------------------------------------ |
200
- | `RouteMap` | Bidirectional `stateId ↔ path` lookup class; supports O(1) exact and O(k) pattern matching |
201
- | `findRouteById(tree, id)` | Look up a `RouteNode` by state ID |
202
- | `findRouteByPath(tree, path)` | Look up a `RouteNode` by URL path (supports dynamic patterns) |
201
+ | Export | Description |
202
+ | ----------------------------- | ------------------------------------------------------------------------------------------------------------- |
203
+ | `RouteMap` | The `stateId ↔ path` lookup class for both directions. It matches an exact path in O(1) and a pattern in O(k) |
204
+ | `findRouteById(tree, id)` | Finds a `RouteNode` by its state ID |
205
+ | `findRouteByPath(tree, path)` | Finds a `RouteNode` by its URL path. It also matches a dynamic pattern |
203
206
 
204
207
  ### Query Utilities
205
208
 
206
- | Export | Description |
207
- | ------------------------------------------------- | ------------------------------------------------------------------------- |
208
- | `getRoutableRoutes(tree)` | All routable `RouteNode`s as a flat array |
209
- | `getNavigableRoutes(tree, stateId)` | Child routes reachable from a state (hierarchical + transition-reachable) |
210
- | `routeExists(tree, path)` | Check whether a path is registered in the tree |
211
- | `getTransitionReachableRoutes(graph, stateId)` | Route paths reachable via XState transitions from a state |
212
- | `isRouteReachable(graph, fromStateId, toStateId)` | Check whether a transition path exists between two states |
209
+ | Export | Description |
210
+ | ------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
211
+ | `getRoutableRoutes(tree)` | Returns every routable `RouteNode` in one flat array |
212
+ | `getNavigableRoutes(tree, stateId)` | Returns the child routes that a state can reach, through the hierarchy and through a transition |
213
+ | `routeExists(tree, path)` | Tells you if the tree holds a path |
214
+ | `getTransitionReachableRoutes(graph, stateId)` | Returns the route paths that a state can reach through an XState transition |
215
+ | `isRouteReachable(graph, fromStateId, toStateId)` | Tells you if a transition path is present between two states |
213
216
 
214
217
  ### Router Bridge
215
218
 
216
- | Export | Description |
217
- | --------------------------------------- | ------------------------------------------------------------------------------------- |
218
- | `RouterBridgeBase` | Abstract base class for framework router adapters; implements `RouterBridge` protocol |
219
- | `sanitizePathname(path)` | Normalize a raw pathname; returns `null` for paths > 2048 chars or malformed input |
220
- | `buildPlayRouteEvent(options)` | Build a `PlayRouteEvent` from a pathname + route-map match result |
221
- | `extractRouteParams(pathname, pattern)` | Extract path parameters from a URL using URLPattern |
222
- | `extractQuery(search)` | Extract query parameters from a URL search string |
219
+ | Export | Description |
220
+ | --------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
221
+ | `RouterBridgeBase` | The abstract base class of each framework router adapter. It implements the `RouterBridge` protocol |
222
+ | `sanitizePathname(path)` | Normalizes a raw pathname. It returns `null` for a path of more than 2048 characters, and for malformed input |
223
+ | `buildPlayRouteEvent(options)` | Builds a `PlayRouteEvent` from a pathname and a route-map match result |
224
+ | `extractRouteParams(pathname, pattern)` | Reads the path parameters of a URL with URLPattern |
225
+ | `extractQuery(search)` | Reads the query parameters of a URL search string |
223
226
 
224
227
  ### Validation
225
228
 
226
- | Export | Description |
227
- | ---------------------------------------- | ----------------------------------------------------- |
228
- | `validateRouteFormat(route, stateId)` | Assert route path is non-empty |
229
- | `validateStateExists(stateId, stateIds)` | Assert a state ID is present in the machine graph |
230
- | `detectDuplicateRoutes(routes)` | Throw if any two states resolve to the same full path |
229
+ | Export | Description |
230
+ | ---------------------------------------- | ---------------------------------------------------- |
231
+ | `validateRouteFormat(route, stateId)` | Asserts that the route path is not empty |
232
+ | `validateStateExists(stateId, stateIds)` | Asserts that the machine graph holds the state ID |
233
+ | `detectDuplicateRoutes(routes)` | Throws when two states resolve to the same full path |
231
234
 
232
235
  ### Key Types
233
236
 
234
- | Export | Description |
235
- | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
236
- | `RouterBridge` | Interface for `connect()` / `disconnect()` lifecycle |
237
- | `RouteTree` | Hierarchical tree with `root`, `byStateId`, `byPath`, and optional `graph` |
238
- | `RouteNode` | Single node in the tree with `id`, `path`, `fullPath`, `stateId`, `children`, `parent` |
239
- | `RouteInfo` | Flat route descriptor extracted from a state node |
240
- | `PlayRouteEvent` | Routing event `{ type: "play.route", to, params?, query? }` |
241
- | `RoutableActor` | Minimal actor interface required by `RouterBridgeBase` `currentRoute`, `initialRoute`, and `send(PlayRouteEvent)` |
242
- | `PlayActor` | Full actor interface used by `PlayRouterProvider` extends `RoutableActor` with `currentView` (`Routable + Viewable`) |
243
- | `RouteMapping` | `{ stateId, path }` pair used to build a `RouteMap` |
244
- | `RouteMapping as BaseRouteMapping` | Alias for `RouteMapping` (backwards-compat re-export) |
245
- | `MachineGraph` | Typed `@statelyai/graph` Graph with `MachineNodeData` / `MachineEdgeData` |
246
- | `WindowLike` | Injectable minimal `window` interface for SSR / testing |
247
- | `LocationLike` | Injectable minimal `location` interface for SSR / testing |
237
+ | Export | Description |
238
+ | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
239
+ | `RouterBridge` | The interface of the `connect()` and `disconnect()` lifecycle |
240
+ | `RouteTree` | The hierarchical tree, with `root`, `byStateId`, `byPath`, and an optional `graph` |
241
+ | `RouteNode` | One node of the tree, with `id`, `path`, `fullPath`, `stateId`, `children`, and `parent` |
242
+ | `RouteInfo` | The flat route descriptor that comes from a state node |
243
+ | `PlayRouteEvent` | Routing event `{ type: "play.route", to, params?, query? }` |
244
+ | `RoutableActor` | The minimal actor interface that `RouterBridgeBase` requires: `currentRoute`, `initialRoute`, and `send(PlayRouteEvent)` |
245
+ | `PlayActor` | The complete actor interface that `PlayRouterProvider` uses. It extends `RoutableActor` with `currentView` (`Routable + Viewable`) |
246
+ | `RouteMapping` | The `{ stateId, path }` pair that builds a `RouteMap` |
247
+ | `RouteMapping as BaseRouteMapping` | The alias of `RouteMapping`, for compatibility with an earlier version |
248
+ | `MachineGraph` | The typed `@statelyai/graph` Graph, with `MachineNodeData` and `MachineEdgeData` |
249
+ | `WindowLike` | The minimal `window` interface that you can inject for SSR and for a test |
250
+ | `LocationLike` | The minimal `location` interface that you can inject for SSR and for a test |
248
251
 
249
252
  ### Errors (subpath `@xmachines/play-router/errors`)
250
253
 
251
- | Class | Code | When thrown |
252
- | ---------------------------- | --------------------------------------- | ----------------------------------------------------------------- |
253
- | `RouterSyncError` | `PLAY_ROUTER_SYNC_FAILED` | `syncActorFromRouter()` fails to send a `play.route` event |
254
- | `DuplicateBridgeError` | `PLAY_ROUTER_DUPLICATE_BRIDGE` | A second bridge tries to connect to an actor that already has one |
255
- | `URLPatternUnavailableError` | `PLAY_ROUTE_MAP_URLPATTERN_UNAVAILABLE` | URLPattern API is absent and no polyfill is loaded |
256
- | `InvalidRoutePatternError` | `PLAY_ROUTE_MAP_INVALID_PATTERN` | A route pattern string is rejected by the URLPattern constructor |
257
- | `EmptyRoutePathError` | `PLAY_ROUTE_EMPTY_PATH` | A state declares `meta.route: ""` |
258
- | `InvalidStateIdError` | `PLAY_ROUTE_INVALID_STATE_ID` | A route references a state ID not in the machine graph |
259
- | `DuplicateRoutePathError` | `PLAY_ROUTE_DUPLICATE_PATH` | Two or more states share the same URL path |
260
- | `UnknownStateTypeError` | `PLAY_ROUTE_UNKNOWN_STATE_TYPE` | A state node has an unrecognised XState `.type` value |
254
+ | Class | Code | When thrown |
255
+ | ---------------------------- | --------------------------------------- | ----------------------------------------------------------------------- |
256
+ | `RouterSyncError` | `PLAY_ROUTER_SYNC_FAILED` | `syncActorFromRouter()` cannot send a `play.route` event |
257
+ | `DuplicateBridgeError` | `PLAY_ROUTER_DUPLICATE_BRIDGE` | A second bridge tries to connect to an actor that already has one |
258
+ | `URLPatternUnavailableError` | `PLAY_ROUTE_MAP_URLPATTERN_UNAVAILABLE` | The URLPattern API is absent, and no polyfill is loaded |
259
+ | `InvalidRoutePatternError` | `PLAY_ROUTE_MAP_INVALID_PATTERN` | The URLPattern constructor refuses a route pattern string |
260
+ | `EmptyRoutePathError` | `PLAY_ROUTE_EMPTY_PATH` | A state declares `meta.route: ""` |
261
+ | `InvalidStateIdError` | `PLAY_ROUTE_INVALID_STATE_ID` | A route names a state ID that the machine graph does not hold |
262
+ | `DuplicateRoutePathError` | `PLAY_ROUTE_DUPLICATE_PATH` | Two or more states share the same URL path |
263
+ | `UnknownStateTypeError` | `PLAY_ROUTE_UNKNOWN_STATE_TYPE` | A state node has an XState `.type` value that the package does not know |
261
264
 
262
265
  ```typescript
263
266
  import {
@@ -266,6 +269,7 @@ import {
266
269
  URLPatternUnavailableError,
267
270
  } from "@xmachines/play-router/errors";
268
271
 
272
+ // bridge from the adapter example above
269
273
  try {
270
274
  bridge.connect();
271
275
  } catch (err) {
@@ -281,7 +285,7 @@ try {
281
285
 
282
286
  ### `meta.route` patterns
283
287
 
284
- Routes are declared on XState state nodes via the `meta.route` field. The machine's `setup({ schemas })` must declare a matching `meta` schema (e.g. `meta: types<{ route?: string | { path: string; title?: string } }>()`) — without one, XState v6 types state `meta` as `never`:
288
+ Declare the route of an XState state node in its `meta.route` field:
285
289
 
286
290
  ```typescript
287
291
  states: {
@@ -306,7 +310,7 @@ states: {
306
310
 
307
311
  ### Relative vs absolute paths
308
312
 
309
- Child routes with a leading `/` are absolute (do not inherit the parent path). Without a leading `/`, they resolve relative to their nearest routable ancestor:
313
+ A child route that starts with `/` is absolute, and it does not inherit the path of its parent. A child route without the first `/` is relative to its nearest routable ancestor:
310
314
 
311
315
  ```typescript
312
316
  states: {
@@ -327,7 +331,7 @@ states: {
327
331
  }
328
332
  ```
329
333
 
330
- Always use `node.fullPath` (never `node.path`) for browser URL matching and route map construction.
334
+ Always use `node.fullPath` to match a browser URL and to build a route map. Never use `node.path` for this.
331
335
 
332
336
  ## Testing
333
337
 
@@ -339,10 +343,11 @@ pnpm --filter @xmachines/play-router test
339
343
  pnpm --filter @xmachines/play-router run test:watch
340
344
  ```
341
345
 
342
- A router bridge contract test suite for adapter authors lives in
343
- `@xmachines/play-router-shared` (it drives a real actor, so it sits one layer
344
- above this package to keep `@xmachines/play-router` free of an actor-runtime
345
- dependency):
346
+ `@xmachines/play-router-shared` holds a contract test suite of the router bridge, for the
347
+ author of an adapter. That suite drives a real actor. Therefore it is one layer above this
348
+ package, and `@xmachines/play-router` keeps no dependency on an actor runtime.
349
+ `@xmachines/play-router-shared` is a private workspace package. Thus only an adapter author
350
+ in this repository can use the suite:
346
351
 
347
352
  ```typescript
348
353
  import { runBridgeContractTests } from "@xmachines/play-router-shared/test/router-bridge-contract.js";
@@ -352,15 +357,19 @@ runBridgeContractTests({
352
357
  createHarness(initialPath) {
353
358
  // return ContractHarness with bridge, actor, simulateNavigation, getLastNavigatedPath
354
359
  },
360
+ createRestoredHarness(routedPath) {
361
+ // return ContractHarness whose actor is restored to routedPath
362
+ // while the mock router starts at the machine's initial route
363
+ },
355
364
  });
356
365
  ```
357
366
 
358
367
  ## Related Packages
359
368
 
360
369
  - **[@xmachines/play](../play/README.md)** — Core protocol types (`PlayEvent`, `PlayError`)
361
- - **[@xmachines/play-actor](../play-actor/README.md)** — Abstract actor base class (`AbstractActor`, `Routable`); all `AbstractActor` subclasses satisfy `RoutableActor` structurally
362
- - **[@xmachines/play-signals](../play-signals/README.md)** — TC39 Signals polyfill used for actor route observation
363
- - **[@xmachines/play-xstate](../play-xstate/README.md)** — XState v6 logic adapter that integrates with route trees
370
+ - **[@xmachines/play-actor](../play-actor/README.md)** — the abstract actor base class (`AbstractActor`, `Routable`). Every `AbstractActor` subclass satisfies `RoutableActor` structurally
371
+ - **[@xmachines/play-signals](../play-signals/README.md)** — the TC39 Signals polyfill that observes the actor route
372
+ - **[@xmachines/play-xstate](../play-xstate/README.md)** — the XState v5 logic adapter, which works with a route tree
364
373
  - **[@xmachines/play-tanstack-router](../play-tanstack-router/README.md)** — Shared TanStack Router bridge base (framework-agnostic)
365
374
  - **[@xmachines/play-tanstack-react-router](../play-tanstack-react-router/README.md)** — TanStack Router adapter (React)
366
375
  - **[@xmachines/play-tanstack-solid-router](../play-tanstack-solid-router/README.md)** — TanStack Router adapter (SolidJS)
@@ -400,6 +409,7 @@ MIT — see [LICENSE](LICENSE).
400
409
 
401
410
  ## Type Aliases
402
411
 
412
+ - [~~BaseRouteMapping~~](type-aliases/BaseRouteMapping.md)
403
413
  - [MachineGraph](type-aliases/MachineGraph.md)
404
414
  - [RouteMetadata](type-aliases/RouteMetadata.md)
405
415
 
@@ -424,9 +434,3 @@ MIT — see [LICENSE](LICENSE).
424
434
  - [sanitizePathname](functions/sanitizePathname.md)
425
435
  - [validateRouteFormat](functions/validateRouteFormat.md)
426
436
  - [validateStateExists](functions/validateStateExists.md)
427
-
428
- ## References
429
-
430
- ### BaseRouteMapping
431
-
432
- Renames and re-exports [RouteMapping](interfaces/RouteMapping.md)