@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
@@ -6,16 +6,17 @@
6
6
  const PlayRouterProvider: <TActor>(__namedParameters) => Element;
7
7
  ```
8
8
 
9
- Defined in: [play-tanstack-react-router/src/play-router-provider.tsx:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-tanstack-react-router/src/play-router-provider.tsx#L57)
9
+ Defined in: [play-tanstack-react-router/src/play-router-provider.tsx:60](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-react-router/src/play-router-provider.tsx#L60)
10
10
 
11
- Connects a `PlayerActor` to TanStack React Router, keeping actor state and
12
- browser URL in sync bidirectionally.
11
+ Connects a `PlayerActor` to TanStack React Router. It keeps the actor state and the
12
+ browser 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).
17
- Under React `<StrictMode>` the effect runs twice on mount
18
- (connect disconnect connect), which the bridge supports.
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`. Under the
18
+ React `<StrictMode>`, the effect runs two times on mount (connect, disconnect,
19
+ connect), and the bridge supports this.
19
20
 
20
21
  ## Type Parameters
21
22
 
@@ -4,16 +4,16 @@
4
4
 
5
5
  Shared, framework-agnostic TanStack Router bridge base for XMachines Play.
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-router)
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-router)
8
8
 
9
- TanStack Router exposes the identical `navigate` / `load` / `history` surface in
10
- both its React and Solid flavours, so the entire bridge implementation lives here
11
- as `TanStackRouterBridgeBase` (extending `RouterBridgeBase` from
12
- [`@xmachines/play-router`](../play-router/README.md)). The framework adapter
13
- packages only subclass it to bind their concrete router type.
9
+ TanStack Router gives React and Solid the same `navigate`, `load`, and `history`
10
+ surface. Therefore the complete bridge implementation lives here, in
11
+ `TanStackRouterBridgeBase`. That class extends `RouterBridgeBase` from
12
+ [`@xmachines/play-router`](../play-router/README.md). Each framework adapter
13
+ package makes a subclass of it, and binds its own router type.
14
14
 
15
- This package has **no TanStack runtime dependency** `TanStackRouterLike` is a
16
- structural, type-only interface covering the small router surface the bridge uses.
15
+ This package has **no TanStack runtime dependency**. `TanStackRouterLike` is a
16
+ type-only interface. It describes the small router surface that the bridge uses.
17
17
 
18
18
  ## Who consumes it
19
19
 
@@ -23,21 +23,41 @@ structural, type-only interface covering the small router surface the bridge use
23
23
  ## Usage
24
24
 
25
25
  ```typescript
26
+ import { createMachine } from "xstate";
27
+ import { definePlayer, formatPlayRouteTransitions } from "@xmachines/play-xstate";
28
+ import { createRouteMap } from "@xmachines/play-router";
26
29
  import { TanStackRouterBridgeBase } from "@xmachines/play-tanstack-router";
27
30
 
31
+ const machine = createMachine(
32
+ formatPlayRouteTransitions({
33
+ id: "app",
34
+ initial: "home",
35
+ states: {
36
+ home: { id: "home", meta: { route: "/" } },
37
+ about: { id: "about", meta: { route: "/about" } },
38
+ },
39
+ }),
40
+ );
41
+
42
+ const actor = definePlayer({ machine })();
43
+ actor.start();
44
+
45
+ const routeMap = createRouteMap(machine);
46
+
28
47
  export class MyTanStackBridge extends TanStackRouterBridgeBase {}
29
48
 
49
+ // router: your TanStack Router instance (from the React or Solid createRouter)
30
50
  const bridge = new MyTanStackBridge(router, actor, routeMap);
31
51
  bridge.connect();
32
- // Cleanup on unmount
33
- return () => bridge.disconnect();
52
+ // Disconnect the bridge at teardown
53
+ bridge.disconnect();
34
54
  ```
35
55
 
36
56
  ## Exports
37
57
 
