@xmachines/docs 2.1.1 → 3.0.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 (360) hide show
  1. package/README.md +2 -2
  2. package/api/@xmachines/play/README.md +74 -7
  3. package/api/@xmachines/play/classes/NonNullableError.md +4 -4
  4. package/api/@xmachines/play/classes/PlayError.md +4 -4
  5. package/api/@xmachines/play/functions/asCleanup.md +78 -0
  6. package/api/@xmachines/play/functions/assertNonNullable.md +1 -1
  7. package/api/@xmachines/play/type-aliases/Cleanup.md +38 -0
  8. package/api/@xmachines/play/type-aliases/DisposeKey.md +32 -0
  9. package/api/@xmachines/play/type-aliases/PlayEvent.md +2 -2
  10. package/api/@xmachines/play/variables/DISPOSE.md +34 -0
  11. package/api/@xmachines/play-actor/README.md +8 -1
  12. package/api/@xmachines/play-actor/classes/AbstractActor.md +3 -3
  13. package/api/@xmachines/play-actor/functions/attachRenderErrorHandler.md +1 -1
  14. package/api/@xmachines/play-actor/functions/composePlayState.md +1 -1
  15. package/api/@xmachines/play-actor/functions/createFailureLatch.md +20 -0
  16. package/api/@xmachines/play-actor/functions/createReportGuard.md +26 -0
  17. package/api/@xmachines/play-actor/functions/createViewStoreLifecycle.md +1 -1
  18. package/api/@xmachines/play-actor/functions/guardContextWrites.md +1 -1
  19. package/api/@xmachines/play-actor/functions/refreshContextSubtree.md +1 -1
  20. package/api/@xmachines/play-actor/functions/reuseComposedState.md +1 -1
  21. package/api/@xmachines/play-actor/functions/sameViewInputs.md +25 -0
  22. package/api/@xmachines/play-actor/functions/shallowEqualExcept.md +1 -1
  23. package/api/@xmachines/play-actor/functions/toAtomState.md +1 -1
  24. package/api/@xmachines/play-actor/functions/typedSpec.md +1 -1
  25. package/api/@xmachines/play-actor/interfaces/BaseActorProviderProps.md +5 -5
  26. package/api/@xmachines/play-actor/interfaces/BaseViewContextValue.md +5 -5
  27. package/api/@xmachines/play-actor/interfaces/FailureLatch.md +59 -0
  28. package/api/@xmachines/play-actor/interfaces/PlaySpec.md +2 -2
  29. package/api/@xmachines/play-actor/interfaces/ReportGuard.md +92 -0
  30. package/api/@xmachines/play-actor/interfaces/ReportGuardMessages.md +18 -0
  31. package/api/@xmachines/play-actor/interfaces/ResolveViewStoreOptions.md +2 -2
  32. package/api/@xmachines/play-actor/interfaces/Routable.md +3 -3
  33. package/api/@xmachines/play-actor/interfaces/ViewInputs.md +19 -0
  34. package/api/@xmachines/play-actor/interfaces/ViewStoreLifecycle.md +3 -3
  35. package/api/@xmachines/play-actor/interfaces/ViewStoreResolution.md +4 -4
  36. package/api/@xmachines/play-actor/interfaces/Viewable.md +2 -2
  37. package/api/@xmachines/play-actor/variables/CONTEXT_STATE_KEY.md +1 -1
  38. package/api/@xmachines/play-dom/README.md +84 -16
  39. package/api/@xmachines/play-dom/classes/PlayRenderer.md +10 -10
  40. package/api/@xmachines/play-dom/functions/createPlayUI.md +8 -8
  41. package/api/@xmachines/play-dom/functions/createRenderer.md +3 -3
  42. package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +17 -11
  43. package/api/@xmachines/play-dom/interfaces/MountOptions.md +5 -4
  44. package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +14 -12
  45. package/api/@xmachines/play-dom/type-aliases/Cleanup.md +38 -0
  46. package/api/@xmachines/play-dom/type-aliases/DisposablePlayUI.md +36 -0
  47. package/api/@xmachines/play-dom/type-aliases/MountFn.md +6 -1
  48. package/api/@xmachines/play-dom-router/README.md +46 -18
  49. package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +149 -7
  50. package/api/@xmachines/play-dom-router/functions/connectRouter.md +6 -5
  51. package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +3 -3
  52. package/api/@xmachines/play-dom-router/functions/createRouteMap.md +1 -1
  53. package/api/@xmachines/play-dom-router/functions/createRouter.md +20 -8
  54. package/api/@xmachines/play-dom-router/interfaces/BasePathOptions.md +32 -0
  55. package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +27 -17
  56. package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +16 -16
  57. package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +12 -6
  58. package/api/@xmachines/play-dom-router/interfaces/DisposableBrowserHistory.md +262 -0
  59. package/api/@xmachines/play-dom-router/interfaces/DisposableVanillaRouter.md +80 -0
  60. package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +6 -6
  61. package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +4 -4
  62. package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
  63. package/api/@xmachines/play-dom-router/interfaces/RouteMap.md +3 -3
  64. package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +2 -2
  65. package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
  66. package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +3 -3
  67. package/api/@xmachines/play-dom-router/interfaces/RouterConnection.md +105 -0
  68. package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +26 -5
  69. package/api/@xmachines/play-dom-router/type-aliases/Cleanup.md +38 -0
  70. package/api/@xmachines/play-dom-router/variables/DISPOSE.md +34 -0
  71. package/api/@xmachines/play-react/README.md +2 -2
  72. package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +42 -7
  73. package/api/@xmachines/play-react/functions/useActor.md +1 -1
  74. package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
  75. package/api/@xmachines/play-react/functions/useSignalEffect.md +1 -1
  76. package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +10 -10
  77. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +8 -6
  78. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +6 -5
  79. package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +13 -13
  80. package/api/@xmachines/play-react/interfaces/ViewContextValue.md +5 -5
  81. package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +1 -1
  82. package/api/@xmachines/play-react/type-aliases/PlayRendererProps.md +1 -1
  83. package/api/@xmachines/play-react/variables/ActorProvider.md +1 -1
  84. package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
  85. package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
  86. package/api/@xmachines/play-react-router/README.md +2 -2
  87. package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +172 -15
  88. package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
  89. package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +7 -18
  90. package/api/@xmachines/play-react-router/functions/createRouteMap.md +1 -1
  91. package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +1 -1
  92. package/api/@xmachines/play-react-router/interfaces/PlayActor.md +5 -5
  93. package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +6 -6
  94. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +10 -8
  95. package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +2 -2
  96. package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
  97. package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +3 -3
  98. package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +15 -9
  99. package/api/@xmachines/play-react-router/type-aliases/PlayRouterProviderBaseProps.md +26 -0
  100. package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +4 -4
  101. package/api/@xmachines/play-router/README.md +308 -11
  102. package/api/@xmachines/play-router/classes/RouteMap.md +4 -4
  103. package/api/@xmachines/play-router/classes/RouterBridgeBase.md +178 -19
  104. package/api/@xmachines/play-router/functions/buildPlayRouteEvent.md +1 -1
  105. package/api/@xmachines/play-router/functions/buildRouteTree.md +1 -1
  106. package/api/@xmachines/play-router/functions/cleanFrameworkParams.md +40 -0
  107. package/api/@xmachines/play-router/functions/createRouteMap.md +1 -1
  108. package/api/@xmachines/play-router/functions/createRouteMapFromTree.md +1 -1
  109. package/api/@xmachines/play-router/functions/createRouterConnection.md +21 -0
  110. package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +1 -1
  111. package/api/@xmachines/play-router/functions/extractMachineRoutes.md +1 -1
  112. package/api/@xmachines/play-router/functions/extractQuery.md +1 -1
  113. package/api/@xmachines/play-router/functions/extractRouteParams.md +1 -1
  114. package/api/@xmachines/play-router/functions/findRouteById.md +1 -1
  115. package/api/@xmachines/play-router/functions/findRouteByPath.md +1 -1
  116. package/api/@xmachines/play-router/functions/getNavigableRoutes.md +1 -1
  117. package/api/@xmachines/play-router/functions/getPatternParamNames.md +24 -0
  118. package/api/@xmachines/play-router/functions/getRequiredPatternParamNames.md +36 -0
  119. package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
  120. package/api/@xmachines/play-router/functions/getRouteMappings.md +67 -0
  121. package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +1 -1
  122. package/api/@xmachines/play-router/functions/isMountableBridge.md +26 -0
  123. package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
  124. package/api/@xmachines/play-router/functions/joinBasePath.md +37 -0
  125. package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
  126. package/api/@xmachines/play-router/functions/mountKey.md +28 -0
  127. package/api/@xmachines/play-router/functions/normalizeBasePath.md +43 -0
  128. package/api/@xmachines/play-router/functions/openProviderBridge.md +41 -0
  129. package/api/@xmachines/play-router/functions/pickOwnParams.md +41 -0
  130. package/api/@xmachines/play-router/functions/repointProviderBridge.md +27 -0
  131. package/api/@xmachines/play-router/functions/resolveBasePath.md +51 -0
  132. package/api/@xmachines/play-router/functions/resolveFrameworkParams.md +51 -0
  133. package/api/@xmachines/play-router/functions/routeExists.md +1 -1
  134. package/api/@xmachines/play-router/functions/sanitizePathname.md +1 -1
  135. package/api/@xmachines/play-router/functions/stripBasePath.md +44 -0
  136. package/api/@xmachines/play-router/functions/validateRouteFormat.md +1 -1
  137. package/api/@xmachines/play-router/functions/validateStateExists.md +1 -1
  138. package/api/@xmachines/play-router/interfaces/BasePathOptions.md +32 -0
  139. package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +6 -6
  140. package/api/@xmachines/play-router/interfaces/FrameworkParamsSource.md +47 -0
  141. package/api/@xmachines/play-router/interfaces/LocationLike.md +5 -5
  142. package/api/@xmachines/play-router/interfaces/MachineEdgeData.md +5 -5
  143. package/api/@xmachines/play-router/interfaces/MachineNodeData.md +7 -7
  144. package/api/@xmachines/play-router/interfaces/MountableRouterBridge.md +130 -0
  145. package/api/@xmachines/play-router/interfaces/OpenProviderBridgeArgs.md +28 -0
  146. package/api/@xmachines/play-router/interfaces/PlayActor.md +7 -7
  147. package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +8 -8
  148. package/api/@xmachines/play-router/interfaces/PlayRouterProviderBaseProps.md +33 -0
  149. package/api/@xmachines/play-router/interfaces/ResolvedBasePath.md +14 -0
  150. package/api/@xmachines/play-router/interfaces/ResolvedRoutePath.md +5 -5
  151. package/api/@xmachines/play-router/interfaces/RoutableActor.md +6 -6
  152. package/api/@xmachines/play-router/interfaces/RouteInfo.md +10 -10
  153. package/api/@xmachines/play-router/interfaces/RouteMapOptions.md +4 -4
  154. package/api/@xmachines/play-router/interfaces/RouteMapping.md +5 -5
  155. package/api/@xmachines/play-router/interfaces/RouteMatch.md +5 -5
  156. package/api/@xmachines/play-router/interfaces/RouteNode.md +12 -12
  157. package/api/@xmachines/play-router/interfaces/RouteObject.md +4 -4
  158. package/api/@xmachines/play-router/interfaces/RouteTree.md +7 -7
  159. package/api/@xmachines/play-router/interfaces/RouteWatcherHandle.md +3 -3
  160. package/api/@xmachines/play-router/interfaces/RouterBridge.md +7 -3
  161. package/api/@xmachines/play-router/interfaces/RouterConnection.md +105 -0
  162. package/api/@xmachines/play-router/interfaces/WindowLike.md +3 -3
  163. package/api/@xmachines/play-router/type-aliases/BaseRouteMapping.md +1 -1
  164. package/api/@xmachines/play-router/type-aliases/MachineGraph.md +1 -1
  165. package/api/@xmachines/play-router/type-aliases/PlayRouterBridgeConstructor.md +36 -0
  166. package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +1 -1
  167. package/api/@xmachines/play-router/variables/DISPOSE.md +34 -0
  168. package/api/@xmachines/play-router/variables/NO_BASE_PATH.md +18 -0
  169. package/api/@xmachines/play-signals/README.md +4 -2
  170. package/api/@xmachines/play-signals/functions/watchSignal.md +27 -4
  171. package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +2 -2
  172. package/api/@xmachines/play-signals/interfaces/SignalComputed.md +2 -2
  173. package/api/@xmachines/play-signals/interfaces/SignalOptions.md +2 -2
  174. package/api/@xmachines/play-signals/interfaces/SignalState.md +3 -3
  175. package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +4 -4
  176. package/api/@xmachines/play-signals/type-aliases/Cleanup.md +38 -0
  177. package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +1 -1
  178. package/api/@xmachines/play-solid/README.md +23 -5
  179. package/api/@xmachines/play-solid/functions/useActor.md +1 -1
  180. package/api/@xmachines/play-solid/functions/usePlayView.md +14 -1
  181. package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +10 -10
  182. package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +13 -13
  183. package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +13 -5
  184. package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +1 -1
  185. package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
  186. package/api/@xmachines/play-solid/variables/ActorProvider.md +1 -1
  187. package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
  188. package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
  189. package/api/@xmachines/play-solid-router/README.md +19 -3
  190. package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
  191. package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +166 -18
  192. package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +8 -18
  193. package/api/@xmachines/play-solid-router/functions/createRouteMap.md +1 -1
  194. package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +3 -3
  195. package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +5 -5
  196. package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +6 -6
  197. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +10 -8
  198. package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +2 -2
  199. package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
  200. package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +3 -3
  201. package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +14 -12
  202. package/api/@xmachines/play-solid-router/type-aliases/PlayRouterProviderBaseProps.md +26 -0
  203. package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +1 -1
  204. package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
  205. package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +4 -4
  206. package/api/@xmachines/play-svelte/README.md +3 -3
  207. package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
  208. package/api/@xmachines/play-svelte/functions/getActorContext.md +1 -1
  209. package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +7 -1
  210. package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
  211. package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +10 -10
  212. package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
  213. package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +13 -13
  214. package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +5 -5
  215. package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +1 -1
  216. package/api/@xmachines/play-svelte-spa-router/README.md +3 -1
  217. package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +4 -4
  218. package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +148 -6
  219. package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +3 -3
  220. package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +1 -1
  221. package/api/@xmachines/play-svelte-spa-router/interfaces/BasePathOptions.md +32 -0
  222. package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +12 -6
  223. package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +6 -6
  224. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +2 -2
  225. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
  226. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +3 -3
  227. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterConnection.md +105 -0
  228. package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
  229. package/api/@xmachines/play-svelte-spa-router/type-aliases/RoutableActor.md +1 -1
  230. package/api/@xmachines/play-sveltekit-router/README.md +3 -1
  231. package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +4 -4
  232. package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +148 -6
  233. package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +3 -3
  234. package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +1 -1
  235. package/api/@xmachines/play-sveltekit-router/interfaces/BasePathOptions.md +32 -0
  236. package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +28 -6
  237. package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
  238. package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +6 -6
  239. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +2 -2
  240. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
  241. package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +3 -3
  242. package/api/@xmachines/play-sveltekit-router/interfaces/RouterConnection.md +105 -0
  243. package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
  244. package/api/@xmachines/play-tanstack-react-router/README.md +2 -2
  245. package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
  246. package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +148 -6
  247. package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +7 -18
  248. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +1 -1
  249. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +1 -1
  250. package/api/@xmachines/play-tanstack-react-router/functions/extractMachineRoutes.md +1 -1
  251. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayActor.md +5 -5
  252. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +6 -6
  253. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +10 -8
  254. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +2 -2
  255. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
  256. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +3 -3
  257. package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +3 -3
  258. package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +15 -9
  259. package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterProviderBaseProps.md +26 -0
  260. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
  261. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +5 -5
  262. package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +4 -4
  263. package/api/@xmachines/play-tanstack-router/README.md +1 -1
  264. package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +153 -11
  265. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +3 -3
  266. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +5 -5
  267. package/api/@xmachines/play-tanstack-solid-router/README.md +2 -2
  268. package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
  269. package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +149 -7
  270. package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +7 -17
  271. package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +1 -1
  272. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayActor.md +5 -5
  273. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +6 -6
  274. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +10 -8
  275. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +2 -2
  276. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
  277. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +3 -3
  278. package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +15 -9
  279. package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterProviderBaseProps.md +26 -0
  280. package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +1 -1
  281. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
  282. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +5 -5
  283. package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +4 -4
  284. package/api/@xmachines/play-vue/README.md +34 -12
  285. package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
  286. package/api/@xmachines/play-vue/functions/useActor.md +1 -1
  287. package/api/@xmachines/play-vue/functions/usePlayView.md +6 -1
  288. package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +12 -7
  289. package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +15 -10
  290. package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +5 -5
  291. package/api/@xmachines/play-vue/interfaces/VisibilityProviderProps.md +1 -1
  292. package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +1 -1
  293. package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
  294. package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
  295. package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
  296. package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
  297. package/api/@xmachines/play-vue/variables/getPlayViewContext.md +6 -1
  298. package/api/@xmachines/play-vue-router/README.md +1 -1
  299. package/api/@xmachines/play-vue-router/classes/RouteMap.md +4 -4
  300. package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +154 -12
  301. package/api/@xmachines/play-vue-router/functions/createRouteMap.md +1 -1
  302. package/api/@xmachines/play-vue-router/interfaces/PlayActor.md +5 -5
  303. package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +6 -6
  304. package/api/@xmachines/play-vue-router/interfaces/RouteMapOptions.md +2 -2
  305. package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +3 -3
  306. package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +3 -3
  307. package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +1 -1
  308. package/api/@xmachines/play-vue-router/type-aliases/VueRouteMap.md +1 -1
  309. package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +25 -2
  310. package/api/@xmachines/play-vue-router/variables/VueRouteMap.md +1 -1
  311. package/api/@xmachines/play-xstate/README.md +19 -2
  312. package/api/@xmachines/play-xstate/classes/PlayerActor.md +53 -17
  313. package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +1 -1
  314. package/api/@xmachines/play-xstate/functions/composeGuards.md +1 -1
  315. package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +1 -1
  316. package/api/@xmachines/play-xstate/functions/contextFieldMatches.md +1 -1
  317. package/api/@xmachines/play-xstate/functions/definePlayer.md +1 -1
  318. package/api/@xmachines/play-xstate/functions/deriveRoute.md +1 -1
  319. package/api/@xmachines/play-xstate/functions/eventMatches.md +1 -1
  320. package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +1 -1
  321. package/api/@xmachines/play-xstate/functions/hasContext.md +1 -1
  322. package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +1 -1
  323. package/api/@xmachines/play-xstate/functions/negateGuard.md +1 -1
  324. package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +3 -3
  325. package/api/@xmachines/play-xstate/interfaces/PlayerFactoryResumeOptions.md +2 -2
  326. package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +7 -7
  327. package/api/@xmachines/play-xstate/interfaces/RouteContext.md +5 -5
  328. package/api/@xmachines/play-xstate/interfaces/RouteObject.md +2 -2
  329. package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +1 -1
  330. package/api/@xmachines/play-xstate/type-aliases/Guard.md +1 -1
  331. package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +1 -1
  332. package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +1 -1
  333. package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +4 -4
  334. package/api/@xmachines/play-xstate/type-aliases/RouteMetadata.md +1 -1
  335. package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +4 -4
  336. package/api/@xmachines/play-xstate/variables/DISPOSE.md +34 -0
  337. package/api/@xmachines/shared/README.md +1 -1
  338. package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
  339. package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
  340. package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
  341. package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
  342. package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +2 -2
  343. package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
  344. package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
  345. package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
  346. package/contributing/architecture.md +5 -1
  347. package/contributing/configuration.md +60 -18
  348. package/contributing/development.md +66 -44
  349. package/contributing/testing.md +34 -7
  350. package/examples/README.md +1 -1
  351. package/examples/multi-router-integration.md +126 -1
  352. package/examples/routing-patterns.md +1 -1
  353. package/guides/getting-started.md +7 -7
  354. package/guides/inspector.md +1 -1
  355. package/guides/signals.md +43 -0
  356. package/package.json +1 -1
  357. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderBaseProps.md +0 -32
  358. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderBaseProps.md +0 -30
  359. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderBaseProps.md +0 -32
  360. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderBaseProps.md +0 -31
