@xmachines/docs 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/README.md +11 -13
  2. package/api/@xmachines/play/README.md +58 -63
  3. package/api/@xmachines/play/classes/NonNullableError.md +7 -7
  4. package/api/@xmachines/play/classes/PlayError.md +25 -27
  5. package/api/@xmachines/play/functions/assertNonNullable.md +17 -17
  6. package/api/@xmachines/play/type-aliases/PlayEvent.md +26 -25
  7. package/api/@xmachines/play-actor/README.md +72 -63
  8. package/api/@xmachines/play-actor/classes/AbstractActor.md +39 -39
  9. package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +19 -18
  10. package/api/@xmachines/play-actor/functions/composePlayState.md +9 -8
  11. package/api/@xmachines/play-actor/functions/createViewStoreLifecycle.md +5 -5
  12. package/api/@xmachines/play-actor/functions/guardContextWrites.md +27 -25
  13. package/api/@xmachines/play-actor/functions/refreshContextSubtree.md +12 -11
  14. package/api/@xmachines/play-actor/functions/reuseComposedState.md +23 -22
  15. package/api/@xmachines/play-actor/functions/shallowEqualExcept.md +6 -5
  16. package/api/@xmachines/play-actor/functions/toAtomState.md +16 -14
  17. package/api/@xmachines/play-actor/functions/typedSpec.md +12 -11
  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 -13
  21. package/api/@xmachines/play-actor/interfaces/ResolveViewStoreOptions.md +4 -4
  22. package/api/@xmachines/play-actor/interfaces/Routable.md +4 -4
  23. package/api/@xmachines/play-actor/interfaces/ViewStoreLifecycle.md +11 -11
  24. package/api/@xmachines/play-actor/interfaces/ViewStoreResolution.md +7 -7
  25. package/api/@xmachines/play-actor/interfaces/Viewable.md +9 -9
  26. package/api/@xmachines/play-actor/variables/CONTEXT_STATE_KEY.md +5 -5
  27. package/api/@xmachines/play-dom/README.md +119 -85
  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/interfaces/CreatePlayUIOptions.md +8 -8
  32. package/api/@xmachines/play-dom/interfaces/MountOptions.md +9 -9
  33. package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +9 -9
  34. package/api/@xmachines/play-dom/type-aliases/MountFn.md +5 -5
  35. package/api/@xmachines/play-dom-router/README.md +66 -49
  36. package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +116 -0
  37. package/api/@xmachines/play-dom-router/functions/connectRouter.md +4 -3
  38. package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +16 -14
  39. package/api/@xmachines/play-dom-router/functions/createRouteMap.md +12 -11
  40. package/api/@xmachines/play-dom-router/functions/createRouter.md +14 -14
  41. package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +25 -26
  42. package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +19 -18
  43. package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +7 -7
  44. package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +39 -33
  45. package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +18 -17
  46. package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +9 -9
  47. package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +39 -38
  48. package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +5 -5
  49. package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +11 -10
  50. package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +27 -24
  51. package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +7 -7
  52. package/api/@xmachines/play-react/README.md +63 -54
  53. package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +14 -13
  54. package/api/@xmachines/play-react/functions/useActor.md +1 -1
  55. package/api/@xmachines/play-react/functions/usePlayView.md +4 -4
  56. package/api/@xmachines/play-react/functions/useSignalEffect.md +39 -39
  57. package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +11 -11
  58. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +7 -7
  59. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +4 -4
  60. package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +14 -14
  61. package/api/@xmachines/play-react/interfaces/ViewContextValue.md +8 -8
  62. package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +2 -2
  63. package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +13 -0
  64. package/api/@xmachines/play-react/variables/ActorProvider.md +9 -8
  65. package/api/@xmachines/play-react/variables/PlayRenderer.md +5 -4
  66. package/api/@xmachines/play-react/variables/PlayUIProvider.md +6 -6
  67. package/api/@xmachines/play-react-router/README.md +37 -28
  68. package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +22 -19
  69. package/api/@xmachines/play-react-router/classes/RouteMap.md +50 -48
  70. package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +16 -14
  71. package/api/@xmachines/play-react-router/functions/createRouteMap.md +12 -11
  72. package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +18 -18
  73. package/api/@xmachines/play-react-router/interfaces/PlayActor.md +22 -20
  74. package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +39 -33
  75. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
  76. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +11 -11
  77. package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +5 -5
  78. package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +11 -10
  79. package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +27 -24
  80. package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  81. package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +7 -6
  82. package/api/@xmachines/play-router/README.md +94 -82
  83. package/api/@xmachines/play-router/classes/RouteMap.md +50 -48
  84. package/api/@xmachines/play-router/classes/RouterBridgeBase.md +29 -23
  85. package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +6 -5
  86. package/api/@xmachines/play-router/functions/buildRouteTree.md +16 -15
  87. package/api/@xmachines/play-router/functions/createRouteMap.md +12 -11
  88. package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +18 -18
  89. package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +18 -17
  90. package/api/@xmachines/play-router/functions/extractMachineRoutes.md +11 -10
  91. package/api/@xmachines/play-router/functions/extractQuery.md +3 -3
  92. package/api/@xmachines/play-router/functions/extractRouteParams.md +22 -19
  93. package/api/@xmachines/play-router/functions/findRouteById.md +10 -9
  94. package/api/@xmachines/play-router/functions/findRouteByPath.md +14 -12
  95. package/api/@xmachines/play-router/functions/getNavigableRoutes.md +9 -9
  96. package/api/@xmachines/play-router/functions/getRoutableRoutes.md +9 -9
  97. package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +16 -15
  98. package/api/@xmachines/play-router/functions/isRouteReachable.md +12 -11
  99. package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
  100. package/api/@xmachines/play-router/functions/routeExists.md +8 -8
  101. package/api/@xmachines/play-router/functions/sanitizePathname.md +15 -13
  102. package/api/@xmachines/play-router/functions/validateRouteFormat.md +10 -10
  103. package/api/@xmachines/play-router/functions/validateStateExists.md +9 -9
  104. package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +4 -4
  105. package/api/@xmachines/play-router/interfaces/LocationLike.md +9 -9
  106. package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +7 -7
  107. package/api/@xmachines/play-router/interfaces/MachineNodeData.md +9 -9
  108. package/api/@xmachines/play-router/interfaces/PlayActor.md +22 -20
  109. package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +39 -33
  110. package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +7 -7
  111. package/api/@xmachines/play-router/interfaces/RoutableActor.md +18 -17
  112. package/api/@xmachines/play-router/interfaces/RouteInfo.md +11 -11
  113. package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +5 -5
  114. package/api/@xmachines/play-router/interfaces/RouteMapping.md +11 -10
  115. package/api/@xmachines/play-router/interfaces/RouteMatch.md +3 -3
  116. package/api/@xmachines/play-router/interfaces/RouteNode.md +13 -13
  117. package/api/@xmachines/play-router/interfaces/RouteObject.md +6 -6
  118. package/api/@xmachines/play-router/interfaces/RouteTree.md +11 -11
  119. package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +13 -13
  120. package/api/@xmachines/play-router/interfaces/RouterBridge.md +27 -24
  121. package/api/@xmachines/play-router/interfaces/WindowLike.md +10 -10
  122. package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +13 -0
  123. package/api/@xmachines/play-router/type-aliases/MachineGraph.md +4 -3
  124. package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +2 -2
  125. package/api/@xmachines/play-signals/README.md +38 -36
  126. package/api/@xmachines/play-signals/functions/watchSignal.md +15 -15
  127. package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +6 -6
  128. package/api/@xmachines/play-signals/interfaces/SignalComputed.md +10 -10
  129. package/api/@xmachines/play-signals/interfaces/SignalOptions.md +6 -6
  130. package/api/@xmachines/play-signals/interfaces/SignalState.md +13 -13
  131. package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +18 -18
  132. package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +6 -5
  133. package/api/@xmachines/play-solid/README.md +46 -42
  134. package/api/@xmachines/play-solid/functions/useActor.md +1 -1
  135. package/api/@xmachines/play-solid/functions/usePlayView.md +3 -3
  136. package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +13 -13
  137. package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +14 -14
  138. package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +9 -9
  139. package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +2 -2
  140. package/api/@xmachines/play-solid/variables/ActorContext.md +5 -4
  141. package/api/@xmachines/play-solid/variables/ActorProvider.md +8 -7
  142. package/api/@xmachines/play-solid/variables/PlayRenderer.md +6 -4
  143. package/api/@xmachines/play-solid/variables/PlayUIProvider.md +7 -7
  144. package/api/@xmachines/play-solid-router/README.md +34 -29
  145. package/api/@xmachines/play-solid-router/classes/RouteMap.md +50 -48
  146. package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +43 -34
  147. package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +15 -13
  148. package/api/@xmachines/play-solid-router/functions/createRouteMap.md +12 -11
  149. package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +39 -39
  150. package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +22 -20
  151. package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +39 -33
  152. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +10 -10
  153. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +11 -11
  154. package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +5 -5
  155. package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +11 -10
  156. package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +27 -24
  157. package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +5 -5
  158. package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +2 -2
  159. package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +11 -11
  160. package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +9 -8
  161. package/api/@xmachines/play-svelte/README.md +40 -31
  162. package/api/@xmachines/play-svelte/functions/defineRegistry.md +9 -8
  163. package/api/@xmachines/play-svelte/functions/getActorContext.md +5 -4
  164. package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +3 -3
  165. package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
  166. package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +17 -15
  167. package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +9 -9
  168. package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +20 -18
  169. package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +12 -11
  170. package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +2 -2
  171. package/api/@xmachines/play-svelte-spa-router/README.md +25 -25
  172. package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +50 -48
  173. package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +133 -0
  174. package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -3
  175. package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +12 -11
  176. package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +7 -7
  177. package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +39 -33
  178. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +5 -5
  179. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +11 -10
  180. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +27 -24
  181. package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +10 -10
  182. package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
  183. package/api/@xmachines/play-sveltekit-router/README.md +38 -34
  184. package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +50 -48
  185. package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +132 -0
  186. package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -3
  187. package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +12 -11
  188. package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -6
  189. package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +9 -9
  190. package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +39 -33
  191. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +5 -5
  192. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +11 -10
  193. package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +27 -24
  194. package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
  195. package/api/@xmachines/play-tanstack-react-router/README.md +66 -48
  196. package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +50 -48
  197. package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +43 -38
  198. package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +16 -14
  199. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +12 -11
  200. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +18 -18
  201. package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +11 -10
  202. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +22 -20
  203. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +39 -33
  204. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +12 -12
  205. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +11 -11
  206. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +5 -5
  207. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +11 -10
  208. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +16 -11
  209. package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +27 -24
  210. package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  211. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
  212. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +15 -13
  213. package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +9 -8
  214. package/api/@xmachines/play-tanstack-router/README.md +37 -17
  215. package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +43 -38
  216. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +9 -9
  217. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +15 -13
  218. package/api/@xmachines/play-tanstack-solid-router/README.md +71 -45
  219. package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +50 -48
  220. package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +38 -30
  221. package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +15 -13
  222. package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +12 -11
  223. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +22 -20
  224. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +39 -33
  225. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +11 -11
  226. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +9 -9
  227. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +5 -5
  228. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +11 -10
  229. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +27 -24
  230. package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +2 -2
  231. package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +2 -2
  232. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
  233. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +15 -13
  234. package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +7 -7
  235. package/api/@xmachines/play-vue/README.md +37 -35
  236. package/api/@xmachines/play-vue/functions/defineRegistry.md +10 -9
  237. package/api/@xmachines/play-vue/functions/useActor.md +1 -1
  238. package/api/@xmachines/play-vue/functions/usePlayView.md +28 -0
  239. package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +10 -9
  240. package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +13 -12
  241. package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +10 -9
  242. package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +6 -2
  243. package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +2 -2
  244. package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
  245. package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
  246. package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
  247. package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
  248. package/api/@xmachines/play-vue/variables/getPlayViewContext.md +34 -0
  249. package/api/@xmachines/play-vue-router/README.md +65 -56
  250. package/api/@xmachines/play-vue-router/classes/RouteMap.md +50 -48
  251. package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +26 -19
  252. package/api/@xmachines/play-vue-router/functions/createRouteMap.md +12 -11
  253. package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +22 -20
  254. package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +39 -33
  255. package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +5 -5
  256. package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +11 -10
  257. package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +27 -24
  258. package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +2 -2
  259. package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +13 -0
  260. package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +5 -5
  261. package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +13 -0
  262. package/api/@xmachines/play-xstate/README.md +72 -70
  263. package/api/@xmachines/play-xstate/classes/PlayerActor.md +123 -112
  264. package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +19 -16
  265. package/api/@xmachines/play-xstate/functions/composeGuards.md +25 -23
  266. package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +20 -20
  267. package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +15 -15
  268. package/api/@xmachines/play-xstate/functions/definePlayer.md +19 -19
  269. package/api/@xmachines/play-xstate/functions/deriveRoute.md +26 -25
  270. package/api/@xmachines/play-xstate/functions/eventMatches.md +8 -8
  271. package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +16 -13
  272. package/api/@xmachines/play-xstate/functions/hasContext.md +8 -8
  273. package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +10 -10
  274. package/api/@xmachines/play-xstate/functions/negateGuard.md +19 -18
  275. package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +6 -6
  276. package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +7 -7
  277. package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +10 -10
  278. package/api/@xmachines/play-xstate/interfaces/RouteContext.md +15 -14
  279. package/api/@xmachines/play-xstate/interfaces/RouteObject.md +2 -2
  280. package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +5 -5
  281. package/api/@xmachines/play-xstate/type-aliases/Guard.md +9 -9
  282. package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +4 -3
  283. package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +7 -7
  284. package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +12 -12
  285. package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
  286. package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +15 -14
  287. package/api/@xmachines/shared/README.md +11 -13
  288. package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
  289. package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
  290. package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
  291. package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
  292. package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +2 -2
  293. package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
  294. package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
  295. package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
  296. package/contributing/development.md +28 -0
  297. package/guides/inspector.md +1 -1
  298. package/package.json +1 -1
  299. package/api/@xmachines/play-vue/functions/getPlayViewContext.md +0 -28