38
- - `TanStackRouterBridgeBase` — abstract bridge base class
39
- - `TanStackRouterLike` — structural (type-only) TanStack router surface
40
- - `TanStackRouteMapLike` — narrow route-map surface the bridge requires
58
+ - `TanStackRouterBridgeBase` — the concrete bridge base class. Use it directly, or make a subclass of it
59
+ - `TanStackRouterLike` — the TanStack router surface, as a type-only interface
60
+ - `TanStackRouteMapLike` — the narrow route-map surface that the bridge requires
41
61
 
42
62
  ## License
43
63
 
@@ -45,10 +65,10 @@ MIT
45
65
 
46
66
  @xmachines/play-tanstack-router
47
67
 
48
- Shared, framework-agnostic TanStack Router bridge base for XMachines Play.
49
- Consumed by `@xmachines/play-tanstack-react-router` and
50
- `@xmachines/play-tanstack-solid-router`, which subclass
51
- `TanStackRouterBridgeBase` to bind their concrete router type.
68
+ The shared, framework-agnostic TanStack Router bridge base for XMachines Play.
69
+ `@xmachines/play-tanstack-react-router` and
70
+ `@xmachines/play-tanstack-solid-router` use it. Each of them makes a subclass of
71
+ `TanStackRouterBridgeBase`, and the subclass binds its own router type.
52
72
 
53
73
  ## Classes
54
74
 
@@ -2,32 +2,34 @@
2
2
 
3
3
  # Class: TanStackRouterBridgeBase
4
4
 
5
- Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:102](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L102)
5
+ Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:107](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L107)
6
6
 
7
- Shared TanStack Router adapter implementing RouterBridge protocol via RouterBridgeBase
7
+ The shared TanStack Router adapter. It implements the RouterBridge protocol through RouterBridgeBase
8
8
 
9
9
  ## Remarks
10
10
 
11
- Extends RouterBridgeBase to handle all common lifecycle and sync logic; adds
12
- the TanStack-specific navigation and subscription methods shared by the React
13
- and Solid adapters.
14
-
15
- Subscribes to router.history (not router.subscribe("onBeforeLoad")) so that
16
- back/forward browser navigation (popstate events) are also captured. The
17
- router.subscribe("onBeforeLoad") approach only works when TanStack's
18
- Transitioner component is mounted (i.e. inside a full <RouterProvider>).
19
- Since this bridge is used without <RouterProvider>, we must subscribe to
20
- the underlying history object directly which is exactly what Transitioner
11
+ The class extends RouterBridgeBase, and the base class does all the common
12
+ lifecycle work and synchronization work. This class adds the TanStack navigation
13
+ methods and subscription methods that the React adapter and the Solid adapter
14
+ share.
15
+
16
+ The bridge subscribes to router.history, not to
17
+ router.subscribe("onBeforeLoad"). Therefore it also receives a browser BACK or
18
+ FORWARD navigation, which is a popstate event. The
19
+ router.subscribe("onBeforeLoad") method works only when the Transitioner
20
+ component of TanStack is mounted, which means inside a complete
21
+ <RouterProvider>. This bridge works without <RouterProvider>. Therefore it
22
+ subscribes to the history object directly, and this is exactly what Transitioner
21
23
  does internally: `router.history.subscribe(router.load)`.
22
24
 
23
- Architectural Invariants:
25
+ Architectural invariants:
24
26
 
25
- - INV-02 (Passive Infrastructure): Router reflects actor state, never decides
26
- - Actor validates all navigation via guards before URL changes
27
+ - INV-02 (Passive Infrastructure): the router reflects the actor state. It never decides
28
+ - The actor checks every navigation with its guards before the URL changes
27
29
 
28
- The class is concrete it can be instantiated directly. The framework
29
- packages re-export or subclass it purely to bind the public adapter name
30
- (and, for Solid, to add the `dispose()` alias).
30
+ The class is concrete. You can create an instance of it directly. Each framework
31
+ package re-exports it, or makes a subclass of it, only to bind the public name of
32
+ the adapter. The Solid package also adds the `dispose()` alias.
31
33
 