@@ -10,13 +10,13 @@ All packages extend the shared Vitest configuration helper `defineXmVitestConfig
10
10
 
11
11
  - `@xmachines/*` source aliases so imports resolve to source during test runs
12
12
  - `@xmachines/shared/vitest-setup` — extends Vitest matchers with `@testing-library/jest-dom`
13
- - `@xmachines/shared/vitest-node-setup` — enforces Node.js ≥ 22 on non-browser projects
13
+ - `@xmachines/shared/vitest-node-setup` — enforces Node.js ≥ 24 on non-browser projects
14
14
 
15
15
  **Auto-injected setup files:**
16
16
 
17
17
  | File | When injected | Purpose |
18
18
  | --------------------------------------------- | ------------------------ | ------------------------------------------------------- |
19
- | `packages/shared/config/vitest.node.setup.ts` | All non-browser projects | Validates Node.js ≥ 22 runtime; throws if wrong runtime |
19
+ | `packages/shared/config/vitest.node.setup.ts` | All non-browser projects | Validates Node.js ≥ 24 runtime; throws if wrong runtime |
20
20
  | `packages/shared/config/vitest.setup.ts` | All projects | Imports `@testing-library/jest-dom/vitest` matchers |
21
21
 
22
22
  Before running any tests, ensure all dependencies are installed:
@@ -33,7 +33,9 @@ pnpm install --frozen-lockfile
33
33
  pnpm test
34
34
  ```
35
35
 
36
- Runs `vitest run` across all 30 package-level projects defined in the root `vitest.config.ts`. Uses the `forks` pool (up to 4 workers) with process-level isolation between test files.
36
+ Runs `vitest run` across every project that the root `vitest.config.ts` collects — 36 of them today: one for each package, one for each demo that holds node tests, and `infrastructure` for the repository tests in `tests/`. Uses the `forks` pool (up to 4 workers) with process-level isolation between test files.
37
+
38
+ The root config finds those projects by glob, so a new package or demo joins the run with no edit. Each test file must belong to **one** project: a package config that reaches into its own `examples/` collects the demo tests that the demo config collects already, and the run then executes them two times, under two different environments. `tests/project-collection-overlap.test.ts` asks Vitest for the whole collection and fails on any file that two projects claim.
37
39
 
38
40
  ### Watch mode (development)
39
41
 
@@ -80,7 +82,9 @@ Individual packages may enforce higher per-package thresholds in their own `vite
80
82
  pnpm run test:build
81
83
  ```
82
84
 
83
- Runs `tsc --build tsconfig.test.json`. This validates that all test TypeScript files across the monorepo type-check correctly without running the tests themselves. Also compiles `.typecheck.ts` files in `src/` directories.
85
+ Runs `tsc --build tsconfig.test.json --force`. This validates that all test TypeScript files across the monorepo type-check correctly without running the tests themselves. Also compiles `.typecheck.ts` files in `src/` directories.
86
+
87
+ This is the command that answers "does this tree type-check?". Use it rather than `pnpm run build` for that question. `tsc --build` skips a project whose dependencies have unchanged `.d.ts` files, so an error inside the source of a library that changes no exported declaration can leave every consumer of that library up to date and never be reported — and consumers here compile library **source**, through the `source` export condition. `--force` costs about a second and takes that decision away from tsc; `tests/typecheck-staleness.test.ts` holds it, and the two other properties the complete check rests on, in place: no project of the gate is `composite`, and the CI job starts with no build state on disk. The job gets that second property by DELETING every `*.tsbuildinfo` before it runs the gate. It does not inherit it: most of the caching of the pipeline arrives through the included node component, and no test in this repository can read that component's cache paths, so a claim about them would be prose that nothing verifies.
84
88
 
85
89
  ### Running tests for a single package
86
90
 
@@ -132,11 +136,32 @@ packages/<name>/
132
136
  ### Test helpers and shared setup
133
137
 
134
138
  - **`@xmachines/shared/vitest-setup`** — Injects `@testing-library/jest-dom` matchers. Applied automatically by `defineXmVitestConfig`.
135
- - **`@xmachines/shared/vitest-node-setup`** — Enforces Node ≥ 22 at runtime. Auto-injected for non-browser configs.
139
+ - **`@xmachines/shared/vitest-node-setup`** — Enforces Node ≥ 24 at runtime. Auto-injected for non-browser configs.
136
140
  - **`@xmachines/shared/vitest-urlpattern-setup`** — Polyfills `URLPattern` for packages that need it (e.g. `@xmachines/play-router`). Must be declared explicitly in `setupFiles`.
137
141
  - **`packages/play-react/test/test-utils.ts`** — React-specific test utilities for the `play-react` package.
138
142
  - **`packages/play-router/examples/shared/`** and **`packages/play-actor/examples/shared/`** — Shared test fixtures for router and actor integration tests.
139
143
 
144
+ ### Portable contract suites
145
+
146
+ Two suites live in `@xmachines/play-router-shared` and every router adapter runs them,
147
+ so a behaviour of `RouterBridgeBase` is asserted one time and covered eight times:
148
+
149
+ | Suite | Import | What it holds |
150
+ | -------------------------- | -------------------------------------------------------------- | ------------------------------------------------------- |
151
+ | `runBridgeContractTests` | `@xmachines/play-router-shared/test/router-bridge-contract.js` | The bidirectional sync contract, with optional sections |
152
+ | `runBasePathContractTests` | `@xmachines/play-router-shared/test/base-path-contract.js` | The `basePath` mount contract, and several machines |
153
+
154
+ An adapter supplies a harness rather than tests. For the `basePath` contract the
155
+ harness builds ONE router whose write reaches every bridge on it, and the suite mounts
156
+ one machine or two on that router. A browser behaves that way, and two bridges that
157
+ never see each other's writes never contend for the address bar — which is the case the
158
+ suite exists to cover.
159
+
160
+ Add a new adapter to both suites. A copy of the assertions in the adapter is how the
161
+ coverage drifted apart before: five adapters asserted the four behaviours of a mount,
162
+ two asserted two of them, and the vanilla DOM adapter asserted only that the option
163
+ reached the bridge.
164
+
140
165
  ## Writing New Tests
141
166
 
142
167
  ### Adding a new package test config
@@ -157,9 +182,11 @@ packages/<name>/
157
182
  });
158
183
  ```
159
184
 
160
- 4. Register the new config in the root `vitest.config.ts` `projects` array.
185
+ 4. Keep the `include` inside `test/`, and exclude `examples/`. The demo config of the package owns every test under `examples/`, and the root run joins both configs.
161
186
  5. Add the package's `tsconfig.test.json` to `tsconfig.test.json` references in the root.
162
187
 
188
+ The root `vitest.config.ts` needs no edit: it collects `packages/*/vitest.config.ts` and `packages/*/examples/*/vitest.config.ts` by glob.
189
+
163
190
  ### Basic test structure
164
191
 
165
192
  ```typescript