@@ -2,57 +2,62 @@
2
2
 
3
3
  # Interface: PlayRouteEvent
4
4
 
5
- Defined in: [play-router/src/types.ts:225](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/types.ts#L225)
5
+ Defined in: [play-router/src/types.ts:237](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L237)
6
6
 
7
- Enhanced routing event with parameter and query support
7
+ The routing event, with its parameters and its query
8
8
 
9
- Unified routing event used throughout the Play architecture. Supports parameter-aware
10
- navigation patterns (e.g., `/profile/:userId`) for dynamic route segments.
9
+ This is the one routing event of the complete Play architecture. It supports a
10
+ navigation that knows the parameters, for example `/profile/:userId`, for a dynamic
11
+ route segment.
11
12
 
12
- **Architectural Context:** Implements **Passive Infrastructure (INV-04)** by representing
13
- user navigation intent that the Actor evaluates through guards. Infrastructure proposes
14
- via `play.route` events, Actor decides via state machine transitions.
13
+ **Architectural context:** the event implements **Passive Infrastructure
14
+ (INV-04)**, because it holds the navigation intent of the user, and the Actor then
15
+ evaluates that intent with its guards. The infrastructure makes a request with a
16
+ `play.route` event, and the Actor decides with a transition of its state machine.
15
17
 
16
- **Browser Navigation Flow:**
18
+ **The flow of a browser navigation:**
17
19
 
18
- 1. Browser fires `popstate`
19
- 2. Router adapter resolves URL to route target
20
- 3. Adapter sends `PlayRouteEvent` to Actor
21
- 4. Actor validates transition via state machine guards
20
+ 1. The browser fires `popstate`
21
+ 2. The router adapter resolves the URL to a route target
22
+ 3. The adapter sends a `PlayRouteEvent` to the Actor
23
+ 4. The Actor checks the transition with the guards of its state machine
22
24
 
23
25
  ## Param
24
26
 
25
27
  **type**
26
28
 
27
- Event discriminator (always "play.route")
29
+ The discriminator of the event. It is always "play.route"
28
30
 
29
31
  ## Param
30
32
 
31
33
  **to**
32
34
 
33
- Target state ID with # prefix (e.g., '#home', '#profile')
35
+ The target state ID, with a # prefix, for example '#home' or '#profile'
34
36
 
35
37
  ## Param
36
38
 
37
39
  **params**
38
40
 
39
- Path-only route parameters extracted from the URL path (e.g., `{ userId: '123' }` from `/profile/123`). Query parameters are kept separate in `query`.
41
+ The route parameters of the path only, from the URL path, for
42
+ example `{ userId: '123' }` of `/profile/123`. The `query` field holds the query
43
+ parameters separately.
40
44
 
41
45
  ## Param
42
46
 
43
47
  **query**
44
48
 
45
- Query parameters only (isolated from path params)
49
+ The query parameters only. They stay separate from the params of the path
46
50
 
47
51
  ## Param
48
52
 
49
53
  **match**
50
54
 
51
- Full URLPattern match result for debugging/observability (optional)
55
+ The complete match result of URLPattern, for the debug work and for
56
+ the observability. It is optional
52
57
 
53
58
  ## Examples
54
59
 
55
- Combining base and routing events
60
+ The base event and the routing event together
56
61
 
57
62
  ```typescript
58
63
  import type { PlayEvent } from "@xmachines/play";
@@ -61,7 +66,7 @@ import type { PlayRouteEvent } from "@xmachines/play-router";
61
66
  type AppEvent = PlayEvent | PlayRouteEvent;
62
67
  ```
63
68
 
64
- Basic navigation to a route
69
+ A basic navigation to a route
65
70
 
66
71
  ```typescript
67
72
  import type { PlayRouteEvent } from "@xmachines/play-router";
@@ -73,7 +78,7 @@ const event: PlayRouteEvent = {
73
78
  actor.send(event);
74
79
  ```
75
80
 
76
- Navigation with route parameters
81
+ A navigation with route parameters
77
82
 
78
83
  ```typescript
79
84
  import type { PlayRouteEvent } from "@xmachines/play-router";
@@ -84,10 +89,10 @@ const event: PlayRouteEvent = {
84
89
  params: { userId: "123" },
85
90
  };
86
91
  actor.send(event);
87
- // Resolves to route: /profile/123
92
+ // It resolves to the route /profile/123
88
93
  ```
89
94
 
90
- Navigation with query parameters
95
+ A navigation with query parameters
91
96
 
92
97
  ```typescript
93
98
  import type { PlayRouteEvent } from "@xmachines/play-router";
@@ -95,11 +100,11 @@ import type { PlayRouteEvent } from "@xmachines/play-router";
95
100
  const event: PlayRouteEvent = {
96
101
  type: "play.route",
97
102
  to: "#settings",
98
- params: { section: "profile" }, // Path-only route parameter
99
- query: { tab: "security" }, // Query-only
103
+ params: { section: "profile" }, // a route parameter of the path only
104
+ query: { tab: "security" }, // the query only
100
105
  };
101
106
  actor.send(event);
102
- // Resolves to route: /settings/profile?tab=security
107
+ // It resolves to the route /settings/profile?tab=security
103
108
  ```
104
109
 
105
110
  ## See
@@ -108,9 +113,10 @@ actor.send(event);
108
113
 
109
114
  ## Remarks
110
115
 
111
- Use `play.route` when you need parameter-aware navigation with the `route: {}`
112
- config pattern on your state machine nodes. The `match` field exposes the full
113
- URLPatternResult for advanced use cases (debugging, pattern analysis).
116
+ Use `play.route` when you need a navigation that knows the parameters, with the
117
+ `route: {}` config pattern on the nodes of your state machine. The `match` field
118
+ gives you the complete URLPatternResult, for an advanced use such as a debug or an
119
+ analysis of the pattern.
114
120
 
115
121
  ## Indexable
116
122
 
@@ -122,8 +128,8 @@ URLPatternResult for advanced use cases (debugging, pattern analysis).
122
128
 
123
129
  | Property | Modifier | Type | Defined in |
124
130
  | -------------------------------------- | ---------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
125
- | <a id="property-match"></a> `match?` | `readonly` | `unknown` | [play-router/src/types.ts:230](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/types.ts#L230) |
126
- | <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:228](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/types.ts#L228) |
127
- | <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:229](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/types.ts#L229) |
128
- | <a id="property-to"></a> `to` | `readonly` | `string` | [play-router/src/types.ts:227](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/types.ts#L227) |
129
- | <a id="property-type"></a> `type` | `readonly` | `"play.route"` | [play-router/src/types.ts:226](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/types.ts#L226) |
131
+ | <a id="property-match"></a> `match?` | `readonly` | `unknown` | [play-router/src/types.ts:242](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L242) |
132
+ | <a id="property-params"></a> `params?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:240](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L240) |
133
+ | <a id="property-query"></a> `query?` | `readonly` | `Record`\<`string`, `string`\> | [play-router/src/types.ts:241](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L241) |
134
+ | <a id="property-to"></a> `to` | `readonly` | `string` | [play-router/src/types.ts:239](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L239) |
135
+ | <a id="property-type"></a> `type` | `readonly` | `"play.route"` | [play-router/src/types.ts:238](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/types.ts#L238) |
@@ -2,12 +2,12 @@
2
2
 
3
3
  # Interface: RouteMapOptions
4
4
 
5
- Defined in: [play-router/src/create-route-map.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/create-route-map.ts#L9)
5
+ Defined in: [play-router/src/create-route-map.ts:9](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/create-route-map.ts#L9)
6
6
 
7
- Options for `createRouteMap` and `createRouteMapFromTree`.
7
+ The options of `createRouteMap` and of `createRouteMapFromTree`.
8
8
 
9
9
  ## Properties
10
10
 
11
- | Property | Type | Description | Defined in |
12
- | -------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
13
- | <a id="property-cachesize"></a> `cacheSize?` | `number` | Maximum number of resolved parameterized path lookups to cache. `RouteMap.getStateIdByPath()` resolves parameterized patterns (e.g. `/profile/:userId`) via URLPattern on every call. Frequently visited paths are cached in an LRU so subsequent lookups are O(1). Increase this value for applications with large parameterized route sets or high navigation frequency. Default: `500`. | [play-router/src/create-route-map.ts:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/create-route-map.ts#L20) |
11
+ | Property | Type | Description | Defined in |
12
+ | -------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
13
+ | <a id="property-cachesize"></a> `cacheSize?` | `number` | The maximum number of the resolved parameterized path lookups in the cache. `RouteMap.getStateIdByPath()` resolves a parameterized pattern, for example `/profile/:userId`, with URLPattern on each call. The map keeps each path of a frequent visit in an LRU cache, and a later lookup of that path is therefore O(1). Raise this value for an application with a large set of parameterized routes, or with a high frequency of the navigation. The default is `500`. | [play-router/src/create-route-map.ts:21](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/create-route-map.ts#L21) |
@@ -2,14 +2,15 @@
2
2
 
3
3
  # Interface: RouteMapping
4
4
 
5
- Defined in: [play-router/src/base-route-map.ts:51](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/base-route-map.ts#L51)
5
+ Defined in: [play-router/src/base-route-map.ts:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/base-route-map.ts#L54)
6
6
 
7
- A single state ID path mapping entry.
7
+ One entry of the map between a state ID and a path.
8
8
 
9
- Both fields are `readonly` mappings are immutable once passed to `RouteMap`.
10
- Adapter packages re-export a structurally compatible `RouteMapping` type under
11
- their own name. This type is published from `@xmachines/play-router` as
12
- `RouteMapping` to avoid name collisions with those adapter-local types.
9
+ Both fields are `readonly`, because a mapping is immutable after the caller gives
10
+ it to `RouteMap`. An adapter package re-exports a structurally compatible
11
+ `RouteMapping` type under its own name. `@xmachines/play-router` publishes this
12
+ type as `RouteMapping`, and its name therefore does not collide with such a local
13
+ type of an adapter.
13
14
 
14
15
  ## Example
15
16
 
@@ -21,7 +22,7 @@ const optionalMapping: RouteMapping = { stateId: "settings", path: "/settings/:s
21
22
 
22
23
  ## Properties
23
24
 
24
- | Property | Modifier | Type | Description | Defined in |
25
- | --------------------------------------- | ---------- | -------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
26
- | <a id="property-path"></a> `path` | `readonly` | `string` | URL path pattern (e.g., `"/"`, `"/profile/:userId"`, `"/settings/:section?"`) | [play-router/src/base-route-map.ts:55](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/base-route-map.ts#L55) |
27
- | <a id="property-stateid"></a> `stateId` | `readonly` | `string` | State machine state ID (e.g., `"home"`, `"#profile"`) | [play-router/src/base-route-map.ts:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/base-route-map.ts#L53) |
25
+ | Property | Modifier | Type | Description | Defined in |
26
+ | --------------------------------------- | ---------- | -------- | ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
27
+ | <a id="property-path"></a> `path` | `readonly` | `string` | The pattern of the URL path, for example `"/"`, `"/profile/:userId"`, or `"/settings/:section?"` | [play-router/src/base-route-map.ts:58](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/base-route-map.ts#L58) |
28
+ | <a id="property-stateid"></a> `stateId` | `readonly` | `string` | The state ID of the state machine, for example `"home"` or `"#profile"` | [play-router/src/base-route-map.ts:56](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-router/src/base-route-map.ts#L56) |
@@ -2,21 +2,23 @@
2
2
 
3
3
  # Interface: RouterBridge
4
4
 
5
- Defined in: [play-router/src/types.ts:341](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/types.ts#L341)
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:357](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/types.ts#L357)
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:373](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-router/src/types.ts#L373)
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,4 +6,4 @@
6
6
  type RoutableActor = AbstractActor<AnyActorLogic> & Routable;
7
7
  ```
8
8
 
9
- Defined in: [play-sveltekit-router/src/types.ts:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-sveltekit-router/src/types.ts#L10)
9
+ Defined in: [play-sveltekit-router/src/types.ts:10](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-sveltekit-router/src/types.ts#L10)
@@ -2,11 +2,9 @@
2
2
 
3
3
  # @xmachines/play-tanstack-react-router
4
4
 
5
- TanStack Router (React) adapter for XMachines Play synchronizes browser URL with actor state through passive infrastructure.
5
+ TanStack Router (React) adapter for XMachines Play. It keeps the browser URL and the actor state in step through passive infrastructure.
6
6
 
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.0.0-blue)](https://www.npmjs.com/package/@xmachines/play-tanstack-react-router)
8
-
9
- 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-tanstack-react-router)
10
8
 
11
9
  ## Installation
12
10
 
@@ -14,13 +12,13 @@ Part of the [xmachines-js monorepo](../../README.md).
14
12
  pnpm add @xmachines/play-tanstack-react-router
15
13
  ```
16
14
 
17
- **Peer dependencies** (install separately):
15
+ **Peer dependencies.** Install them separately:
18
16
 
19
17
  ```bash
20
18
  pnpm add @tanstack/react-router react react-dom xstate
21
19
  ```
22
20
 
23
- Requires:
21
+ The adapter requires:
24
22
 
25
23
  - `@tanstack/react-router` `^1.168.8`
26
24
  - `react` `^18.0.0` or `^19.0.0`
@@ -31,24 +29,47 @@ Requires:
31
29
 
32
30
  ### `PlayRouterProvider` — React component (recommended)
33
31
 
34
- `PlayRouterProvider` is the primary integration point. It creates a `TanStackReactRouterBridge` on mount, keeps it connected for the component lifetime, and tears it down on unmount.
32
+ `PlayRouterProvider` is the primary integration point. It creates a `TanStackReactRouterBridge` on mount. It keeps the bridge connected for the life of the component. It disconnects the bridge on unmount.
35
33
 
36
34
  ```tsx
37
- import { useMemo, useEffect } from "react";
35
+ import { useMemo, useEffect, useState } from "react";
36
+ import { createMachine } from "xstate";
38
37
  import { createRouter, createRootRoute } from "@tanstack/react-router";
39
- import {
40
- PlayRouterProvider,
41
- createRouteMapFromTree,
42
- extractMachineRoutes,
43
- } from "@xmachines/play-tanstack-react-router";
44
- import { definePlayer } from "@xmachines/play-xstate";
38
+ import { PlayRouterProvider, createRouteMap } from "@xmachines/play-tanstack-react-router";
39
+ import { definePlayer, formatPlayRouteTransitions } from "@xmachines/play-xstate";
40
+ import { useSignalEffect } from "@xmachines/play-react";
41
+
42
+ // Any machine whose states declare `meta.route` (plus an explicit `id`) is routable.
43
+ // formatPlayRouteTransitions() generates the root-level `play.route` handlers that
44
+ // let the bridge drive the machine from URL changes.
45
+ const machine = createMachine(
46
+ formatPlayRouteTransitions({
47
+ id: "app",
48
+ initial: "home",
49
+ states: {
50
+ home: { id: "home", meta: { route: "/" } },
51
+ about: { id: "about", meta: { route: "/about" } },
52
+ },
53
+ }),
54
+ );
55
+
56
+ const createPlayer = definePlayer({ machine });
57
+ type AppActor = ReturnType<typeof createPlayer>;
58
+
59
+ // Minimal shell: mirrors the actor's route signal into React state. A full app
60
+ // renders <PlayUIProvider> + <PlayRenderer> from @xmachines/play-react here
61
+ // instead — see examples/demo for the complete Shell.
62
+ function Shell({ actor }: { actor: AppActor }) {
63
+ const [route, setRoute] = useState(actor.currentRoute.get());
64
+ useSignalEffect(() => setRoute(actor.currentRoute.get()), [actor]);
65
+ return <p>Current route: {route}</p>;
66
+ }
45
67
 
46
68
  function createAppRuntime() {
47
- const actor = definePlayer({ machine, catalog })();
69
+ const actor = createPlayer();
48
70
  actor.start();
49
71
 
50
- const routeTree = extractMachineRoutes(machine);
51
- const routeMap = createRouteMapFromTree(routeTree);
72
+ const routeMap = createRouteMap(machine);
52
73
  const rootRoute = createRootRoute();
53
74
  const router = createRouter({ routeTree: rootRoute });
54
75
 
@@ -66,32 +87,28 @@ export function App() {
66
87
  actor={actor}
67
88
  router={router}
68
89
  routeMap={routeMap}
69
- renderer={(currentActor, currentRouter) => (
70
- <Shell actor={currentActor} router={currentRouter} />
71
- )}
90
+ renderer={(currentActor) => <Shell actor={currentActor} />}
72
91
  />
73
92
  );
74
93
  }
75
94
  ```
76
95
 
77
- > **Stable references:** `actor`, `router`, and `routeMap` must be stable across renders. If any prop changes identity, the bridge disconnects and reconnects. Use `useMemo` to create them once.
96
+ > **Stable references:** `actor`, `router`, and `routeMap` must stay stable across the renders. If one prop gets a new identity, the bridge disconnects, then it connects again. Use `useMemo` to create each prop one time.
78
97
 
79
- ### `TanStackReactRouterBridge` — headless class
98
+ ### `TanStackReactRouterBridge` — the bridge class
80
99
 
81
- Use the bridge directly when you don't need the React wrapper, or when integrating with a custom lifecycle:
100
+ Use the bridge directly when you do not need the React wrapper, or when you integrate it with a custom lifecycle:
82
101
 
83
102
  ```typescript
84
- import { createRouter } from "@tanstack/react-router";
103
+ import { createRouter, createRootRoute } from "@tanstack/react-router";
85
104
  import { definePlayer } from "@xmachines/play-xstate";
86
- import {
87
- TanStackReactRouterBridge,
88
- createRouteMapFromTree,
89
- extractMachineRoutes,
90
- } from "@xmachines/play-tanstack-react-router";
105
+ import { TanStackReactRouterBridge, createRouteMap } from "@xmachines/play-tanstack-react-router";
106
+ import { machine } from "./machine.js"; // the routable machine from the example above
91
107
 
92
- const router = createRouter({ routeTree });
93
- const actor = definePlayer({ machine, catalog })();
94
- const routeMap = createRouteMapFromTree(extractMachineRoutes(machine));
108
+ const router = createRouter({ routeTree: createRootRoute() });
109
+ const actor = definePlayer({ machine })();
110
+ actor.start();
111
+ const routeMap = createRouteMap(machine);
95
112
 
96
113
  const bridge = new TanStackReactRouterBridge(router, actor, routeMap);
97
114
  bridge.connect();
@@ -104,7 +121,7 @@ bridge.disconnect();
104
121
 
105
122
  ### `TanStackReactRouterBridge`
106
123
 
107
- Extends `RouterBridgeBase` from `@xmachines/play-router`. Implements bidirectional sync between actor state signals and TanStack Router history.
124
+ This class extends `RouterBridgeBase` from `@xmachines/play-router`. It keeps the actor state signals and the TanStack Router history in step, in both directions.
108
125
 
109
126
  ```typescript
110
127
  class TanStackReactRouterBridge extends RouterBridgeBase {
@@ -115,11 +132,11 @@ class TanStackReactRouterBridge extends RouterBridgeBase {
115
132
  }
116
133
  ```
117
134
 
118
- Subscribes to `router.history` (not `router.subscribe("onBeforeLoad")`) so that back/forward browser navigation (popstate events) are captured even without a `<RouterProvider>` mounted.
135
+ The bridge subscribes to `router.history`, not to `router.subscribe("onBeforeLoad")`. Therefore the bridge also receives a browser BACK or FORWARD navigation (a popstate event) when no `<RouterProvider>` is mounted.
119
136
 
120
137
  ### `PlayRouterProvider`
121
138
 
122
- React component that wraps `TanStackReactRouterBridge` in a `useEffect` lifecycle.
139
+ This React component wraps `TanStackReactRouterBridge` in a `useEffect` lifecycle.
123
140
 
124
141
  ```typescript
125
142
  interface PlayRouterProviderProps<TActor> {
@@ -132,7 +149,7 @@ interface PlayRouterProviderProps<TActor> {
132
149
 
133
150
  ### `TanStackRouterLike`
134
151
 
135
- Structural type for the router instance accepts any object with the required `navigate` and `history` shape, making it testable without creating a full TanStack Router:
152
+ The structural type of the router instance. It accepts every object that has the necessary `navigate` and `history` shape. A test can therefore use a stub in place of a complete TanStack Router:
136
153
 
137
154
  ```typescript
138
155
  type TanStackRouterLike = {
@@ -149,7 +166,7 @@ type TanStackRouterLike = {
149
166
 
150
167
  ### `RouteNavigateEvent`
151
168
 
152
- Event sent to the actor when the browser navigates:
169
+ The event that the bridge sends to the actor when the browser navigates:
153
170
 
154
171
  ```typescript
155
172
  interface RouteNavigateEvent {
@@ -163,7 +180,7 @@ interface RouteNavigateEvent {
163
180
  ```typescript
164
181
  // Route map construction
165
182
  RouteMap
166
- createRouteMap(mappings: RouteMapping[]): RouteMap
183
+ createRouteMap(machine, options?): RouteMap
167
184
  createRouteMapFromTree(routeTree): RouteMap
168
185
  extractMachineRoutes(machine): RouteTree
169
186
 
@@ -178,10 +195,10 @@ type PlayRouteEvent
178
195
 
179
196
  The bridge implements the **Passive Infrastructure** invariant from the XMachines RFC:
180
197
 
181
- 1. **Actor → Router:** When `actor.currentRoute` signal changes, the bridge calls `router.navigate({ to: path })`. The URL updates to reflect the new actor state.
182
- 2. **Router → Actor:** When `router.history.subscribe` fires (link clicks, `back`/`forward` buttons, `history.pushState`), the bridge sends a `play.route` event to the actor. The actor's guards decide whether navigation is valid the router never enforces business logic.
183
- 3. **Circular update prevention:** A `lastSyncedPath` guard suppresses round-trip updates so an actorrouter navigation does not trigger a redundant routeractor send.
184
- 4. **Deep-link and restore:** On `connect()`, the bridge reads `router.history.location.pathname` (which reflects `window.location` immediately, before `router.load()` runs) and determines whether to sync the actor from the URL (deep-link) or push the actor's restored route to the URL (snapshot restore).
198
+ 1. **Actor → Router:** when the `actor.currentRoute` signal changes, the bridge calls `router.navigate({ to: path })`. The URL then shows the new actor state.
199
+ 2. **Router → Actor:** when `router.history.subscribe` fires, the bridge sends a `play.route` event to the actor. A link click, a BACK or FORWARD button, and a call to `history.pushState` each cause this. The guards of the actor decide if the navigation is valid. The router never enforces the business logic.
200
+ 3. **Circular update prevention:** the `lastSyncedPath` guard stops a return update. An actor-to-router navigation therefore does not cause an unnecessary router-to-actor send.
201
+ 4. **Deep-link and restore:** on `connect()`, the bridge reads `router.history.location.pathname`. That value shows `window.location` at once, before `router.load()` runs. The bridge then makes a decision: it sets the actor state from the URL (a deep link), or it writes the restored route of the actor to the URL (a snapshot restore).
185
202
 
186
203
  ## Testing
187
204
 
@@ -201,16 +218,16 @@ Tests cover RouterBridge protocol compliance, actor ↔ router bidirectional syn
201
218
 
202
219
  ## Demo
203
220
 
204
- A runnable React + TanStack Router integration demo is available under `examples/demo/`. To run it from the repository root:
221
+ `examples/demo/` holds a runnable demo of the React and TanStack Router integration. Run it from the repository root:
205
222
 
206
223
  ```bash
207
224
  pnpm install
208
225
  pnpm --filter @xmachines/play-tanstack-react-router-demo run dev
209
226
  ```
210
227
 
211
- Then open `http://localhost:3000`.
228
+ Then open `http://localhost:3011`.
212
229
 
213
- The demo shows actor-authoritative routing with a shared auth machine: TanStack Router updates the URL, `PlayRouterProvider` translates it to a `play.route` event, and the actor's guards decide whether access is permitted.
230
+ The demo shows actor-authoritative routing with a shared auth machine. TanStack Router updates the URL. `PlayRouterProvider` converts the update into a `play.route` event. The guards of the actor then permit the access, or they refuse it.
214
231
 
215
232
  ## License
216
233
 
@@ -218,8 +235,9 @@ MIT — see [LICENSE](./LICENSE).
218
235
 
219
236
  @xmachines/play-tanstack-react-router
220
237
 
221
- TanStack Router adapter for XMachines Play architecture.
222
- Synchronizes browser URL with actor state through passive infrastructure.
238
+ TanStack Router adapter for the XMachines Play architecture.
239
+ It keeps the browser URL and the actor state in step through passive
240
+ infrastructure.
223
241
 
224
242
  ## Classes
225
243
 
@@ -234,7 +252,7 @@ Synchronizes browser URL with actor state through passive infrastructure.
234
252
  - [PlayRouterProviderProps](interfaces/PlayRouterProviderProps.md)
235
253
  - [RouteMapOptions](interfaces/RouteMapOptions.md)
236
254
  - [RouteMapping](interfaces/RouteMapping.md)
237
- - [RouteNavigateEvent](interfaces/RouteNavigateEvent.md)
255
+ - [~~RouteNavigateEvent~~](interfaces/RouteNavigateEvent.md)
238
256
  - [RouterBridge](interfaces/RouterBridge.md)
239
257
 
240
258
  ## Type Aliases