32
34
  ## Example
33
35
 
@@ -56,17 +58,17 @@ new TanStackRouterBridgeBase(
56
58
  routeMap): TanStackRouterBridgeBase;
57
59
  ```
58
60
 
59
- Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:112](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L112)
61
+ Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:117](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L117)
60
62
 
61
- Create a TanStack Router bridge
63
+ Creates a TanStack Router bridge
62
64
 
63
65
  #### Parameters
64
66
 
65
- | Parameter | Type | Description |
66
- | ---------- | -------------------------------------------------------------------- | ------------------------------------------------- |
67
- | `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md) | TanStack Router instance (from `createRouter`) |
68
- | `actor` | [`RoutableActor`](../../play-dom-router/interfaces/RoutableActor.md) | XMachines actor instance |
69
- | `routeMap` | [`TanStackRouteMapLike`](../type-aliases/TanStackRouteMapLike.md) | Bidirectional mapping between state IDs and paths |
67
+ | Parameter | Type | Description |
68
+ | ---------- | -------------------------------------------------------------------- | --------------------------------------------------------- |
69
+ | `router` | [`TanStackRouterLike`](../type-aliases/TanStackRouterLike.md) | The TanStack Router instance from `createRouter` |
70
+ | `actor` | [`RoutableActor`](../../play-dom-router/interfaces/RoutableActor.md) | The XMachines actor instance |
71
+ | `routeMap` | [`TanStackRouteMapLike`](../type-aliases/TanStackRouteMapLike.md) | The bidirectional map between the state IDs and the paths |
70
72
 
71
73
  #### Returns
72
74
 
@@ -84,21 +86,23 @@ Create a TanStack Router bridge
84
86
  connect(): void;
85
87
  ```
86
88
 
87
- Defined in: play-router/dist/router-bridge-base.d.ts:120
89
+ Defined in: play-router/dist/router-bridge-base.d.ts:124
88
90
 
89
- Connect the router bridge to the Actor.
91
+ Connects the router bridge to the Actor.
90
92
 
91
- Sets up the TC39 Signal watcher for actor router direction and
92
- starts watching router changes (framework-specific).
93
+ The method installs the TC39 Signal watcher of the direction from the actor to the
94
+ router. It then starts the watch of the router changes, which each framework does
95
+ in its own way.
93
96
 
94
- Ordering here is part of the bridge contract:
97
+ The order of these steps is part of the contract of the bridge:
95
98
 
96
- - `lastSyncedPath` is seeded in the constructor from `actor.currentRoute`
97
- - the actor watcher is installed before adapter router subscriptions
98
- - initial sync then resolves deep-link vs restore using `actor.initialRoute`
99
+ - The constructor seeds `lastSyncedPath` from `actor.currentRoute`
100
+ - The method installs the actor watcher before the router subscriptions of the adapter
101
+ - The first synchronization then separates a deep link from a restore, with `actor.initialRoute`
99
102
 
100
- Adapters that need custom initial-sync behavior should override
101
- `getInitialRouterPath()` rather than reordering `connect()` steps.
103
+ An adapter that needs a different behavior of the first synchronization overrides
104
+ `getInitialRouterPath()`. It does not change the order of the steps of
105
+ `connect()`.
102
106
 
103
107
  #### Returns
104
108
 
@@ -116,11 +120,12 @@ Adapters that need custom initial-sync behavior should override
116
120
  disconnect(): void;
117
121
  ```
118
122
 
119
- Defined in: play-router/dist/router-bridge-base.d.ts:126
123
+ Defined in: play-router/dist/router-bridge-base.d.ts:131
120
124
 
121
- Disconnect the router bridge from the Actor.
125
+ Disconnects the router bridge from the Actor.
122
126
 
123
- Stops signal watching and unregisters framework-specific router listener.
127
+ The method stops the watch of the signal, and it removes the router listener of the
128
+ framework.
124
129
 
125
130
  #### Returns
126
131
 
@@ -6,15 +6,15 @@
6
6
  type TanStackRouteMapLike = object;