@@ -349,7 +376,7 @@ const actorNotAny: AssertFalse<IsAny<typeof actor>> = false;
349
376
  void actorNotAny;
350
377
  ```
351
378
 
352
- These files are validated by `pnpm run test:build` (`tsc --build tsconfig.test.json`) — never executed by Vitest.
379
+ These files are validated by `pnpm run test:build` (`tsc --build tsconfig.test.json --force`) — never executed by Vitest.
353
380
 
354
381
  ### Error testing
355
382
 
@@ -17,7 +17,7 @@ Start with the fundamental machine + actor pattern:
17
17
  Learn how state machines control navigation:
18
18
 
19
19
  - **[Routing Patterns](routing-patterns.md)** — `meta.route`, `play.route` events, `always` auth guards, and parameter routes
20
- - **[Multi-Router Integration](multi-router-integration.md)** — All 8 router adapters: provider pattern vs `connectRouter` pattern
20
+ - **[Multi-Router Integration](multi-router-integration.md)** — All 8 router adapters: provider pattern vs `connectRouter` pattern, and `basePath` for sharing a router with the host
21
21
 
22
22
  ### Level 3: Full Applications
23
23
 
@@ -11,7 +11,9 @@ There are two integration patterns:
11
11
  | Pattern | Used by | Key API |
12
12
  | --------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------- |
13
13
  | **Provider pattern** | React (TanStack, React Router), SolidJS (TanStack, SolidJS Router), Vue Router | `<PlayRouterProvider actor router routeMap renderer={...} />` |
14
- | **`connectRouter` pattern** | Vanilla DOM, SvelteKit, Svelte SPA Router | `connectRouter({ actor, routeMap })` |
14
+ | **`connectRouter` pattern** | Vanilla DOM, SvelteKit, Svelte SPA Router | `connectRouter({ actor, routeMap, ...adapter })` |
15
+
16
+ Either pattern can share its router with routes the host owns — see [Sharing a Router with the Host](#sharing-a-router-with-the-host-basepath).
15
17
 
16
18
  ## Pattern 1: Provider Pattern
17
19
 
@@ -348,6 +350,129 @@ export const routeMap = createRouteMap(authMachine);
348
350
  export const disconnectRouter = connectRouter({ actor, routeMap });
349
351
  ```