7
7
  ```
8
8
 
9
- Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:66](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L66)
9
+ Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L69)
10
10
 
11
- Narrow route-map surface required by `TanStackRouterBridgeBase`.
12
- `RouteMap` from `@xmachines/play-router` satisfies it (null returns are
13
- adapted to undefined internally).
11
+ The narrow route-map surface that `TanStackRouterBridgeBase` requires.
12
+ `RouteMap` from `@xmachines/play-router` satisfies it. The bridge converts a
13
+ `null` result into `undefined` internally.
14
14
 
15
- `getPathByStateId` may receive the stateId in either `"#stateId"` or bare
16
- `"stateId"` form — the bridge tries both forms automatically, so custom
17
- implementations keyed on a single form still resolve.
15
+ `getPathByStateId` can receive the stateId in the form `"#stateId"` or in the
16
+ bare form `"stateId"`. The bridge tries both forms. Therefore an implementation
17
+ that holds one form only still resolves the path.
18
18
 
19
19
  ## Methods
20
20
 
@@ -24,7 +24,7 @@ implementations keyed on a single form still resolve.
24
24
  getPathByStateId(id): string | null | undefined;
25
25
  ```
26
26
 
27
- Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:68](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L68)
27
+ Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:71](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L71)
28
28
 
29
29
  #### Parameters
30
30
 
@@ -44,7 +44,7 @@ Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:68](https:/
44
44
  getStateIdByPath(path): string | null | undefined;
45
45
  ```
46
46
 
47
- Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:67](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L67)
47
+ Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:70](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L70)
48
48
 
49
49
  #### Parameters
50
50
 
@@ -6,11 +6,11 @@
6
6
  type TanStackRouterLike = object;
7
7
  ```
8
8
 
9
- Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:36](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L36)
9
+ Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:37](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L37)
10
10
 
11
- Structural (type-only) interface for the TanStack Router surface used by
12
- `TanStackRouterBridgeBase`. Both `@tanstack/react-router` and
13
- `@tanstack/solid-router` instances satisfy it.
11
+ The type-only interface of the TanStack Router surface that
12
+ `TanStackRouterBridgeBase` uses. An instance of `@tanstack/react-router` and an
13
+ instance of `@tanstack/solid-router` both satisfy it.
14
14
 
15
15
  ## Properties
16
16
 
@@ -20,7 +20,7 @@ Structural (type-only) interface for the TanStack Router surface used by
20
20
  history: object;
21
21
  ```
22
22
 
23
- Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:44](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L44)
23
+ Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:46](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L46)
24
24
 
25
25
  #### location
26
26
 
@@ -28,9 +28,10 @@ Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:44](https:/
28
28
  location: object;
29
29
  ```
30
30
 
31
- Current location populated from `window.location` when `createRouter()` runs,
32
- before `router.load()`. Always available in the browser.
33
- `router.state.location` is only populated after `router.load()` and may be stale.
31
+ The current location. `createRouter()` fills it from `window.location`, before
32
+ `router.load()`. It is always available in the browser.
33
+ `router.state.location` has a value only after `router.load()`, and that value
34
+ can be old.
34
35
 
35
36
  ##### location.pathname
36
37
 
@@ -68,11 +69,12 @@ subscribe(handler): () => void;
68
69
  optional load(): void | Promise<void>;
69
70
  ```
70
71
 
71
- Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:43](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L43)
72
+ Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:45](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L45)
72
73
 
73
- Re-runs TanStack route matching and loaders for the current location.
74
- Optional: the bridge calls it (fire-and-forget) after every navigation so
75
- matching/loaders stay in sync even without a mounted `<RouterProvider>`.
74
+ Runs the TanStack route matching and the loaders again for the current location.
75
+ This method is optional. The bridge calls it after every navigation, and it does
76
+ not wait for the result. The matching and the loaders therefore stay correct,
77
+ also when no `<RouterProvider>` is mounted.
76
78
 
77
79
  #### Returns
78
80
 
@@ -86,7 +88,7 @@ matching/loaders stay in sync even without a mounted `<RouterProvider>`.
86
88
  navigate(args): void;
87
89
  ```
88
90
 
89
- Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:37](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.0.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L37)
91
+ Defined in: [play-tanstack-router/src/tanstack-router-bridge-base.ts:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.0/packages/play-tanstack-router/src/tanstack-router-bridge-base.ts#L38)
90
92
 
91
93
  #### Parameters
92
94
 
@@ -4,22 +4,20 @@
4
4
 
5
5
  **TanStack Solid Router adapter for XMachines Universal Player Architecture**
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-solid-router)
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-solid-router)
8
8
 
9
- Signals-native integration with TanStack Solid Router enabling logic-driven navigation through Solid.js reactivity.
10
-
11
- Part of the [xmachines-js](../../README.md) monorepo.
9
+ This package integrates TanStack Solid Router with the TC39 Signals. The logic then drives the navigation through the Solid.js reactivity.
12
10
 
13
11
  ## Overview
14
12
 
15
13
  [`@xmachines/play-tanstack-solid-router`](README.md) connects a Play actor to TanStack Solid Router through `TanStackSolidRouterBridge`.
16
14
 
17
- The bridge extends `RouterBridgeBase` from [`@xmachines/play-router`](../play-router/README.md), keeping adapter behavior consistent across frameworks:
15
+ The bridge extends `RouterBridgeBase` from [`@xmachines/play-router`](../play-router/README.md). Each adapter therefore behaves in the same way in every framework:
18
16
 
19
- - Actor route signal (`actor.currentRoute`) drives router navigation.
20
- - Router history events send `play.route` intents back to the actor.
21
- - Guarded state transitions remain actor-owned (Actor Authority).
22
- - Circular update prevention built into `RouterBridgeBase`.
17
+ - The actor route signal (`actor.currentRoute`) drives the router navigation.
18
+ - Each router history event sends a `play.route` intent to the actor.
19
+ - The actor keeps the ownership of each guarded state transition (Actor Authority).
20
+ - `RouterBridgeBase` stops a circular update.
23
21
 
24
22
  ## Installation
25
23
 
@@ -36,31 +34,53 @@ pnpm add @xmachines/play-tanstack-solid-router @xmachines/play-router
36
34
 
37
35
  ## Current Exports
38
36
 
39
- - `TanStackSolidRouterBridge` — primary adapter class
40
- - `PlayRouterProvider` — Solid component wrapper for bridge lifecycle
37
+ - `TanStackSolidRouterBridge` — the primary adapter class
38
+ - `PlayRouterProvider` — the Solid component that manages the bridge lifecycle
41
39
  - `PlayRouterProviderProps`, `TanStackRouterInstance` (types)
42
- - `PlayActor` — canonical actor shape (`AbstractActor & Routable & Viewable`) from `@xmachines/play-router`; use when constructing a typed renderer callback for `PlayRouterProvider`
43
- - `RoutableActor` — deprecated alias for `PlayActor`; use `PlayActor` from `@xmachines/play-router` instead
40
+ - `PlayActor` — the canonical actor shape (`AbstractActor & Routable & Viewable`) from `@xmachines/play-router`. Use it for the type of a renderer callback of `PlayRouterProvider`
41
+ - `RoutableActor` — the deprecated alias of `PlayActor`. Use `PlayActor` from `@xmachines/play-router`
44
42
  - `RouteMap`, `createRouteMap`, `RouteMapping`, `RouteMapOptions` (re-exported from `@xmachines/play-router`)
45
43
  - `TanStackRouterLike` (type)
46
44
  - `RouterBridge`, `PlayRouteEvent` (types)
47
45
 
48
46
  ## URLPattern Support
49
47
 