350
352
 
353
+ ## Sharing a Router with the Host (`basePath`)
354
+
355
+ Both patterns give the machine the complete URL space of its router by default. Pass a `basePath` and the machine owns a prefix only — the host keeps every other route in the same router.
356
+
357
+ The shape that motivates this is a URL such as `/:machineId/play/dashboard`. The host resolves `:machineId` — a TanStack loader, a `useParams()` call, a SvelteKit `load` function — and owns that prefix. The `meta.route` tree of the machine owns everything below it.
358
+
359
+ ### Under the Provider Pattern
360
+
361
+ `basePath` and `basePathParams` are **reactive props**. They need no stable reference, unlike `actor`, `router`, and `routeMap`, and a change moves the live bridge instead of rebuilding it:
362
+
363
+ ```tsx
364
+ function PlayRoute() {
365
+ const { machineId } = useLoaderData({ from: "/$machineId/play/$" });
366
+
367
+ return (
368
+ <PlayRouterProvider
369
+ actor={actor}
370
+ router={router}
371
+ routeMap={routeMap} // unchanged — the route map stays machine-relative
372
+ basePath="/:machineId/play"
373
+ basePathParams={{ machineId }} // the loader resolved this already
374
+ renderer={(currentActor) => <Shell actor={currentActor} registry={registry} />}
375
+ />
376
+ );
377
+ }
378
+
379
+ // The "/dashboard" of the machine is now the URL "/abc123/play/dashboard".
380
+ // The "/" of the machine is now the URL "/abc123/play".
381
+ ```
382
+
383
+ ### Under `connectRouter`
384
+
385
+ `basePath` and `basePathParams` join the options that the adapter needs already. The
386
+ vanilla DOM adapter needs `router`, as it does in the example above:
387
+
388
+ ```typescript
389
+ const disconnect = connectRouter({
390
+ actor,
391
+ router, // required: @xmachines/play-dom-router reads its history
392
+ routeMap, // unchanged — the route map stays machine-relative
393
+ basePath: "/:machineId/play",
394
+ basePathParams: { machineId }, // the loader resolved this already
395
+ });
396
+ ```
397
+
398
+ The Svelte adapters take the same two prefix options. They need no `router`:
399
+ `@xmachines/play-svelte-spa-router` reads an optional `window`, and
400
+ `@xmachines/play-sveltekit-router` reads an optional `location`.
401
+
402
+ ### What the Prefix Changes
403
+
404
+ A location **outside** the prefix belongs to the host. The bridge sends no `play.route` event there, it runs no corrective navigation there, and it writes no route of its actor there. That silence is what lets the two halves share one router: without it, the unknown-path correction would drag the user off every page the host owns, and so would any route change of the actor that no URL event caused — an `after` timer, an async guard that settles, a restore of a snapshot. The bridge remembers such a move and writes it when the location comes back under the prefix, so the machine keeps its place.
405
+
406
+ | Location of the router | `basePath = "/abc123/play"` |
407
+ | ---------------------- | ----------------------------------------------------- |
408
+ | `/abc123/play` | the `/` of the machine → `play.route` |
409
+ | `/abc123/play/about` | the `/about` of the machine → `play.route` |
410
+ | `/abc123/play/nope` | unknown inside the mount → the URL follows the actor |
411
+ | `/account/billing` | a route of the host → the bridge does nothing |
412
+ | `/abc123/playground` | another segment → the host's, the bridge does nothing |
413
+
414
+ The prefix resolves in advance, because the bridge writes a real browser URL. It rejects every shape that resolves to one concrete path never — a `*` wildcard, a `:param?`, a `$param` (the TanStack spelling; write `:param`), a query string, and a hash. A base path is a _pathname_, so a URL scheme is rejected too: write `/admin`, not `https://app.example.com/admin`. Every segment that a browser rewrites is rejected on the same rule, the resolved value of a `:param` included — a dot segment, a backslash, whitespace, and a character that a URL percent-encodes, such as the `é` of `/café` — because each one makes the prefix that comes back differ from the prefix that went out, and the machine would go silent with no error. An unresolved `:param` throws `MissingBasePathParamError` at construction, rather than falling back to "no prefix yet": a bridge with no prefix would claim the complete router and start correcting the URLs of the host.
415
+
416
+ **The machine stays authoritative over its own params (INV-01).** `event.params` carries what the pattern of the machine declares and nothing else. The params of the prefix belong to the host, so they travel in no `play.route` event, and a host param that shares a name with one of the machine can shadow it never. Read the resolved mount from the bridge instead, where it cannot go stale:
417
+
418
+ ```typescript
419
+ bridge.basePath; // "/abc123/play"
420
+ bridge.basePathParams; // { machineId: "abc123" }
421
+ ```
422
+
423
+ A machine that needs the identity of its host takes it through the actor `input`, where that identity decides **which** machine runs.
424
+
425
+ ### Several Machines Alive at Once
426
+
427
+ Several machines can be alive together, each mounted at its own prefix, all sharing one router. Every bridge hears every location change, and a location under another machine's prefix is foreign in exactly the way a route of the host is — so a `play.route` reaches the machine that owns the URL and no other, and a correction of an unknown path happens only inside the prefix that owns it.
428
+
429
+ **Each bridge can stay connected, as long as each one has its own prefix.** A bridge outside its mount keeps the silence in _both_ directions: it sends no `play.route`, it corrects no URL, and it writes no route of its actor. The machine that the location belongs to is therefore the only one that writes, and an actor that nobody is looking at cannot take the URL from the one on screen. A route that the hidden machine moved to is not lost either: the bridge remembers it, and it writes it when the host navigates back under its prefix.
430
+
431
+ **Two bridges contend when neither prefix separates their halves of the URL.** That is the case for two bridges with no prefix, for two with the same prefix, and also for two whose prefixes NEST: a mount at `/a` and a mount at `/a/b` both claim `/a/b/x`, because `/a` is a prefix of it. Give sibling prefixes — `/a/one` and `/a/two` — and no location belongs to two machines. Mount the provider for the machine the host is showing, and let the others keep their state with no bridge attached.
432
+
433
+ ### Loading and Unloading Routes
434
+
435
+ `setBasePath()` moves **where** an actor is mounted, and never **which** actor is mounted. The actor, the route map, and its LRU cache all stay:
436
+
437
+ ```typescript
438
+ // The host moved this actor from one region of its URL space to another.
439
+ bridge.setBasePath("/:region/:machineId/play", { region: "us", machineId });
440
+ ```
441
+
442
+ The call also brings the location in step. Nothing else moves the address bar, so a move to a prefix that the URL is not under writes the new mount and keeps the route of the actor: `/eu/abc123/play/about` becomes `/us/abc123/play/about`. A location that already lies under the new prefix drives the actor instead, exactly as it does on `connect()`.
443
+
444
+ An actor never changes identity, so a segment of the prefix that _identifies_ the actor never moves through this method. A new identity is a new **actor**, and a new actor takes a new bridge, because `connect()` permits one bridge for each actor. The segments that move here are the ones that _locate_: a region, a locale, a tenant, a workspace slug.
445
+
446
+ For a host router that declares real route objects, ask for the list — and drop it again when the machine unloads:
447
+
448
+ ```typescript
449
+ import { extractMachineRoutes, getRouteMappings } from "@xmachines/play-router";
450
+
451
+ const tree = extractMachineRoutes(authMachine);
452
+
453
+ // Concrete, for a route that the host adds after a loader resolved the mount
454
+ getRouteMappings(tree, { basePath: "/:machineId/play", basePathParams: { machineId } });
455
+ // [{ stateId: "home", path: "/abc123/play" },
456
+ // { stateId: "profile", path: "/abc123/play/profile/:userId" }, ...]
457
+
458
+ // The pattern, for a static route declaration of the host
459
+ getRouteMappings(tree, { basePath: "/:machineId/play" });
460
+ // [{ stateId: "home", path: "/:machineId/play" }, ...]
461
+ ```
462
+
463
+ > **Polyfill note.** Under a mount, `@xmachines/play-vue-router` and `@xmachines/play-solid-router` resolve each param from the stripped path with `URLPattern`, and not from the pre-parsed params of their framework: under a prefix the framework matched a route of the **host**, so those params describe the route of the machine never — and a collision of names carries the value of the host. Both adapters therefore need a `URLPattern` polyfill on an older runtime when they are mounted. With no prefix, both keep the parse of their framework whenever it reports at least one
464
+ > param the pattern declares, and every required one. A pattern whose params are ALL
465
+ > optional and a framework that reports none — `/settings/:section?` under a catch-all of
466
+ > the host — is settled by the PATH: `/settings` is the bare form of that pattern, so
467
+ > every optional segment is absent and the params are `{}`. A path that DOES carry a
468
+ > value, such as `/settings/security`, still reaches the extraction, because only the
469
+ > extraction reads that value.
470
+ >
471
+ > These branches decide the CALLS of a navigation, and not whether the application needs
472
+ > the polyfill. `RouteMap` compiles each parameterized route in its constructor and
473
+ > throws there without `URLPattern`, so one `:param` in the route map makes the polyfill
474
+ > a startup requirement on an older runtime.
475
+
351
476
  ## Adapter Summary
352
477
 
353
478
  | Package | Framework | Pattern | Key Import |
@@ -289,7 +289,7 @@ function App() {
289
289
 
290
290
  ## Next Steps
291
291
 
292
- - **[Multi-Router Integration](./multi-router-integration.md)** — All 8 router adapters and the two integration patterns
292
+ - **[Multi-Router Integration](./multi-router-integration.md)** — All 8 router adapters, the two integration patterns, and `basePath`
293
293
  - **[Examples Index](./README.md)** — Complete catalog of runnable demos
294
294
 
295
295
  ## Learn More
@@ -18,15 +18,15 @@ Jump to the section that applies to you:
18
18
 
19
19
  You need the following installed before cloning the repository:
20
20
 
21
- | Requirement | Version | Notes |
22
- | ----------- | ------------------ | --------------------------------------------------------------------------------------------------------------------- |
23
- | Node.js | `>= 22.0.0` | Specified in all `package.json` `engines` fields |
24
- | pnpm | via corepack | Enable with `corepack enable`; the version is pinned by the `packageManager` field. The project uses pnpm workspaces. |
25
- | Git | any recent version | Conventional commit format is enforced by CI |
21
+ | Requirement | Version | Notes |
22
+ | ----------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
23
+ | Node.js | `>= 24.0.0` | The floor to DEVELOP. The suite writes `using`, which needs V8 13.4. A published package declares `>= 22.0.0`, and the emitted JavaScript parses there. |
24
+ | pnpm | via corepack | Enable with `corepack enable`; the version is pinned by the `packageManager` field. The project uses pnpm workspaces. |
25
+ | Git | any recent version | Conventional commit format is enforced by CI |
26
26
 
27
27
  No global TypeScript install is needed — it is installed as a dev dependency via `pnpm install --frozen-lockfile`.
28
28
 
29
- > **Node.js version manager tip:** If you manage multiple Node versions with `nvm` or `fnm`, install and activate Node 22 before proceeding.
29
+ > **Node.js version manager tip:** If you manage multiple Node versions with `nvm` or `fnm`, install and activate Node 24 before proceeding.
30
30
 
31
31
  ### Installation Steps
32
32
 
@@ -68,7 +68,7 @@ All tests should pass on a freshly cloned and built repository. If they do, your
68
68
 
69
69
  ### Dev Container (Optional)
70
70
 
71
- A fully configured dev container is provided at `.devcontainer/`. It uses Docker Compose with a Node 22 Bookworm base image and includes Docker-outside-of-Docker, Claude Code, and OpenCode pre-installed.
71
+ A fully configured dev container is provided at `.devcontainer/`. It uses Docker Compose with a Node 24 Bookworm base image and includes Docker-outside-of-Docker, Claude Code, and OpenCode pre-installed.
72
72
 
73
73
  **VS Code:** Open the repository and choose **Reopen in Container** when prompted.
74
74
 
@@ -170,7 +170,7 @@ actor.start();
170
170
  <button onClick={() => inspector.show()}>Show Inspector</button>;
171
171
  ```
172
172
 
173
- The controller answers the late-opening problem from the previous section: it buffers serialized events from actor creation, pins the current root's registration so it can never roll out of the bounded buffer, and flushes the buffer when the inspector window completes its handshake. That is a demo trade-off rather than a general recommendation — every transition pays serialization whether or not anyone ever opens the inspector — but it is what makes the button work at any point in a session. The shared package's own README, at `packages/play-actor/examples/shared/README.md` in this repository, documents the design in full.
173
+ The controller answers the late-opening problem from the previous section: it buffers serialized events from actor creation, pins the registration of every live root so it can never roll out of the bounded buffer, and flushes those buffers when the inspector window completes its handshake. Several machines can be alive together — one for each document a host has open — and the handshake replays each of them. That is a demo trade-off rather than a general recommendation — every transition pays serialization whether or not anyone ever opens the inspector — but it is what makes the button work at any point in a session. The shared package's own README, at `packages/play-actor/examples/shared/README.md` in this repository, documents the design in full.
174
174
 
175
175
  ---
176
176
 
package/guides/signals.md CHANGED
@@ -109,6 +109,49 @@ Use [`watchSignal()`](../api/@xmachines/play-signals/functions/watchSignal.md) i
109
109
 
110
110
  ---
111
111
 
112
+ ## The release, and `using`
113
+
114
+ `watchSignal()` returns a `Cleanup` from [`@xmachines/play`](../api/@xmachines/play/README.md): a
115
+ function, and a `Disposable`. One value therefore serves two forms, and the same holds for
116
+ the mount of `@xmachines/play-dom` and for `history.subscribe()` of
117
+ `@xmachines/play-dom-router`.
118
+
119
+ Keep the explicit call where the release outlives the scope that made it — a field that a
120
+ teardown reads, an entry in a `Set` of releases:
121
+
122
+ ```typescript
123
+ const stop = watchSignal(actor.currentRoute, render);
124
+ onUnmount(() => stop());
125
+ ```
126
+
127
+ Write `using` where the release belongs to one scope. The scope releases it, an exception
128
+ releases it too, and the code carries no teardown:
129
+
130
+ ```typescript
131
+ {
132
+ using stop = watchSignal(actor.currentRoute, render);
133
+ render(actor.currentRoute.get());
134
+ // stop() runs here, and it runs even when render() throws
135
+ }
136
+ ```
137
+
138
+ A scope releases from the last declaration to the first, so a release that depends on an
139
+ earlier one is safe.
140
+
141
+ Every release here is synchronous, so `Cleanup` is a `Disposable` and not an
142
+ `AsyncDisposable`. That is the permissive choice: a `Disposable` serves `using` AND
143
+ `await using`, while an `AsyncDisposable` raises a TypeError under a plain `using` and
144
+ forces every holder into an async function. `asCleanup` therefore refuses a release that
145
+ returns a value, and a promise above all — a promise handed to it would go on the floor,
146
+ released and unawaitable.
147
+
148
+ `using` needs Node 24 or a browser with Explicit Resource Management. The publishable
149
+ packages build at `target: "esnext"` and pass the syntax through untouched, so your bundler
150
+ decides how to emit it. The `Cleanup` VALUE needs neither: a runtime without
151
+ `Symbol.dispose` still calls it as a plain function.
152
+
153
+ ---
154
+
112
155
  ## Why not observables (RxJS) or event emitters?
113
156
 
114
157
  The XMachines architecture chose TC39 Signals over observable libraries and event emitters for three reasons:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmachines/docs",
3
- "version": "2.1.1",
3
+ "version": "3.0.0",
4
4
  "description": "Documentation for XMachines",
5
5
  "keywords": [
6
6
  "documentation",
@@ -1,32 +0,0 @@
1
- [API](../../../README.md) / [@xmachines/play-react-router](../README.md) / PlayRouterProviderBaseProps
2
-
3
- # Interface: PlayRouterProviderBaseProps\<TRouter, TActor\>
4
-
5
- Defined in: [play-react-router/src/create-play-router-provider.tsx:34](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-react-router/src/create-play-router-provider.tsx#L34)
6
-
7
- The props that every React `PlayRouterProvider` of the factory shares.
8
-
9
- An adapter package re-exports a concrete alias, with `TRouter` bound to the type of
10
- its router instance. For example, `PlayRouterProviderProps<TActor>` in
11
- `@xmachines/play-react-router` binds `TRouter` to the return type of
12
- `createBrowserRouter`.
13
-
14
- ## Extended by
15
-
16
- - [`PlayRouterProviderProps`](PlayRouterProviderProps.md)
17
-
18
- ## Type Parameters
19
-
20
- | Type Parameter | Default type |
21
- | ---------------------------------------------- | --------------------------- |
22
- | `TRouter` | - |
23
- | `TActor` _extends_ [`PlayActor`](PlayActor.md) | [`PlayActor`](PlayActor.md) |
24
-
25
- ## Properties
26
-
27
- | Property | Type | Description | Defined in |
28
- | ----------------------------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29
- | <a id="property-actor"></a> `actor` | `TActor` | The actor to keep in step with the router. It must be a stable reference: give the same actor instance on every render. An actor in the JSX, or a new actor on each render, makes the bridge disconnect and connect again each time. | [play-react-router/src/create-play-router-provider.tsx:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-react-router/src/create-play-router-provider.tsx#L40) |
30
- | <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `ReactNode` | The renderer callback receives the same concrete actor type as the prop. | [play-react-router/src/create-play-router-provider.tsx:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-react-router/src/create-play-router-provider.tsx#L57) |
31
- | <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | The route map of both directions, for the lookup between a state ID and a URL path. **It must be a stable reference.** The provider builds the bridge again on each change of the identity of `routeMap`. A value in the JSX, for example `createRouteMapFromTree(routeTree)`, makes a new object on every render, and the bridge therefore connects again on every render. Hold the value with `useMemo`: `const routeMap = useMemo(() => createRouteMapFromTree(routeTree), [routeTree]);` | [play-react-router/src/create-play-router-provider.tsx:55](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-react-router/src/create-play-router-provider.tsx#L55) |
32
- | <a id="property-router"></a> `router` | `TRouter` | The router instance that the bridge keeps in step with the actor. It must be a stable reference. | [play-react-router/src/create-play-router-provider.tsx:42](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-react-router/src/create-play-router-provider.tsx#L42) |
@@ -1,30 +0,0 @@
1
- [API](../../../README.md) / [@xmachines/play-solid-router](../README.md) / PlayRouterProviderBaseProps
2
-
3
- # Interface: PlayRouterProviderBaseProps\<TRouter, TActor\>
4
-
5
- Defined in: [packages/play-solid-router/src/create-play-router-provider.tsx:36](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-solid-router/src/create-play-router-provider.tsx#L36)
6
-
7
- The props that every Solid `PlayRouterProvider` of the factory shares.
8
-
9
- An adapter package re-exports a concrete alias, with `TRouter` bound to the type of
10
- its router. For example, `SolidRouterHooks` in `@xmachines/play-solid-router`.
11
-
12
- ## Extended by
13
-
14
- - [`PlayRouterProviderProps`](PlayRouterProviderProps.md)
15
-
16
- ## Type Parameters
17
-
18
- | Type Parameter | Default type |
19
- | ---------------------------------------------- | --------------------------- |
20
- | `TRouter` | - |
21
- | `TActor` _extends_ [`PlayActor`](PlayActor.md) | [`PlayActor`](PlayActor.md) |
22
-
23
- ## Properties
24
-
25
- | Property | Type | Description | Defined in |
26
- | ----------------------------------------- | ------------------------------------ | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
27
- | <a id="property-actor"></a> `actor` | `TActor` | The actor to keep in step with the router. | [packages/play-solid-router/src/create-play-router-provider.tsx:38](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-solid-router/src/create-play-router-provider.tsx#L38) |
28
- | <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `any` | The renderer callback receives the same concrete actor type as the prop. | [packages/play-solid-router/src/create-play-router-provider.tsx:44](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-solid-router/src/create-play-router-provider.tsx#L44) |
29
- | <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | The route map of both directions, for the lookup between a state ID and a URL path. | [packages/play-solid-router/src/create-play-router-provider.tsx:42](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-solid-router/src/create-play-router-provider.tsx#L42) |
30
- | <a id="property-router"></a> `router` | `TRouter` | The router that the bridge keeps in step with the actor. | [packages/play-solid-router/src/create-play-router-provider.tsx:40](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-solid-router/src/create-play-router-provider.tsx#L40) |
@@ -1,32 +0,0 @@
1
- [API](../../../README.md) / [@xmachines/play-tanstack-react-router](../README.md) / PlayRouterProviderBaseProps
2
-
3
- # Interface: PlayRouterProviderBaseProps\<TRouter, TActor\>
4
-
5
- Defined in: [play-tanstack-react-router/src/create-play-router-provider.tsx:46](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-react-router/src/create-play-router-provider.tsx#L46)
6
-
7
- The props that every React `PlayRouterProvider` of the factory shares.
8
-
9
- An adapter package re-exports a concrete alias, with `TRouter` bound to the type of
10
- its router instance. For example, `PlayRouterProviderProps<TActor>` in
11
- `@xmachines/play-tanstack-react-router` binds `TRouter` to the type of the TanStack
12
- Router instance.
13
-
14
- ## Extended by
15
-
16
- - [`PlayRouterProviderProps`](PlayRouterProviderProps.md)
17
-
18
- ## Type Parameters
19
-
20
- | Type Parameter | Default type |
21
- | ---------------------------------------------- | --------------------------- |
22
- | `TRouter` | - |
23
- | `TActor` _extends_ [`PlayActor`](PlayActor.md) | [`PlayActor`](PlayActor.md) |
24
-
25
- ## Properties
26
-
27
- | Property | Type | Description | Defined in |
28
- | ----------------------------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29
- | <a id="property-actor"></a> `actor` | `TActor` | The actor to keep in step with the router. It must be a stable reference: give the same actor instance on every render. An actor in the JSX, or a new actor on each render, makes the bridge disconnect and connect again each time. | [play-tanstack-react-router/src/create-play-router-provider.tsx:52](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-react-router/src/create-play-router-provider.tsx#L52) |
30
- | <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `ReactNode` | The renderer callback receives the same concrete actor type as the prop. | [play-tanstack-react-router/src/create-play-router-provider.tsx:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-react-router/src/create-play-router-provider.tsx#L69) |
31
- | <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | The route map of both directions, for the lookup between a state ID and a URL path. **It must be a stable reference.** The provider builds the bridge again on each change of the identity of `routeMap`. A value in the JSX, for example `createRouteMapFromTree(routeTree)`, makes a new object on every render, and the bridge therefore connects again on every render. Hold the value with `useMemo`: `const routeMap = useMemo(() => createRouteMapFromTree(routeTree), [routeTree]);` | [play-tanstack-react-router/src/create-play-router-provider.tsx:67](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-react-router/src/create-play-router-provider.tsx#L67) |
32
- | <a id="property-router"></a> `router` | `TRouter` | The router instance that the bridge keeps in step with the actor. It must be a stable reference. | [play-tanstack-react-router/src/create-play-router-provider.tsx:54](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-react-router/src/create-play-router-provider.tsx#L54) |
@@ -1,31 +0,0 @@
1
- [API](../../../README.md) / [@xmachines/play-tanstack-solid-router](../README.md) / PlayRouterProviderBaseProps
2
-
3
- # Interface: PlayRouterProviderBaseProps\<TRouter, TActor\>
4
-
5
- Defined in: [play-tanstack-solid-router/src/create-play-router-provider.tsx:45](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L45)
6
-
7
- The props that every Solid `PlayRouterProvider` of the factory shares.
8
-
9
- An adapter package re-exports a concrete alias, with `TRouter` bound to the type of
10
- its router. For example, `TanStackRouterInstance` in
11
- `@xmachines/play-tanstack-solid-router`.
12
-
13
- ## Extended by
14
-
15
- - [`PlayRouterProviderProps`](PlayRouterProviderProps.md)
16
-
17
- ## Type Parameters
18
-
19
- | Type Parameter | Default type |
20
- | ---------------------------------------------- | --------------------------- |
21
- | `TRouter` | - |
22
- | `TActor` _extends_ [`PlayActor`](PlayActor.md) | [`PlayActor`](PlayActor.md) |
23
-
24
- ## Properties
25
-
26
- | Property | Type | Description | Defined in |
27
- | ----------------------------------------- | ------------------------------------ | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
28
- | <a id="property-actor"></a> `actor` | `TActor` | The actor to keep in step with the router. | [play-tanstack-solid-router/src/create-play-router-provider.tsx:47](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L47) |
29
- | <a id="property-renderer"></a> `renderer` | (`actor`, `router`) => `any` | The renderer callback receives the same concrete actor type as the prop. | [play-tanstack-solid-router/src/create-play-router-provider.tsx:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L53) |
30
- | <a id="property-routemap"></a> `routeMap` | [`RouteMap`](../classes/RouteMap.md) | The route map of both directions, for the lookup between a state ID and a URL path. | [play-tanstack-solid-router/src/create-play-router-provider.tsx:51](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L51) |
31
- | <a id="property-router"></a> `router` | `TRouter` | The router that the bridge keeps in step with the actor. | [play-tanstack-solid-router/src/create-play-router-provider.tsx:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.1.1/packages/play-tanstack-solid-router/src/create-play-router-provider.tsx#L49) |