50
- This package uses the [URLPattern API](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern) for route pattern matching via [`@xmachines/play-router`](../play-router/README.md).
48
+ This package matches each route pattern with the [URLPattern API](https://developer.mozilla.org/en-US/docs/Web/API/URLPattern), through [`@xmachines/play-router`](../play-router/README.md).
51
49
 
52
- URLPattern is available natively on Node.js 24+ and modern browsers (Chrome 95+, Firefox 117+, Safari 16.4+). On older environments, load a polyfill **before** importing this package see [`@xmachines/play-router`](../play-router/README.md) for details.
50
+ URLPattern is native in Node.js 24+ and in a modern browser (Chrome 95+, Firefox 117+, Safari 16.4+). In an older environment, load a polyfill **before** you import this package. See [`@xmachines/play-router`](../play-router/README.md) for the details.
53
51
 
54
52
  ## Quick Start
55
53
 
56
54
  ```tsx
57
- import { createRouter } from "@tanstack/solid-router";
58
- import { definePlayer } from "@xmachines/play-xstate";
59
- import { extractMachineRoutes } from "@xmachines/play-router";
55
+ import { createRouter, createRootRoute, createRoute } from "@tanstack/solid-router";
56
+ import { createMachine } from "xstate";
57
+ import { definePlayer, formatPlayRouteTransitions } from "@xmachines/play-xstate";
58
+ import { extractMachineRoutes, getRoutableRoutes } from "@xmachines/play-router";
60
59
  import { TanStackSolidRouterBridge, createRouteMap } from "@xmachines/play-tanstack-solid-router";
61
60
 
61
+ const machine = createMachine(
62
+ formatPlayRouteTransitions({
63
+ id: "app",
64
+ initial: "home",
65
+ states: {
66
+ home: { id: "home", meta: { route: "/" } },
67
+ about: { id: "about", meta: { route: "/about" } },
68
+ },
69
+ }),
70
+ );
71
+
62
72
  const routeMap = createRouteMap(machine);
63
- const router = createRouter({ routeTree: tanstackRouteTree });
73
+
74
+ // Mirror the machine's routable states as TanStack routes
75
+ const rootRoute = createRootRoute();
76
+ const tanstackRoutes = getRoutableRoutes(extractMachineRoutes(machine)).map((route) =>
77
+ createRoute({
78
+ getParentRoute: () => rootRoute,
79
+ path: route.fullPath.replace(/:(\w+)/g, "$$$1"),
80
+ component: () => null,
81
+ }),
82
+ );
83
+ const router = createRouter({ routeTree: rootRoute.addChildren(tanstackRoutes) });
64
84
 
65
85
  const actor = definePlayer({ machine })();
66
86
  actor.start();
@@ -74,12 +94,13 @@ bridge.disconnect();
74
94
 
75
95
  ### Solid convenience wrapper
76
96
 
77
- Use `PlayRouterProvider` when you want bridge lifecycle wiring managed by a component:
97
+ Use `PlayRouterProvider` when you want a component to manage the bridge lifecycle:
78
98
 
79
99
  ```tsx
80
100
  import { PlayRouterProvider } from "@xmachines/play-tanstack-solid-router";
81
101
  import { RouterProvider } from "@tanstack/solid-router";
82
102
 
103
+ // actor, router, and routeMap from the Quick Start above
83
104
  <PlayRouterProvider
84
105
  actor={actor}
85
106
  router={router}
@@ -94,7 +115,7 @@ import { RouterProvider } from "@tanstack/solid-router";
94
115
 
95
116
  ### `TanStackSolidRouterBridge`
96
117
 
97
- Primary adapter class extending `RouterBridgeBase`.
118
+ The primary adapter class. It extends `RouterBridgeBase`.
98
119
 
99
120
  ```ts
100
121
  class TanStackSolidRouterBridge {
@@ -107,14 +128,14 @@ class TanStackSolidRouterBridge {
107
128
 
108
129
  **Behavior:**
109
130
 
110
- - `connect()` — subscribes to `router.history`, performs initial deep-link sync from `router.history.location`, and starts watching `actor.currentRoute` for state-driven navigation.
111
- - `disconnect()` — unsubscribes from history and stops all sync.
112
- - Navigates via `router.navigate({ to: path })`.
113
- - Subscribes via `router.history.subscribe` covers PUSH, POP, BACK, FORWARD, REPLACE, and GO, and works without `<RouterProvider>` mounted.
131
+ - `connect()` — subscribes to `router.history`, sets the actor state from `router.history.location` for a deep link, and then watches `actor.currentRoute` for a state-driven navigation.
132
+ - `disconnect()` — cancels the subscription to the history and stops all the synchronization.
133
+ - It navigates with `router.navigate({ to: path })`.
134
+ - It subscribes with `router.history.subscribe`. This covers PUSH, POP, BACK, FORWARD, REPLACE, and GO, and it works when no `<RouterProvider>` is mounted.
114
135
 
115
136
  ### `PlayRouterProvider`
116
137
 
117
- Solid component that instantiates, connects, and cleans up a `TanStackSolidRouterBridge` automatically.
138
+ This Solid component creates a `TanStackSolidRouterBridge`, connects it, and cleans it up for you.
118
139
 
119
140
  ```ts
120
141
  interface PlayRouterProviderProps<TActor extends PlayActor = PlayActor> {
@@ -129,11 +150,11 @@ interface PlayRouterProviderProps<TActor extends PlayActor = PlayActor> {
129
150
  }
130
151
  ```
131
152
 
132
- The bridge is created synchronously at component evaluation time (Solid's execution model) and torn down via `onCleanup` when the component is disposed.
153
+ The component creates the bridge synchronously, during its own evaluation, because this is the execution model of Solid. It disconnects the bridge in `onCleanup`, when Solid disposes of the component.
133
154
 
134
155
  ### `RouteMap` and `createRouteMap`
135
156
 
136
- Map state IDs to URL paths and resolve URLs back to state IDs.
157
+ These two exports map each state ID to a URL path, and each URL back to a state ID.
137
158
 
138
159
  ```ts
139
160
  const routeMap = new RouteMap([
@@ -145,13 +166,17 @@ const routeMap = new RouteMap([
145
166
  routeMap.getStateIdByPath("/profile/123"); // "profile"
146
167
  routeMap.getPathByStateId("home"); // "/"
147
168
  routeMap.getStateIdByPath("/unknown"); // null
169
+ ```
148
170
 
149
- // Or build from a machine directly:
171
+ Or build from a machine directly:
172
+
173
+ ```ts
150
174
  import { createRouteMap } from "@xmachines/play-tanstack-solid-router";
151
- const routeMap = createRouteMap(machine);
175
+
176
+ const routeMap = createRouteMap(machine); // machine: your routable machine (states carry meta.route)
152
177
  ```
153
178
 
154
- `getStateIdByPath` returns `null` (not `undefined`) for unmatched paths.
179
+ `getStateIdByPath` returns `null`, not `undefined`, for a path that it cannot match.
155
180
 
156
181
  ## Usage Patterns
157
182
 
@@ -169,7 +194,7 @@ const routeMap = new RouteMap([
169
194
 
170
195
  ### Protected Routes and Guards
171
196
 
172
- Auth guards live entirely inside the state machine, preventing flashes of unauthorized content:
197
+ The auth guards are inside the state machine only. Unauthorized content therefore never appears, not even for a moment:
173
198
 
174
199
  ```ts
175
200
  const machineConfig = {
@@ -185,13 +210,13 @@ const machineConfig = {
185
210
  };
186
211
  ```
187
212
 
188
- When a user navigates to `/dashboard` while unauthenticated:
213
+ A user navigates to `/dashboard`, and the user is not authenticated:
189
214
 
190
- 1. TanStack Router updates location.
191
- 2. Bridge intercepts and sends `play.route` to the actor.
192
- 3. Actor evaluates the guard denies transition, moves to `login` instead.
193
- 4. Bridge observes new actor route (`/login`).
194
- 5. Bridge calls `router.navigate({ to: "/login" })`.
215
+ 1. TanStack Router updates the location.
216
+ 2. The bridge receives the change and sends `play.route` to the actor.
217
+ 3. The actor evaluates the guard. The guard refuses the transition, and the actor moves to `login`.
218
+ 4. The bridge reads the new actor route (`/login`).
219
+ 5. The bridge calls `router.navigate({ to: "/login" })`.
195
220
 
196
221
  ### Full App Example
197
222
 
@@ -201,6 +226,7 @@ import { onCleanup } from "solid-js";
201
226
  import { PlayRouterProvider, createRouteMap } from "@xmachines/play-tanstack-solid-router";
202
227
  import { definePlayer } from "@xmachines/play-xstate";
203
228
  import { extractMachineRoutes, getRoutableRoutes } from "@xmachines/play-router";
229
+ import { authMachine } from "./auth-machine.js"; // your routable machine (states carry meta.route)
204
230
 
205
231
  const createPlayer = definePlayer({ machine: authMachine });
206
232
  const actor = createPlayer();
@@ -246,12 +272,12 @@ export default function App() {
246
272
 
247
273
  Bridge-first data flow:
248
274
 
249
- 1. `RouterBridgeBase.connect()` performs initial actor/router synchronization both pathname and query string from `router.history.location` are forwarded to the actor on first connect.
250
- 2. Actor route updates (`actor.currentRoute` signal) call TanStack navigation (`router.navigate({ to })`).
251
- 3. TanStack history updates are subscribed and translated to `play.route` events sent to the actor.
252
- 4. Actor guards accept or reject transitions; infrastructure reflects resulting state.
275
+ 1. `RouterBridgeBase.connect()` does the first synchronization between the actor and the router. It sends both the pathname and the query string of `router.history.location` to the actor.
276
+ 2. Each actor route update, through the `actor.currentRoute` signal, calls the TanStack navigation (`router.navigate({ to })`).
277
+ 3. The bridge subscribes to the TanStack history updates. It converts each update into a `play.route` event, then sends the event to the actor.
278
+ 4. The guards of the actor accept or refuse each transition. The infrastructure reflects the state that results.
253
279
 
254
- This keeps routing infrastructure passive while preserving business-logic control in the state machine.
280
+ The routing infrastructure therefore stays passive, and the state machine keeps the control of the business logic.
255
281
 
256
282
  ## Testing
257
283
 
@@ -267,7 +293,7 @@ Or from the package directory:
267
293
  pnpm test
268
294
  ```
269
295
 
270
- **Browser tests** (`test/browser/**/*.browser.test.ts`) run against real Chromium via Playwright, covering async sequencing that jsdom cannot faithfully reproduce: BACK/FORWARD navigation via `router.history.subscribe`, echo suppression under real microtask timing, `navigate({ to })` call verification, and subscriber teardown on `disconnect()` and `dispose()`.
296
+ **Browser tests** (`test/browser/**/*.browser.test.ts`) run in real Chromium through Playwright. They cover the asynchronous sequences that jsdom cannot reproduce: BACK and FORWARD navigation through `router.history.subscribe`, echo suppression under real microtask timing, the check of each `navigate({ to })` call, and subscriber teardown on `disconnect()` and on `dispose()`.
271
297
 
272
298
  ```bash
273
299
  # Run browser tests only
@@ -279,7 +305,7 @@ Coverage thresholds: lines 80%, functions 80%, branches 70%, statements 80%.
279
305
  ## Related Packages
280
306
 
281
307
  - [@xmachines/play-router](../play-router/README.md) — core router primitives and `RouterBridgeBase`
282
- - [@xmachines/play-tanstack-react-router](../play-tanstack-react-router/README.md) — TanStack Router (React) equivalent
308
+ - [@xmachines/play-tanstack-react-router](../play-tanstack-react-router/README.md) — the same adapter for TanStack Router (React)
283
309
  - [@xmachines/play-solid](../play-solid/README.md) — SolidJS renderer
284
310
  - [@xmachines/play-solid-router](../play-solid-router/README.md) — native `@solidjs/router` adapter
285
311
  - [@xmachines/play-xstate](../play-xstate/README.md) — XState v5 player factory