@xmachines/docs 4.0.0 → 5.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 (483) hide show
  1. package/README.md +8 -6
  2. package/api/@xmachines/play/README.md +21 -21
  3. package/api/@xmachines/play/errors/classes/NonNullableError.md +4 -4
  4. package/api/@xmachines/play/errors/classes/PlayError.md +5 -4
  5. package/api/@xmachines/play/index/README.md +2 -2
  6. package/api/@xmachines/play/index/functions/asCleanup.md +4 -5
  7. package/api/@xmachines/play/index/functions/assertNonNullable.md +1 -1
  8. package/api/@xmachines/play/index/functions/shallowEqualExcept.md +1 -1
  9. package/api/@xmachines/play/index/type-aliases/Cleanup.md +3 -3
  10. package/api/@xmachines/play/index/type-aliases/DisposeKey.md +1 -1
  11. package/api/@xmachines/play/index/type-aliases/PlayEvent.md +2 -2
  12. package/api/@xmachines/play/index/variables/DISPOSE.md +1 -1
  13. package/api/@xmachines/play-actor/README.md +9 -9
  14. package/api/@xmachines/play-actor/interfaces/ActorEvent.md +2 -2
  15. package/api/@xmachines/play-actor/interfaces/PlayActor.md +6 -6
  16. package/api/@xmachines/play-atom/README.md +281 -0
  17. package/api/@xmachines/play-atom/functions/watchAtom.md +79 -0
  18. package/api/@xmachines/play-atom/interfaces/AsyncAtomOptions.md +16 -0
  19. package/api/@xmachines/play-atom/interfaces/Atom.md +149 -0
  20. package/api/@xmachines/play-atom/interfaces/AtomObserver.md +25 -0
  21. package/api/@xmachines/play-atom/interfaces/AtomOptions.md +33 -0
  22. package/api/@xmachines/play-atom/interfaces/AtomSubscription.md +23 -0
  23. package/api/@xmachines/play-atom/interfaces/BaseAtom.md +97 -0
  24. package/api/@xmachines/play-atom/interfaces/CreateAtom.md +91 -0
  25. package/api/@xmachines/play-atom/interfaces/Readable.md +93 -0
  26. package/api/@xmachines/play-atom/interfaces/ReadonlyAtom.md +108 -0
  27. package/api/@xmachines/play-atom/type-aliases/AnyAtom.md +13 -0
  28. package/api/@xmachines/play-atom/type-aliases/AsyncAtomState.md +32 -0
  29. package/api/@xmachines/{play-signals → play-atom}/type-aliases/Cleanup.md +4 -4
  30. package/api/@xmachines/play-atom/variables/createAsyncAtom.md +42 -0
  31. package/api/@xmachines/play-atom/variables/createAtom.md +18 -0
  32. package/api/@xmachines/play-atom/variables/createWritableAtom.md +70 -0
  33. package/api/@xmachines/play-dom/README.md +21 -17
  34. package/api/@xmachines/play-dom/classes/PlayRenderer.md +10 -10
  35. package/api/@xmachines/play-dom/functions/asCleanup.md +4 -5
  36. package/api/@xmachines/play-dom/functions/createPlayUI.md +1 -1
  37. package/api/@xmachines/play-dom/functions/createRenderer.md +1 -1
  38. package/api/@xmachines/play-dom/interfaces/CreatePlayUIOptions.md +3 -3
  39. package/api/@xmachines/play-dom/interfaces/MountOptions.md +3 -3
  40. package/api/@xmachines/play-dom/interfaces/PlayDomOptions.md +6 -6
  41. package/api/@xmachines/play-dom/type-aliases/Cleanup.md +3 -3
  42. package/api/@xmachines/play-dom/type-aliases/MountFn.md +1 -1
  43. package/api/@xmachines/play-dom-router/README.md +24 -24
  44. package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +15 -15
  45. package/api/@xmachines/play-dom-router/classes/RouteMap.md +11 -11
  46. package/api/@xmachines/play-dom-router/functions/asCleanup.md +4 -5
  47. package/api/@xmachines/play-dom-router/functions/connectRouter.md +1 -1
  48. package/api/@xmachines/play-dom-router/functions/createBrowserHistory.md +1 -1
  49. package/api/@xmachines/play-dom-router/functions/createRouter.md +1 -1
  50. package/api/@xmachines/play-dom-router/interfaces/BasePathOptions.md +3 -7
  51. package/api/@xmachines/play-dom-router/interfaces/BrowserHistory.md +15 -15
  52. package/api/@xmachines/play-dom-router/interfaces/BrowserWindow.md +14 -14
  53. package/api/@xmachines/play-dom-router/interfaces/ConnectRouterOptions.md +11 -9
  54. package/api/@xmachines/play-dom-router/interfaces/PlayRouteEvent.md +7 -7
  55. package/api/@xmachines/play-dom-router/interfaces/RoutableActor.md +6 -6
  56. package/api/@xmachines/play-dom-router/interfaces/RouteLookupContract.md +3 -3
  57. package/api/@xmachines/play-dom-router/interfaces/RouteMapOptions.md +10 -4
  58. package/api/@xmachines/play-dom-router/interfaces/RouteMapping.md +3 -3
  59. package/api/@xmachines/play-dom-router/interfaces/RouterBridge.md +15 -17
  60. package/api/@xmachines/play-dom-router/interfaces/RouterConnection.md +7 -7
  61. package/api/@xmachines/play-dom-router/interfaces/VanillaRouter.md +5 -5
  62. package/api/@xmachines/play-dom-router/type-aliases/Cleanup.md +3 -3
  63. package/api/@xmachines/play-dom-router/variables/DISPOSE.md +1 -1
  64. package/api/@xmachines/play-pattern/README.md +115 -0
  65. package/api/@xmachines/play-pattern/functions/buildPath.md +46 -0
  66. package/api/@xmachines/play-pattern/functions/createPatternCache.md +47 -0
  67. package/api/@xmachines/play-pattern/functions/getIndexKey.md +30 -0
  68. package/api/@xmachines/play-pattern/functions/isDotSegment.md +40 -0
  69. package/api/@xmachines/play-pattern/functions/parsePattern.md +28 -0
  70. package/api/@xmachines/play-pattern/interfaces/GroupPart.md +15 -0
  71. package/api/@xmachines/play-pattern/interfaces/LiteralPart.md +14 -0
  72. package/api/@xmachines/play-pattern/interfaces/ParamPart.md +21 -0
  73. package/api/@xmachines/play-pattern/interfaces/ParseOptions.md +19 -0
  74. package/api/@xmachines/play-pattern/interfaces/ParsedPattern.md +23 -0
  75. package/api/@xmachines/play-pattern/interfaces/PatternCache.md +65 -0
  76. package/api/@xmachines/play-pattern/interfaces/PatternParam.md +15 -0
  77. package/api/@xmachines/play-pattern/type-aliases/PathBuildResult.md +74 -0
  78. package/api/@xmachines/play-pattern/type-aliases/PathParams.md +15 -0
  79. package/api/@xmachines/play-pattern/type-aliases/PatternModifier.md +11 -0
  80. package/api/@xmachines/play-pattern/type-aliases/PatternPart.md +9 -0
  81. package/api/@xmachines/play-react/README.md +31 -21
  82. package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +6 -6
  83. package/api/@xmachines/play-react/functions/useActor.md +1 -1
  84. package/api/@xmachines/play-react/functions/useAtomEffect.md +103 -0
  85. package/api/@xmachines/play-react/functions/usePlayView.md +1 -1
  86. package/api/@xmachines/play-react/interfaces/ActorProviderProps.md +8 -8
  87. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +6 -6
  88. package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +4 -4
  89. package/api/@xmachines/play-react/interfaces/PlayUIProviderProps.md +8 -8
  90. package/api/@xmachines/play-react/interfaces/ViewContextValue.md +5 -5
  91. package/api/@xmachines/play-react/type-aliases/AnyPlayActor.md +1 -1
  92. package/api/@xmachines/play-react/variables/ActorProvider.md +2 -2
  93. package/api/@xmachines/play-react/variables/PlayRenderer.md +1 -1
  94. package/api/@xmachines/play-react/variables/PlayUIProvider.md +1 -1
  95. package/api/@xmachines/play-react-router/README.md +3 -3
  96. package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +15 -15
  97. package/api/@xmachines/play-react-router/classes/RouteMap.md +11 -11
  98. package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +1 -1
  99. package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +5 -5
  100. package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +7 -7
  101. package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +11 -9
  102. package/api/@xmachines/play-react-router/interfaces/RoutableActor.md +6 -6
  103. package/api/@xmachines/play-react-router/interfaces/RouteMapOptions.md +10 -4
  104. package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +3 -3
  105. package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +15 -17
  106. package/api/@xmachines/play-react-router/type-aliases/PlayRouterBridgeConstructor.md +14 -7
  107. package/api/@xmachines/play-react-router/type-aliases/PlayRouterProviderBaseProps.md +1 -1
  108. package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +1 -1
  109. package/api/@xmachines/play-router/README.md +25 -14
  110. package/api/@xmachines/play-router/errors/classes/DuplicateBridgeError.md +4 -4
  111. package/api/@xmachines/play-router/errors/classes/DuplicateRoutePathError.md +5 -5
  112. package/api/@xmachines/play-router/errors/classes/EmptyRoutePathError.md +5 -5
  113. package/api/@xmachines/play-router/errors/classes/InvalidBasePathError.md +5 -5
  114. package/api/@xmachines/play-router/errors/classes/InvalidRoutePatternError.md +5 -5
  115. package/api/@xmachines/play-router/errors/classes/InvalidStateIdError.md +5 -5
  116. package/api/@xmachines/play-router/errors/classes/MissingBasePathParamError.md +6 -6
  117. package/api/@xmachines/play-router/errors/classes/RouterSyncError.md +4 -4
  118. package/api/@xmachines/play-router/errors/classes/UnknownStateTypeError.md +6 -6
  119. package/api/@xmachines/play-router/index/README.md +10 -2
  120. package/api/@xmachines/play-router/index/classes/RouteMap.md +11 -11
  121. package/api/@xmachines/play-router/index/classes/RouterBridgeBase.md +10 -10
  122. package/api/@xmachines/play-router/index/functions/buildPlayRouteEvent.md +1 -1
  123. package/api/@xmachines/play-router/index/functions/buildRouteTree.md +1 -1
  124. package/api/@xmachines/play-router/index/functions/cleanFrameworkParams.md +1 -1
  125. package/api/@xmachines/play-router/index/functions/createPatternCache.md +47 -0
  126. package/api/@xmachines/play-router/index/functions/createRouteMapFromTree.md +5 -5
  127. package/api/@xmachines/play-router/index/functions/createRouterConnection.md +1 -1
  128. package/api/@xmachines/play-router/index/functions/detectDuplicateRoutes.md +1 -1
  129. package/api/@xmachines/play-router/index/functions/extractQuery.md +1 -1
  130. package/api/@xmachines/play-router/index/functions/extractRouteParams.md +7 -6
  131. package/api/@xmachines/play-router/index/functions/findRouteById.md +1 -1
  132. package/api/@xmachines/play-router/index/functions/findRouteByPath.md +13 -6
  133. package/api/@xmachines/play-router/index/functions/isMountableBridge.md +1 -1
  134. package/api/@xmachines/play-router/index/functions/joinBasePath.md +2 -1
  135. package/api/@xmachines/play-router/index/functions/mountKey.md +1 -1
  136. package/api/@xmachines/play-router/index/functions/normalizeBasePath.md +1 -1
  137. package/api/@xmachines/play-router/index/functions/openProviderBridge.md +3 -3
  138. package/api/@xmachines/play-router/index/functions/parsePattern.md +28 -0
  139. package/api/@xmachines/play-router/index/functions/pickOwnParams.md +1 -1
  140. package/api/@xmachines/play-router/index/functions/repointProviderBridge.md +1 -1
  141. package/api/@xmachines/play-router/index/functions/resolveBasePath.md +1 -1
  142. package/api/@xmachines/play-router/index/functions/resolveFrameworkParams.md +5 -5
  143. package/api/@xmachines/play-router/index/functions/sanitizePathname.md +9 -24
  144. package/api/@xmachines/play-router/index/functions/splitLocation.md +37 -0
  145. package/api/@xmachines/play-router/index/functions/stripBasePath.md +1 -1
  146. package/api/@xmachines/play-router/index/functions/validateRouteFormat.md +1 -1
  147. package/api/@xmachines/play-router/index/functions/validateStateExists.md +1 -1
  148. package/api/@xmachines/play-router/index/interfaces/BasePathOptions.md +4 -4
  149. package/api/@xmachines/play-router/index/interfaces/BuildPlayRouteEventOptions.md +4 -4
  150. package/api/@xmachines/play-router/index/interfaces/CompileOptions.md +35 -0
  151. package/api/@xmachines/play-router/index/interfaces/FrameworkParamsSource.md +13 -8
  152. package/api/@xmachines/play-router/index/interfaces/LocationLike.md +3 -3
  153. package/api/@xmachines/play-router/index/interfaces/MountableRouterBridge.md +9 -9
  154. package/api/@xmachines/play-router/index/interfaces/OpenProviderBridgeArgs.md +11 -9
  155. package/api/@xmachines/play-router/index/interfaces/ParseOptions.md +24 -0
  156. package/api/@xmachines/play-router/index/interfaces/ParsedPattern.md +23 -0
  157. package/api/@xmachines/play-router/index/interfaces/PatternCache.md +65 -0
  158. package/api/@xmachines/play-router/index/interfaces/PlayRouteEvent.md +7 -7
  159. package/api/@xmachines/play-router/index/interfaces/PlayRouterProviderBaseProps.md +15 -9
  160. package/api/@xmachines/play-router/index/interfaces/ResolvedBasePath.md +3 -3
  161. package/api/@xmachines/play-router/index/interfaces/ResolvedRoutePath.md +3 -3
  162. package/api/@xmachines/play-router/index/interfaces/Routable.md +5 -5
  163. package/api/@xmachines/play-router/index/interfaces/RoutableActor.md +6 -6
  164. package/api/@xmachines/play-router/index/interfaces/RouteInfo.md +8 -8
  165. package/api/@xmachines/play-router/index/interfaces/RouteMapOptions.md +10 -4
  166. package/api/@xmachines/play-router/index/interfaces/RouteMapping.md +3 -3
  167. package/api/@xmachines/play-router/index/interfaces/RouteMatch.md +3 -3
  168. package/api/@xmachines/play-router/index/interfaces/RouteNode.md +10 -10
  169. package/api/@xmachines/play-router/index/interfaces/RouteObject.md +5 -5
  170. package/api/@xmachines/play-router/index/interfaces/RouteTree.md +5 -5
  171. package/api/@xmachines/play-router/index/interfaces/RouteWatcherHandle.md +11 -11
  172. package/api/@xmachines/play-router/index/interfaces/RouterBridge.md +15 -17
  173. package/api/@xmachines/play-router/index/interfaces/RouterBridgeOptions.md +31 -0
  174. package/api/@xmachines/play-router/index/interfaces/RouterConnection.md +7 -7
  175. package/api/@xmachines/play-router/index/interfaces/SplitLocation.md +16 -0
  176. package/api/@xmachines/play-router/index/interfaces/WindowLike.md +3 -3
  177. package/api/@xmachines/play-router/index/type-aliases/PlayRouterBridgeConstructor.md +14 -7
  178. package/api/@xmachines/play-router/index/type-aliases/RouteData.md +1 -1
  179. package/api/@xmachines/play-router/index/type-aliases/RouteDataResolver.md +1 -1
  180. package/api/@xmachines/play-router/index/type-aliases/RouteMetadata.md +1 -1
  181. package/api/@xmachines/play-router/index/type-aliases/URLPatternLike.md +68 -0
  182. package/api/@xmachines/play-router/index/variables/DISPOSE.md +1 -1
  183. package/api/@xmachines/play-router/index/variables/NO_BASE_PATH.md +1 -1
  184. package/api/@xmachines/play-router/index/variables/ROOT_NODE_ID.md +1 -1
  185. package/api/@xmachines/play-router/xstate/functions/createRouteMap.md +5 -5
  186. package/api/@xmachines/play-router/xstate/functions/extractMachineRoutes.md +6 -5
  187. package/api/@xmachines/play-router/xstate/functions/getNavigableRoutes.md +1 -1
  188. package/api/@xmachines/play-router/xstate/functions/getRoutableRoutes.md +1 -1
  189. package/api/@xmachines/play-router/xstate/functions/getRouteMappings.md +1 -1
  190. package/api/@xmachines/play-router/xstate/functions/getTransitionReachableRoutes.md +1 -1
  191. package/api/@xmachines/play-router/xstate/functions/isRouteReachable.md +1 -1
  192. package/api/@xmachines/play-router/xstate/functions/machineToGraph.md +1 -1
  193. package/api/@xmachines/play-router/xstate/functions/routeExists.md +1 -1
  194. package/api/@xmachines/play-router/xstate/interfaces/MachineEdgeData.md +3 -3
  195. package/api/@xmachines/play-router/xstate/interfaces/MachineNodeData.md +5 -5
  196. package/api/@xmachines/play-router/xstate/type-aliases/MachineGraph.md +1 -1
  197. package/api/@xmachines/play-solid/README.md +9 -5
  198. package/api/@xmachines/play-solid/functions/useActor.md +1 -1
  199. package/api/@xmachines/play-solid/functions/usePlayView.md +1 -1
  200. package/api/@xmachines/play-solid/interfaces/ActorProviderProps.md +8 -8
  201. package/api/@xmachines/play-solid/interfaces/PlayUIProviderProps.md +8 -8
  202. package/api/@xmachines/play-solid/interfaces/ViewContextValue.md +5 -5
  203. package/api/@xmachines/play-solid/type-aliases/AnyPlayActor.md +1 -1
  204. package/api/@xmachines/play-solid/variables/ActorContext.md +1 -1
  205. package/api/@xmachines/play-solid/variables/ActorProvider.md +2 -2
  206. package/api/@xmachines/play-solid/variables/PlayRenderer.md +1 -1
  207. package/api/@xmachines/play-solid/variables/PlayUIProvider.md +1 -1
  208. package/api/@xmachines/play-solid-router/README.md +14 -14
  209. package/api/@xmachines/play-solid-router/classes/RouteMap.md +11 -11
  210. package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +18 -18
  211. package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +1 -1
  212. package/api/@xmachines/play-solid-router/interfaces/PlayActor.md +6 -6
  213. package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +7 -7
  214. package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +11 -9
  215. package/api/@xmachines/play-solid-router/interfaces/RoutableActor.md +6 -6
  216. package/api/@xmachines/play-solid-router/interfaces/RouteMapOptions.md +10 -4
  217. package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +3 -3
  218. package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +15 -17
  219. package/api/@xmachines/play-solid-router/type-aliases/PlayRouterBridgeConstructor.md +14 -7
  220. package/api/@xmachines/play-solid-router/type-aliases/PlayRouterProviderBaseProps.md +1 -1
  221. package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +4 -4
  222. package/api/@xmachines/play-solid-router/variables/PlayRouterProvider.md +1 -1
  223. package/api/@xmachines/play-svelte/README.md +11 -7
  224. package/api/@xmachines/play-svelte/functions/defineRegistry.md +1 -1
  225. package/api/@xmachines/play-svelte/functions/getActorContext.md +1 -1
  226. package/api/@xmachines/play-svelte/functions/getPlayViewContext.md +1 -1
  227. package/api/@xmachines/play-svelte/functions/setActorContext.md +1 -1
  228. package/api/@xmachines/play-svelte/interfaces/ActorProviderProps.md +8 -8
  229. package/api/@xmachines/play-svelte/interfaces/DefineRegistryOptions.md +4 -4
  230. package/api/@xmachines/play-svelte/interfaces/PlayUIProviderProps.md +11 -11
  231. package/api/@xmachines/play-svelte/interfaces/ViewContextValue.md +5 -5
  232. package/api/@xmachines/play-svelte/type-aliases/AnyPlayActor.md +1 -1
  233. package/api/@xmachines/play-svelte-spa-router/README.md +14 -14
  234. package/api/@xmachines/play-svelte-spa-router/classes/RouteMap.md +11 -11
  235. package/api/@xmachines/play-svelte-spa-router/classes/SvelteSpaRouterBridge.md +15 -15
  236. package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +1 -1
  237. package/api/@xmachines/play-svelte-spa-router/interfaces/BasePathOptions.md +3 -7
  238. package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +11 -9
  239. package/api/@xmachines/play-svelte-spa-router/interfaces/PlayRouteEvent.md +7 -7
  240. package/api/@xmachines/play-svelte-spa-router/interfaces/RoutableActor.md +6 -6
  241. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapOptions.md +10 -4
  242. package/api/@xmachines/play-svelte-spa-router/interfaces/RouteMapping.md +3 -3
  243. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterBridge.md +15 -17
  244. package/api/@xmachines/play-svelte-spa-router/interfaces/RouterConnection.md +7 -7
  245. package/api/@xmachines/play-svelte-spa-router/interfaces/WindowLike.md +3 -3
  246. package/api/@xmachines/play-sveltekit-router/README.md +17 -17
  247. package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +11 -11
  248. package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +15 -15
  249. package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +1 -1
  250. package/api/@xmachines/play-sveltekit-router/interfaces/BasePathOptions.md +3 -7
  251. package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +15 -23
  252. package/api/@xmachines/play-sveltekit-router/interfaces/LocationLike.md +3 -3
  253. package/api/@xmachines/play-sveltekit-router/interfaces/PlayRouteEvent.md +7 -7
  254. package/api/@xmachines/play-sveltekit-router/interfaces/RoutableActor.md +6 -6
  255. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapOptions.md +10 -4
  256. package/api/@xmachines/play-sveltekit-router/interfaces/RouteMapping.md +3 -3
  257. package/api/@xmachines/play-sveltekit-router/interfaces/RouterBridge.md +15 -17
  258. package/api/@xmachines/play-sveltekit-router/interfaces/RouterConnection.md +7 -7
  259. package/api/@xmachines/play-tanstack-react-router/README.md +7 -7
  260. package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +11 -11
  261. package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +11 -11
  262. package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +1 -1
  263. package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +5 -5
  264. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +7 -7
  265. package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +11 -9
  266. package/api/@xmachines/play-tanstack-react-router/interfaces/RoutableActor.md +6 -6
  267. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapOptions.md +10 -4
  268. package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +3 -3
  269. package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +15 -17
  270. package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterBridgeConstructor.md +14 -7
  271. package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterProviderBaseProps.md +1 -1
  272. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +1 -1
  273. package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +5 -5
  274. package/api/@xmachines/play-tanstack-react-router/variables/PlayRouterProvider.md +1 -1
  275. package/api/@xmachines/play-tanstack-router/README.md +1 -1
  276. package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +16 -16
  277. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouteMapLike.md +3 -3
  278. package/api/@xmachines/play-tanstack-router/type-aliases/TanStackRouterLike.md +5 -5
  279. package/api/@xmachines/play-tanstack-solid-router/README.md +7 -7
  280. package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +11 -11
  281. package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +11 -11
  282. package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +1 -1
  283. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +7 -7
  284. package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +11 -9
  285. package/api/@xmachines/play-tanstack-solid-router/interfaces/RoutableActor.md +6 -6
  286. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapOptions.md +10 -4
  287. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +3 -3
  288. package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +15 -17
  289. package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterBridgeConstructor.md +14 -7
  290. package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterProviderBaseProps.md +1 -1
  291. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +1 -1
  292. package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +5 -5
  293. package/api/@xmachines/play-tanstack-solid-router/variables/PlayRouterProvider.md +1 -1
  294. package/api/@xmachines/play-url/README.md +21 -15
  295. package/api/@xmachines/play-url/errors/classes/InvalidBasePathError.md +5 -5
  296. package/api/@xmachines/play-url/errors/classes/InvalidRoutePatternError.md +5 -5
  297. package/api/@xmachines/play-url/errors/classes/MissingBasePathParamError.md +6 -6
  298. package/api/@xmachines/play-url/index/README.md +15 -8
  299. package/api/@xmachines/play-url/index/functions/buildPath.md +46 -0
  300. package/api/@xmachines/play-url/index/functions/cleanFrameworkParams.md +1 -1
  301. package/api/@xmachines/play-url/index/functions/createPatternCache.md +47 -0
  302. package/api/@xmachines/play-url/index/functions/getCandidates.md +1 -1
  303. package/api/@xmachines/play-url/index/functions/getCompiledPattern.md +8 -7
  304. package/api/@xmachines/play-url/index/functions/getIndexKey.md +1 -1
  305. package/api/@xmachines/play-url/index/functions/holdsUnsubstitutedParam.md +2 -2
  306. package/api/@xmachines/play-url/index/functions/isDotSegment.md +40 -0
  307. package/api/@xmachines/play-url/index/functions/joinBasePath.md +2 -1
  308. package/api/@xmachines/play-url/index/functions/normalizeBasePath.md +1 -1
  309. package/api/@xmachines/play-url/index/functions/parsePattern.md +6 -5
  310. package/api/@xmachines/play-url/index/functions/pickOwnParams.md +1 -1
  311. package/api/@xmachines/play-url/index/functions/resolveBasePath.md +1 -1
  312. package/api/@xmachines/play-url/index/functions/resolveFrameworkParams.md +5 -5
  313. package/api/@xmachines/play-url/index/functions/sanitizePathname.md +27 -0
  314. package/api/@xmachines/play-url/index/functions/splitLocation.md +37 -0
  315. package/api/@xmachines/play-url/index/functions/stripBasePath.md +1 -1
  316. package/api/@xmachines/play-url/index/interfaces/BasePathOptions.md +3 -3
  317. package/api/@xmachines/play-url/index/interfaces/CompileOptions.md +21 -0
  318. package/api/@xmachines/play-url/index/interfaces/FrameworkParamsSource.md +13 -8
  319. package/api/@xmachines/play-url/index/interfaces/GroupPart.md +6 -6
  320. package/api/@xmachines/play-url/index/interfaces/LiteralPart.md +5 -5
  321. package/api/@xmachines/play-url/index/interfaces/ParamPart.md +9 -9
  322. package/api/@xmachines/play-url/index/interfaces/ParseOptions.md +24 -0
  323. package/api/@xmachines/play-url/index/interfaces/ParsedPattern.md +14 -14
  324. package/api/@xmachines/play-url/index/interfaces/PatternCache.md +65 -0
  325. package/api/@xmachines/play-url/index/interfaces/PatternParam.md +6 -6
  326. package/api/@xmachines/play-url/index/interfaces/ResolvedBasePath.md +3 -3
  327. package/api/@xmachines/play-url/index/interfaces/SplitLocation.md +16 -0
  328. package/api/@xmachines/play-url/index/type-aliases/PathBuildResult.md +74 -0
  329. package/api/@xmachines/play-url/index/type-aliases/PathParams.md +15 -0
  330. package/api/@xmachines/play-url/index/type-aliases/PatternModifier.md +1 -1
  331. package/api/@xmachines/play-url/index/type-aliases/PatternPart.md +1 -1
  332. package/api/@xmachines/play-url/index/type-aliases/URLPatternCtor.md +1 -1
  333. package/api/@xmachines/play-url/index/type-aliases/URLPatternLike.md +3 -3
  334. package/api/@xmachines/play-url/index/variables/NO_BASE_PATH.md +1 -1
  335. package/api/@xmachines/play-url/index/variables/URLPattern.md +1 -1
  336. package/api/@xmachines/play-view/README.md +19 -8
  337. package/api/@xmachines/play-view/errors/classes/ReadOnlyContextError.md +5 -5
  338. package/api/@xmachines/play-view/index/functions/attachRenderErrorHandler.md +1 -1
  339. package/api/@xmachines/play-view/index/functions/composePlayState.md +1 -1
  340. package/api/@xmachines/play-view/index/functions/createFailureLatch.md +1 -1
  341. package/api/@xmachines/play-view/index/functions/createReportGuard.md +1 -1
  342. package/api/@xmachines/play-view/index/functions/createViewStoreLifecycle.md +1 -1
  343. package/api/@xmachines/play-view/index/functions/guardContextWrites.md +4 -28
  344. package/api/@xmachines/play-view/index/functions/refreshContextSubtree.md +1 -1
  345. package/api/@xmachines/play-view/index/functions/reuseComposedState.md +1 -1
  346. package/api/@xmachines/play-view/index/functions/sameViewInputs.md +1 -1
  347. package/api/@xmachines/play-view/index/functions/toAtomState.md +1 -1
  348. package/api/@xmachines/play-view/index/functions/typedSpec.md +1 -1
  349. package/api/@xmachines/play-view/index/interfaces/BaseActorProviderProps.md +5 -5
  350. package/api/@xmachines/play-view/index/interfaces/BaseViewContextValue.md +5 -5
  351. package/api/@xmachines/play-view/index/interfaces/FailureLatch.md +3 -3
  352. package/api/@xmachines/play-view/index/interfaces/PlaySpec.md +2 -2
  353. package/api/@xmachines/play-view/index/interfaces/ReportGuard.md +5 -5
  354. package/api/@xmachines/play-view/index/interfaces/ReportGuardMessages.md +3 -3
  355. package/api/@xmachines/play-view/index/interfaces/ResolveViewStoreOptions.md +2 -2
  356. package/api/@xmachines/play-view/index/interfaces/ViewInputs.md +4 -4
  357. package/api/@xmachines/play-view/index/interfaces/ViewStoreLifecycle.md +3 -3
  358. package/api/@xmachines/play-view/index/interfaces/ViewStoreResolution.md +4 -4
  359. package/api/@xmachines/play-view/index/interfaces/Viewable.md +5 -5
  360. package/api/@xmachines/play-view/index/type-aliases/ViewActor.md +1 -1
  361. package/api/@xmachines/play-view/index/variables/CONTEXT_STATE_KEY.md +1 -1
  362. package/api/@xmachines/play-vue/README.md +13 -9
  363. package/api/@xmachines/play-vue/functions/defineRegistry.md +1 -1
  364. package/api/@xmachines/play-vue/functions/useActor.md +1 -1
  365. package/api/@xmachines/play-vue/functions/usePlayView.md +1 -1
  366. package/api/@xmachines/play-vue/interfaces/ActorProviderProps.md +6 -6
  367. package/api/@xmachines/play-vue/interfaces/PlayUIProviderProps.md +9 -9
  368. package/api/@xmachines/play-vue/interfaces/ViewContextValue.md +5 -5
  369. package/api/@xmachines/play-vue/type-aliases/AnyPlayActor.md +1 -1
  370. package/api/@xmachines/play-vue/type-aliases/ComponentEntry.md +1 -1
  371. package/api/@xmachines/play-vue/type-aliases/ComponentsMap.md +1 -1
  372. package/api/@xmachines/play-vue/type-aliases/DefineRegistryOptions.md +2 -2
  373. package/api/@xmachines/play-vue/variables/PlayRenderer.md +1 -1
  374. package/api/@xmachines/play-vue-router/README.md +12 -11
  375. package/api/@xmachines/play-vue-router/errors/classes/VueRouterNavigationError.md +4 -4
  376. package/api/@xmachines/play-vue-router/errors/classes/VueRouterSendError.md +4 -4
  377. package/api/@xmachines/play-vue-router/index/classes/RouteMap.md +11 -11
  378. package/api/@xmachines/play-vue-router/index/classes/VueRouterBridge.md +15 -15
  379. package/api/@xmachines/play-vue-router/index/interfaces/PlayRouteEvent.md +7 -7
  380. package/api/@xmachines/play-vue-router/index/interfaces/RoutableActor.md +6 -6
  381. package/api/@xmachines/play-vue-router/index/interfaces/RouteMapOptions.md +10 -4
  382. package/api/@xmachines/play-vue-router/index/interfaces/RouteMapping.md +3 -3
  383. package/api/@xmachines/play-vue-router/index/interfaces/RouterBridge.md +15 -17
  384. package/api/@xmachines/play-vue-router/index/variables/PlayRouterProvider.md +23 -1
  385. package/api/@xmachines/play-xstate/README.md +61 -30
  386. package/api/@xmachines/play-xstate/errors/README.md +1 -0
  387. package/api/@xmachines/play-xstate/errors/classes/ActorThrewNonErrorError.md +4 -4
  388. package/api/@xmachines/play-xstate/errors/classes/InvalidEventError.md +5 -5
  389. package/api/@xmachines/play-xstate/errors/classes/InvalidMachineError.md +4 -4
  390. package/api/@xmachines/play-xstate/errors/classes/InvalidRouteHandlerError.md +5 -5
  391. package/api/@xmachines/play-xstate/errors/classes/InvalidRouteMetadataError.md +5 -5
  392. package/api/@xmachines/play-xstate/errors/classes/InvalidRouteParamError.md +207 -0
  393. package/api/@xmachines/play-xstate/errors/classes/MissingRouteParamError.md +6 -6
  394. package/api/@xmachines/play-xstate/errors/classes/MissingStateIdError.md +6 -6
  395. package/api/@xmachines/play-xstate/index/README.md +2 -2
  396. package/api/@xmachines/play-xstate/index/classes/PlayerActor.md +41 -42
  397. package/api/@xmachines/play-xstate/index/functions/compose.md +4 -4
  398. package/api/@xmachines/play-xstate/index/functions/definePlayer.md +2 -2
  399. package/api/@xmachines/play-xstate/index/interfaces/PlayerConfig.md +4 -4
  400. package/api/@xmachines/play-xstate/index/interfaces/PlayerFactoryResumeOptions.md +2 -2
  401. package/api/@xmachines/play-xstate/index/interfaces/PlayerOptions.md +9 -9
  402. package/api/@xmachines/play-xstate/index/type-aliases/Capability.md +1 -1
  403. package/api/@xmachines/play-xstate/index/type-aliases/PlayerConstructor.md +1 -1
  404. package/api/@xmachines/play-xstate/index/type-aliases/PlayerFactory.md +1 -1
  405. package/api/@xmachines/play-xstate/index/variables/DISPOSE.md +1 -1
  406. package/api/@xmachines/play-xstate/with-routing/functions/buildRouteUrl.md +13 -6
  407. package/api/@xmachines/play-xstate/with-routing/functions/deriveRoute.md +1 -1
  408. package/api/@xmachines/play-xstate/with-routing/functions/formatPlayRouteTransitions.md +1 -1
  409. package/api/@xmachines/play-xstate/with-routing/functions/isAbsoluteRoute.md +1 -1
  410. package/api/@xmachines/play-xstate/with-routing/functions/withRouting.md +1 -1
  411. package/api/@xmachines/play-xstate/with-routing/interfaces/RouteContext.md +5 -5
  412. package/api/@xmachines/play-xstate/with-routing/interfaces/RouteObject.md +5 -5
  413. package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteData.md +1 -1
  414. package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteDataResolver.md +1 -1
  415. package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteMachineConfig.md +4 -4
  416. package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteMetadata.md +1 -1
  417. package/api/@xmachines/play-xstate/with-routing/type-aliases/RouteStateNode.md +5 -5
  418. package/api/@xmachines/play-xstate/with-view/functions/withView.md +6 -5
  419. package/api/@xmachines/shared/vite-aliases/functions/xmAliases.md +1 -1
  420. package/api/@xmachines/shared/vite-aliases/functions/xmCacheDir.md +1 -1
  421. package/api/@xmachines/shared/vite-aliases/functions/xmOptimizeDeps.md +1 -1
  422. package/api/@xmachines/shared/vite-aliases/functions/xmResolve.md +1 -1
  423. package/api/@xmachines/shared/vite-aliases/functions/xmSvelteRunes.md +2 -2
  424. package/api/@xmachines/shared/vitest/functions/defineXmBrowserConfig.md +1 -1
  425. package/api/@xmachines/shared/vitest/functions/defineXmVitestConfig.md +1 -1
  426. package/api/@xmachines/shared/vitest/interfaces/XmBrowserConfigOptions.md +4 -4
  427. package/api/README.md +2 -1
  428. package/api/llms.txt +4 -3
  429. package/contributing/architecture.md +105 -124
  430. package/contributing/configuration.md +15 -15
  431. package/contributing/deployment.md +82 -6
  432. package/contributing/development.md +58 -30
  433. package/contributing/migrating-to-play-atom.md +209 -0
  434. package/contributing/testing.md +61 -64
  435. package/examples/README.md +3 -3
  436. package/examples/basic-state-machine.md +4 -4
  437. package/examples/form-validation.md +1 -1
  438. package/examples/multi-router-integration.md +23 -23
  439. package/examples/routing-patterns.md +5 -5
  440. package/examples/traffic-light.md +6 -6
  441. package/guides/README.md +1 -1
  442. package/guides/actor-model.md +26 -17
  443. package/guides/atoms.md +264 -0
  444. package/guides/getting-started.md +52 -17
  445. package/guides/inspector.md +3 -3
  446. package/guides/routing.md +67 -47
  447. package/guides/state-machines.md +4 -4
  448. package/package.json +3 -3
  449. package/rfc/play.md +83 -52
  450. package/api/@xmachines/play-react/functions/useSignalEffect.md +0 -77
  451. package/api/@xmachines/play-router/index/functions/getPatternParamNames.md +0 -29
  452. package/api/@xmachines/play-router/index/functions/getRequiredPatternParamNames.md +0 -39
  453. package/api/@xmachines/play-signals/README.md +0 -209
  454. package/api/@xmachines/play-signals/functions/watchSignal.md +0 -65
  455. package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +0 -36
  456. package/api/@xmachines/play-signals/interfaces/SignalComputed.md +0 -49
  457. package/api/@xmachines/play-signals/interfaces/SignalOptions.md +0 -37
  458. package/api/@xmachines/play-signals/interfaces/SignalState.md +0 -68
  459. package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +0 -97
  460. package/api/@xmachines/play-signals/namespaces/Signal/README.md +0 -22
  461. package/api/@xmachines/play-signals/namespaces/Signal/classes/Computed.md +0 -52
  462. package/api/@xmachines/play-signals/namespaces/Signal/classes/State.md +0 -72
  463. package/api/@xmachines/play-signals/namespaces/Signal/interfaces/Options.md +0 -19
  464. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/README.md +0 -21
  465. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md +0 -85
  466. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/currentComputed.md +0 -13
  467. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSinks.md +0 -19
  468. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSources.md +0 -19
  469. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSinks.md +0 -19
  470. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSources.md +0 -19
  471. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/untrack.md +0 -25
  472. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/unwatched.md +0 -9
  473. package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/watched.md +0 -9
  474. package/api/@xmachines/play-signals/namespaces/Signal/variables/isComputed.md +0 -19
  475. package/api/@xmachines/play-signals/namespaces/Signal/variables/isState.md +0 -19
  476. package/api/@xmachines/play-signals/namespaces/Signal/variables/isWatcher.md +0 -19
  477. package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +0 -33
  478. package/api/@xmachines/play-url/index/functions/getNormalizedParamNameMap.md +0 -32
  479. package/api/@xmachines/play-url/index/functions/getPatternParamNames.md +0 -29
  480. package/api/@xmachines/play-url/index/functions/getRequiredPatternParamNames.md +0 -39
  481. package/api/@xmachines/play-url/index/functions/isParameterizedPattern.md +0 -36
  482. package/api/@xmachines/play-url/index/functions/normalizeParamNames.md +0 -36
  483. package/guides/signals.md +0 -209
@@ -58,7 +58,7 @@ The root TypeScript config is a **build coordinator only** — it compiles nothi
58
58
  { "path": "./packages/play" },
59
59
  { "path": "./packages/shared" },
60
60
  // Layer 1 — depends on Layer 0
61
- { "path": "./packages/play-signals" },
61
+ { "path": "./packages/play-atom" },
62
62
  // Layer 2
63
63
  { "path": "./packages/play-actor" },
64
64
  // Layer 3
@@ -75,7 +75,7 @@ Every package must be listed here and must have `composite: true` in its own `ts
75
75
  ### TypeScript — Shared Base Config (`@xmachines/shared/tsconfig`)
76
76
 
77
77
  **Location:** `packages/shared/config/tsconfig.json`
78
- **Exported as:** `@xmachines/shared/tsconfig`
78
+ **Exported as:** [`@xmachines/shared/tsconfig`](../api/@xmachines/shared/README.md)
79
79
 
80
80
  All packages extend this base. Key compiler settings:
81
81
 
@@ -139,7 +139,7 @@ declared floor is the floor the bundle runs on.
139
139
 
140
140
  A package declares no `references`. Its dependencies live in `package.json`, and the root array orders the build.
141
141
 
142
- **Test tsconfig (`@xmachines/shared/tsconfig-test`):**
142
+ **Test tsconfig ([`@xmachines/shared/tsconfig-test`](../api/@xmachines/shared/README.md)):**
143
143
 
144
144
  **Location:** `packages/shared/config/tsconfig.test.json`
145
145
 
@@ -151,7 +151,7 @@ Test builds add `noEmit: true`, `allowImportingTsExtensions: true`, and `vitest/
151
151
  **Tool:** [oxlint](https://oxc.rs/docs/guide/usage/linter) `^1.62.0`
152
152
  **Run:** `pnpm run lint` / `pnpm run lint:fix`
153
153
 
154
- The root config extends the shared base (`@xmachines/shared/oxlint`) and adds workspace-level ignore patterns:
154
+ The root config extends the shared base ([`@xmachines/shared/oxlint`](../api/@xmachines/shared/README.md)) and adds workspace-level ignore patterns:
155
155
 
156
156
  ```typescript
157
157
  // /oxlint.config.ts
@@ -358,7 +358,7 @@ Run with `pnpm run test:browser`. Uses Playwright Chromium via Vitest browser mo
358
358
  ### Per-Package Vitest Config — `@xmachines/shared/vitest`
359
359
 
360
360
  **Location:** `packages/shared/config/vitest.ts`
361
- **Exported as:** `@xmachines/shared/vitest`
361
+ **Exported as:** [`@xmachines/shared/vitest`](../api/@xmachines/shared/README.md)
362
362
 
363
363
  Packages use `defineXmVitestConfig(import.meta.url, overrides)` to create their config. It automatically injects:
364
364
 
@@ -383,7 +383,7 @@ export default defineXmVitestConfig(import.meta.url, {
383
383
  ### Vite Source Aliases — `@xmachines/shared/vite-aliases`
384
384
 
385
385
  **Location:** `packages/shared/config/vite-aliases.ts`
386
- **Exported as:** `@xmachines/shared/vite-aliases`
386
+ **Exported as:** [`@xmachines/shared/vite-aliases`](../api/@xmachines/shared/README.md)
387
387
 
388
388
  Provides two helpers used in all `vitest.config.ts` and `vite.config.ts` files:
389
389
 
@@ -444,15 +444,15 @@ The only environment-specific distinction is between **local development** (dev
444
444
 
445
445
  ## Required vs Optional Settings Summary
446
446
 
447
- | Config | Required to Work | Optional / Has Default |
448
- | ------------------------------------ | --------------------------------------- | ----------------------------- |
449
- | `SEMREL_SKIP_STEPS` | No | Default: `""` (run all steps) |
450
- | Root `tsconfig.json` `references` | Yes — the whole build order | — |
451
- | Per-package `references` | No — TypeScript drops them on `extends` | — |
452
- | Per-package `composite: true` | Yes — required for project references | — |
453
- | `@xmachines/shared/tsconfig` extends | Yes — all packages must extend it | — |
454
- | `@xmachines/shared/oxlint` extends | Yes — all packages must extend it | — |
455
- | `@xmachines/shared/oxfmt` extends | Yes — all packages must extend it | — |
447
+ | Config | Required to Work | Optional / Has Default |
448
+ | -------------------------------------------------------------------------- | --------------------------------------- | ----------------------------- |
449
+ | `SEMREL_SKIP_STEPS` | No | Default: `""` (run all steps) |
450
+ | Root `tsconfig.json` `references` | Yes — the whole build order | — |
451
+ | Per-package `references` | No — TypeScript drops them on `extends` | — |
452
+ | Per-package `composite: true` | Yes — required for project references | — |
453
+ | [`@xmachines/shared/tsconfig`](../api/@xmachines/shared/README.md) extends | Yes — all packages must extend it | — |
454
+ | [`@xmachines/shared/oxlint`](../api/@xmachines/shared/README.md) extends | Yes — all packages must extend it | — |
455
+ | [`@xmachines/shared/oxfmt`](../api/@xmachines/shared/README.md) extends | Yes — all packages must extend it | — |
456
456
 
457
457
  ---
458
458
 
@@ -27,7 +27,7 @@ The following packages are published on every release (derived from the workspac
27
27
  | [`@xmachines/shared`](../api/@xmachines/shared/README.md) | `packages/shared` |
28
28
  | [`@xmachines/play`](../api/@xmachines/play/README.md) | `packages/play` |
29
29
  | [`@xmachines/play-actor`](../api/@xmachines/play-actor/README.md) | `packages/play-actor` |
30
- | [`@xmachines/play-signals`](../api/@xmachines/play-signals/README.md) | `packages/play-signals` |
30
+ | [`@xmachines/play-atom`](../api/@xmachines/play-atom/README.md) | `packages/play-atom` |
31
31
  | [`@xmachines/play-router`](../api/@xmachines/play-router/README.md) | `packages/play-router` |
32
32
  | [`@xmachines/play-dom`](../api/@xmachines/play-dom/README.md) | `packages/play-dom` |
33
33
  | [`@xmachines/play-dom-router`](../api/@xmachines/play-dom-router/README.md) | `packages/play-dom-router` |
@@ -70,20 +70,31 @@ The pipeline includes two reusable CI components, both pinned in `.gitlab-ci.yml
70
70
  - **`to-be-continuous/node/gitlab-ci-node`** — handles install, lint, build, test, and audit
71
71
  - **`to-be-continuous/semantic-release/gitlab-ci-semrel`** — runs `semantic-release` on eligible branches
72
72
 
73
- The `node-build` job runs with:
73
+ The `node-build` job runs one command:
74
74
 
75
75
  ```bash
76
76
  pnpm run build # vite build (JavaScript) && tsc --build (declarations)
77
- pnpm run test:coverage # vitest run --coverage (with JUnit + Cobertura reporters)
78
77
  ```
79
78
 
80
- Coverage is extracted from the `node-build` job via the regex:
79
+ It runs no test. The `test` job owns the unit suite, so `node-build` skips its own with `NODE_TEST_ARGS`. It also builds no documentation: the `docs` job below does that.
80
+
81
+ Coverage comes from the `test` job, through the regex:
81
82
 
82
83
  ```
83
84
  /All files[^|]*\|[^|]*\s+([\d\.]+)/
84
85
  ```
85
86
 
86
- JUnit results are published as `reports/junit.xml` and Cobertura coverage as `reports/coverage/cobertura-coverage.xml`.
87
+ That job publishes the JUnit results as `reports/test-results.xml` and the Cobertura coverage as `reports/cobertura-coverage.xml`. `vitest.config.ts` names both paths, and `COVERAGE_REPORTS_DIR` points them at `reports/`.
88
+
89
+ ### Docs Job
90
+
91
+ The `docs` job runs `pnpm run docs` — the full build, then TypeDoc, then the formatter. It runs automatically on `main` and it waits for a click on a merge request. It declares `needs: []`, because it compiles what it documents.
92
+
93
+ TypeDoc treats a warning as an error. This job is therefore the gate that reports a `@see` or a `{@link}` that names a symbol a rename removed. Before it existed, `node-build` regenerated the reference on every push, which put a second pass over every package on a branch that is pushed to many times.
94
+
95
+ The click is a gate, not an option. The job is manual with `allow_failure: false`, so a pipeline that nobody starts it from stays BLOCKED, and the merge check "Pipelines must succeed" holds the merge request. The `release-pack-smoke` job below uses the same rules for the same reason.
96
+
97
+ The job declares `stage: test`. A blocking manual job holds every later stage until it runs, so `build` would keep the unit suite, the browser suite and `release-pack-smoke` waiting for a click. Jobs in the same stage are not affected.
87
98
 
88
99
  ### Release Job Detail
89
100
 
@@ -274,6 +285,71 @@ There is no automated rollback mechanism. To revert a release:
274
285
 
275
286
  ---
276
287
 
288
+ ## Bootstrapping a New Package
289
+
290
+ A package that this workspace publishes for the FIRST time needs one manual publish before
291
+ the release, and it is the one publish that a human runs.
292
+
293
+ The release authenticates to npm through OIDC and carries no static token. npm configures
294
+ a trusted publisher on a package that EXISTS already, and a package exists after its first
295
+ version. A name that npm has never seen therefore takes no publisher, and the release fails
296
+ on that package alone: it publishes the rest, it creates the tag, and it leaves the new
297
+ package missing — the state that [Recovering a Failed Release](#recovering-a-failed-release)
298
+ describes.
299
+
300
+ Run this from the repository root, when the release is NEAR:
301
+
302
+ ```bash
303
+ # Rehearse it first. It writes a tarball and publishes nothing.
304
+ node scripts/bootstrap-npm-package.mjs --dry-run play-pattern play-atom
305
+
306
+ node scripts/bootstrap-npm-package.mjs play-pattern play-atom
307
+ ```
308
+
309
+ The script reads the real manifest of each package and publishes ONE version,
310
+ `0.0.0-bootstrap.0`, that holds the name, the metadata that npm shows, and a README that
311
+ says why the version carries no code. The version carries a prerelease identifier, so a
312
+ RANGE of a consumer selects it never. npm asks the maintainer for a one-time password, and
313
+ the script gives npm the terminal to ask on. Pass a code without a terminal through the
314
+ environment: `npm_config_otp=<code> node scripts/bootstrap-npm-package.mjs <package>`.
315
+
316
+ > **The bootstrap version takes the `latest` dist-tag.** A package takes its `latest` from
317
+ > its FIRST version, whatever `--tag` says, because npm keeps no package without one. The
318
+ > script asks for the `bootstrap` tag and npm sets both, so `npm install @xmachines/<name>`
319
+ > gives the empty version until the real release replaces the tag. This is the second
320
+ > reason to bootstrap a name when the release is NEAR.
321
+
322
+ The registry also answers for the new package about three minutes after the publish, so a
323
+ read that says "Not found" right after a publish that reported success is that delay.
324
+
325
+ Then, for EACH package:
326
+
327
+ 1. Open `https://www.npmjs.com/package/<name>/access` and add a trusted publisher:
328
+
329
+ | Field | Value |
330
+ | ------------- | ---------------- |
331
+ | Namespace | `xmachin-es` |
332
+ | Project | `xmachines-js` |
333
+ | Pipeline file | `.gitlab-ci.yml` |
334
+ | Environment | none |
335
+
336
+ The publish job declares no environment, so leaving that field set refuses the token.
337
+
338
+ 2. Cut the release, which publishes the real version through OIDC.
339
+
340
+ 3. Unpublish the bootstrap version:
341
+
342
+ ```bash
343
+ npm unpublish @xmachines/<name>@0.0.0-bootstrap.0
344
+ ```
345
+
346
+ > **npm accepts an unpublish for 72 HOURS after the publish.** Bootstrap a name when the
347
+ > release is near, and not weeks before it, or the empty version stays on the registry for
348
+ > ever. [`@xmachines/play-url`](../api/@xmachines/play-url/README.md) and [`@xmachines/play-view`](../api/@xmachines/play-view/README.md) were bootstrapped this way for
349
+ > 4.0.0, and each one carries the release version alone today.
350
+
351
+ ---
352
+
277
353
  ## Recovering a Failed Release
278
354
 
279
355
  If the job dies partway (e.g. one package's trusted publisher isn't set up), some packages are published, the git tag is created, and the rest are missing. To finish the release:
@@ -319,7 +395,7 @@ pnpm --filter @xmachines/play run build
319
395
  pnpm --filter @xmachines/play pack
320
396
  ```
321
397
 
322
- **Do not run `npm publish` manually.** All publishing must go through semantic-release in CI to keep `CHANGELOG.md`, git tags, and npm versions in sync.
398
+ **Do not run `npm publish` manually.** All publishing must go through semantic-release in CI to keep `CHANGELOG.md`, git tags, and npm versions in sync. [Bootstrapping a New Package](#bootstrapping-a-new-package) is the ONE exception, and it publishes a version that holds no code.
323
399
 
324
400
  ---
325
401
 
@@ -11,6 +11,7 @@ This guide covers everything you need to set up a local development environment,
11
11
  - [TypeScript Composite Build System](#typescript-composite-build-system)
12
12
  - [Code Style](#code-style)
13
13
  - [Writing Style](#writing-style-asd-ste100)
14
+ - [Link a Package That You Name](#link-a-package-that-you-name)
14
15
  - [Branch Conventions](#branch-conventions)
15
16
  - [PR Process](#pr-process)
16
17
 
@@ -82,8 +83,9 @@ The repository is organized as a **pnpm workspaces** monorepo with all packages
82
83
  packages/
83
84
  ├── shared/ # Shared configs (tsconfig, oxlint, oxfmt, vitest)
84
85
  ├── play/ # Core protocol (PlayEvent, PlayError)
85
- ├── play-signals/ # TC39 Signals polyfill wrapper
86
- ├── play-url/ # The URL language: the grammar, a base path, framework params
86
+ ├── play-atom/ # The atom primitives over @xstate/store
87
+ ├── play-pattern/ # The route pattern language: one parse, and the path it builds back
88
+ ├── play-url/ # The URL layer: the URLPattern API, a base path, framework params
87
89
  ├── play-actor/ # The actor contract (PlayActor). It names no engine
88
90
  ├── play-view/ # The shared view half (Viewable, PlaySpec, the view store lifecycle)
89
91
  ├── play-xstate/ # XState v5 adapter (definePlayer, PlayerActor)
@@ -185,17 +187,17 @@ React 18 and vue-router 4 are supported by intent — nothing known depends on 1
185
187
 
186
188
  ### The packages that must exist one time
187
189
 
188
- `@xmachines/play` and `@xmachines/play-signals` are a peer of every package that reads them, and a dependency of none.
190
+ [`@xmachines/play`](../api/@xmachines/play/README.md) and [`@xmachines/play-atom`](../api/@xmachines/play-atom/README.md) are a peer of every package that reads them, and a dependency of none.
189
191
 
190
- `@xmachines/play-signals` wraps `signal-polyfill`, and the polyfill holds its dependency graph in the state of its own module. Two copies build two graphs. A `Signal.Computed` of the first copy and a `Signal.subtle.Watcher` of the second copy therefore never meet: the watcher stays silent, and no error reports the fault. Every propagation of state in this architecture goes through a signal, so the second copy stops the reactivity of a whole application.
192
+ [`@xmachines/play-atom`](../api/@xmachines/play-atom/README.md) re-exports the atom of `@xstate/store`, and that library holds the active subscriber in a variable of its own module. Two copies build two graphs. A computed atom of the first copy and a subscription of the second copy therefore never meet: the subscriber stays silent, and no error reports the fault. Every propagation of state in this architecture goes through an atom, so the second copy stops the reactivity of a whole application.
191
193
 
192
- `@xmachines/play` holds `PlayError`, and the documentation sends a consumer to `err instanceof PlayError`. That check answers `false` for an error of the second copy.
194
+ [`@xmachines/play`](../api/@xmachines/play/README.md) holds `PlayError`, and the documentation sends a consumer to `err instanceof PlayError`. That check answers `false` for an error of the second copy.
193
195
 
194
196
  A dependency invites that second copy. `scripts/lib/workspace-deps.mjs` pins a `workspace:*` range to an EXACT version, so two packages of two releases name two versions, and an installer resolves both. A peer moves the choice to the consumer, who brings one copy. The `@xmachines/json-render-*` packages carry the same rule for the same reason.
195
197
 
196
198
  Each of the two needs a `devDependency` beside the peer, because the workspace installs no peer. Without that entry a package resolves the specifier through the hoisting of another package, and it compiles until that other package stops declaring it.
197
199
 
198
- `tests/singleton-peers.test.ts` holds the three rules true: no dependency, a dev entry beside each peer, and a peer for each one that `src/` imports. A package that reads one of the two in its TESTS alone needs the dev entry alone — `@xmachines/play-tanstack-router` is that case.
200
+ `tests/singleton-peers.test.ts` holds the three rules true: no dependency, a dev entry beside each peer, and a peer for each one that `src/` imports. A package that reads one of the two in its TESTS alone needs the dev entry alone — [`@xmachines/play-tanstack-router`](../api/@xmachines/play-tanstack-router/README.md) is that case.
199
201
 
200
202
  The rule reads in both directions. A peer that the `src/` directory never imports is a peer that a consumer installs for nothing, and four router adapters carried one. A package declares the peer when it reads the package, and a `devDependency` alone when its tests read it.
201
203
 
@@ -219,8 +221,8 @@ Packages are grouped into dependency layers as defined in the root `tsconfig.jso
219
221
  | Layer | Packages | Depends on |
220
222
  | ----- | -------------------------------------------------------------------------------- | ------------------ |
221
223
  | 0 | `docs`, `play`, `shared` | External libs only |
222
- | 1 | `play-signals`, `play-url` | Layer 0 |
223
- | 2 | `play-actor` | Layers 0–1 |
224
+ | 1 | `play-atom`, `play-pattern` | Layer 0 |
225
+ | 2 | `play-actor`, `play-url` | Layers 0–1 |
224
226
  | 3 | `play-view` | Layers 0–2 |
225
227
  | 4 | `play-dom`, `play-react`, `play-router`, `play-solid`, `play-svelte`, `play-vue` | Layers 0–3 |
226
228
  | 5 | `play-tanstack-router`, `play-xstate` | Layers 0–4 |
@@ -242,14 +244,20 @@ flowchart LR
242
244
  end
243
245
 
244
246
  subgraph L1["Layer 1"]
245
- play-signals
247
+ play-atom
248
+ play-pattern
246
249
  end
247
250
 
248
251
  subgraph L2["Layer 2"]
249
252
  play-actor
253
+ play-url
250
254
  end
251
255
 
252
- subgraph L3["Layer 3 — view renderers, and the router core"]
256
+ subgraph L3["Layer 3"]
257
+ play-view
258
+ end
259
+
260
+ subgraph L4["Layer 4 — view renderers, and the router core"]
253
261
  play-dom
254
262
  play-react
255
263
  play-router
@@ -258,31 +266,31 @@ flowchart LR
258
266
  play-vue
259
267
  end
260
268
 
261
- subgraph L4["Layer 4"]
269
+ subgraph L5["Layer 5"]
262
270
  play-tanstack-router
263
271
  play-xstate
264
272
  end
265
273
 
266
- subgraph L5["Layer 5"]
274
+ subgraph L6["Layer 6"]
267
275
  actorshared["play-actor/examples/shared"]
268
276
  end
269
277
 
270
- subgraph L6["Layer 6"]
278
+ subgraph L7["Layer 7"]
271
279
  renderdemos["renderer demo apps"]
272
280
  end
273
281
 
274
- subgraph L7["Layer 7 — the eight router adapters"]
282
+ subgraph L8["Layer 8 — the eight router adapters"]
275
283
  adapters["play-dom-router, play-react-router, play-solid-router,
276
284
  play-svelte-spa-router, play-sveltekit-router,
277
285
  play-tanstack-react-router, play-tanstack-solid-router,
278
286
  play-vue-router"]
279
287
  end
280
288
 
281
- subgraph L8["Layer 8"]
289
+ subgraph L9["Layer 9"]
282
290
  routerdemos["router demo apps"]
283
291
  end
284
292
 
285
- L0 --> L1 --> L2 --> L3 --> L4 --> L5 --> L6 --> L7 --> L8
293
+ L0 --> L1 --> L2 --> L3 --> L4 --> L5 --> L6 --> L7 --> L8 --> L9
286
294
  ```
287
295
 
288
296
  ### Adding a New Package
@@ -313,15 +321,11 @@ flowchart LR
313
321
  }
314
322
  ```
315
323
 
316
- If the package depends on other monorepo packages, add `references`:
317
-
318
- ```json
319
- {
320
- "extends": "@xmachines/shared/tsconfig",
321
- "compilerOptions": { "skipLibCheck": true },
322
- "references": [{ "path": "../play" }, { "path": "../play-actor" }]
323
- }
324
- ```
324
+ Declare no `references` here. TypeScript does not inherit a `references` array
325
+ through `extends`, so an array in this file orders nothing: `--showConfig` on the
326
+ package reports `references: None`. A package declares its dependencies in
327
+ `package.json`, with a `workspace:*` range, and the root `tsconfig.json` holds the
328
+ one build order. Step 4 below adds the entry.
325
329
 
326
330
  3. **`tsconfig.json`** — enable composite build:
327
331
 
@@ -356,7 +360,7 @@ All style rules are **mandatory** — CI enforces them on every merge request.
356
360
 
357
361
  ### Formatter — oxfmt
358
362
 
359
- oxfmt (Biome-based) is configured via `oxfmt.config.ts` at the root (extends `@xmachines/shared/oxfmt`).
363
+ oxfmt (Biome-based) is configured via `oxfmt.config.ts` at the root (extends [`@xmachines/shared/oxfmt`](../api/@xmachines/shared/README.md)).
360
364
 
361
365
  ```bash
362
366
  pnpm run format # Format all files
@@ -376,7 +380,7 @@ Key settings (from `packages/shared/config/oxfmt.config.ts`):
376
380
 
377
381
  ### Linter — oxlint
378
382
 
379
- oxlint is configured via `oxlint.config.ts` at the root (extends `@xmachines/shared/oxlint`).
383
+ oxlint is configured via `oxlint.config.ts` at the root (extends [`@xmachines/shared/oxlint`](../api/@xmachines/shared/README.md)).
380
384
 
381
385
  ```bash
382
386
  pnpm run lint # Lint all packages
@@ -405,7 +409,7 @@ Active plugins: `typescript`, `unicorn`, `import`. Key rules:
405
409
 
406
410
  ### TypeScript Strict Mode
407
411
 
408
- All packages extend `@xmachines/shared/tsconfig` which enables full strict mode. Mandatory constraints:
412
+ All packages extend [`@xmachines/shared/tsconfig`](../api/@xmachines/shared/README.md) which enables full strict mode. Mandatory constraints:
409
413
 
410
414
  | Option | Value |
411
415
  | ---------------------------- | ------ |
@@ -466,13 +470,37 @@ The root `AGENTS.md` carries the same rules for AI coding agents.
466
470
 
467
471
  ---
468
472
 
473
+ ## Link a Package That You Name
474
+
475
+ A document that names a package of this workspace links to the page of that package. A reader who meets a package name in the middle of a paragraph needs the page of that package, and a code span gives no way to reach it.
476
+
477
+ Write the link against the place that holds the document:
478
+
479
+ | Document | Link |
480
+ | ------------------------------------------------------------ | -------------------------------------- |
481
+ | `packages/<name>/README.md` | `../<target>/README.md` |
482
+ | `packages/<name>/examples/<demo>/README.md` | `../../../<target>/README.md` |
483
+ | `packages/docs/{guides,contributing,rfc,examples}/<file>.md` | `../api/@xmachines/<target>/README.md` |
484
+
485
+ A subpath names the package that holds it, so [`@xmachines/play-router/xstate`](../api/@xmachines/play-router/README.md) links to the README of [`@xmachines/play-router`](../api/@xmachines/play-router/README.md).
486
+
487
+ Three places keep a plain code span:
488
+
489
+ - A code block. The text is code, and an import specifier is not a reference to follow.
490
+ - A heading. The heading names the section, and the body links the package.
491
+ - The README of the package itself. A page does not link to itself.
492
+
493
+ `tests/package-mentions-are-linked.test.ts` holds the rule true. It reads every README and every hand-written document of `packages/docs/`, and it fails when a mention carries no link, or when the link names a file that is absent.
494
+
495
+ ---
496
+
469
497
  ## Branch Conventions
470
498
 
471
499
  Use a `<type>/` prefix that matches the conventional commit type for the work being done:
472
500
 
473
501
  ```
474
502
  feat/vue-router-adapter
475
- fix/signal-watcher-cleanup
503
+ fix/atom-subscription-cleanup
476
504
  docs/play-actor-jsdoc
477
505
  chore/update-vitest-4
478
506
  refactor/route-map-extraction
@@ -546,7 +574,7 @@ wrapped paragraph therefore announces a major that nobody intended.
546
574
  Use the package short-name as scope when the change is isolated to one package:
547
575
 
548
576
  ```
549
- fix(play-actor): correct signal cleanup on dispose
577
+ fix(play-actor): correct atom cleanup on dispose
550
578
  feat(play-react): add PlayRenderer suspense boundary
551
579
  ```
552
580
 
@@ -0,0 +1,209 @@
1
+ # Migrating to `@xmachines/play-atom`
2
+
3
+ `@xmachines/play-signals` is gone. [`@xmachines/play-atom`](../api/@xmachines/play-atom/README.md) replaces it.
4
+
5
+ The old package wrapped the [TC39 Signals](https://github.com/tc39/proposal-signals) polyfill. The new package re-exports the atom of [`@xstate/store`](https://stately.ai/docs/xstate-store), whose reactive core adapts the [Alien Signals](https://github.com/stackblitz/alien-signals) algorithm.
6
+
7
+ The two APIs agree on the shape: both read with `get()`, and both write with `set()`. A codemod therefore does most of the work. Three behaviours differ, and no codemod can decide those for you — read [What the codemod cannot do](#what-the-codemod-cannot-do).
8
+
9
+ ---
10
+
11
+ ## Why
12
+
13
+ Every renderer of this workspace already imported `createAtom` from `@xstate/store`, for the state store of the view. Every application therefore shipped TWO reactive graphs: the Signals polyfill for the actor, the route and the view, and the atom for the view store. The move collapses them into one.
14
+
15
+ It also drops about 3 KB gzip, and it inherits the diamond fix and the `compare` option that merge request [statelyai/xstate#5250](https://github.com/statelyai/xstate/pull/5250) landed.
16
+
17
+ ---
18
+
19
+ ## Run the codemod
20
+
21
+ The script travels with the repository, and no package publishes it. Download it first:
22
+
23
+ ```bash
24
+ curl -O https://gitlab.com/xmachin-es/xmachines-js/-/raw/main/scripts/codemod-play-atom.mjs
25
+ ```
26
+
27
+ ```bash
28
+ # Look first. It writes nothing.
29
+ node codemod-play-atom.mjs --dry-run .
30
+
31
+ # Then write.
32
+ node codemod-play-atom.mjs .
33
+ ```
34
+
35
+ The codemod reads `.ts`, `.tsx`, `.mts`, `.cts`, `.js`, `.jsx`, `.mjs`, `.vue`, `.svelte`, `.md` and `.json`, so it covers a manifest and a single-file component too. It skips `node_modules`, `dist`, `coverage` and every generated API directory.
36
+
37
+ It exits non-zero when it finds a site that needs a human, and it names each one.
38
+
39
+ Install the new package afterwards:
40
+
41
+ ```bash
42
+ pnpm remove @xmachines/play-signals
43
+ pnpm add @xmachines/play-atom @xstate/store
44
+ ```
45
+
46
+ ---
47
+
48
+ ## The name table
49
+
50
+ | `@xmachines/play-signals` | [`@xmachines/play-atom`](../api/@xmachines/play-atom/README.md) |
51
+ | ------------------------------------------ | --------------------------------------------------------------- |
52
+ | `new Signal.State(value)` | `createAtom(value)` |
53
+ | `new Signal.Computed(fn)` | `createAtom(fn)` |
54
+ | `Signal.State<T>` (type) | `Atom<T>` |
55
+ | `Signal.Computed<T>` (type) | `ReadonlyAtom<T>` |
56
+ | `SignalState<T>` / `SignalComputed<T>` | `Atom<T>` / `ReadonlyAtom<T>` |
57
+ | `{ equals }` | `{ compare }` |
58
+ | `SignalOptions<T>` / `ComputedOptions<T>` | `AtomOptions<T>` |
59
+ | `watchSignal(signal, onValue)` | `watchAtom(atom, onValue)` |
60
+ | `useSignalEffect(cb, deps)` (`play-react`) | `useAtomEffect(sources, cb, deps)` |
61
+ | `Signal.subtle.Watcher` | `atom.subscribe(fn)`, or `watchAtom` |
62
+ | `Signal.subtle.untrack(fn)` | — no equivalent. See below |
63
+ | `signal.set(value)` | `atom.set(value)`, and `atom.set(fn)` |
64
+
65
+ `createAtom` also accepts a function in `set`, which `Signal.State` did not.
66
+
67
+ ---
68
+
69
+ ## What the codemod cannot do
70
+
71
+ ### 1. A computed atom with a subscriber is EAGER
72
+
73
+ A TC39 `Signal.Computed` stayed lazy. A watcher notified, and the consumer read the value when it chose to.
74
+
75
+ `@xstate/store` builds a subscription on an effect that READS the atom. A write to a dependency therefore evaluates the derivation at once, inside that write.
76
+
77
+ What this changes:
78
+
79
+ - A derivation runs one time for each write of a dependency, and not one time for each microtask. Keep a derivation cheap, and keep it free of a side effect that must not repeat.
80
+ - `useAtomEffect` of [`@xmachines/play-react`](../api/@xmachines/play-react/README.md) runs your callback from `watchAtom`, which coalesces. Three writes in one tick therefore run the callback ONE time, with the last value, exactly as `useSignalEffect` did. The eagerness above applies to the DERIVATION, and not to your callback.
81
+
82
+ A computed atom that nobody subscribes to still stays lazy.
83
+
84
+ **Write ONE atom for each change, and derive the rest.** The library exposes no batching, so every `set` flushes by itself: two writes give two propagations, and an observer that reads both atoms is evaluated in between, on a half-updated pair. The actor of this workspace writes `state` alone for that reason, and `currentRoute` and `currentView` derive from it. If your own code writes two atoms that must agree, make one of them a `createAtom(fn)` over the other.
85
+
86
+ ### 2. The propagation is SYNCHRONOUS, inside `set`
87
+
88
+ An observer of `subscribe` runs inside the `set` of the atom that changed. An observer that THROWS therefore throws inside that `set`, and the failure lands in the code that wrote the atom — a failure of one view would break the actor for every other observer of it.
89
+
90
+ Contain it. `watchAtom` does this for you, because it defers the callback to a microtask. `useAtomEffect` catches a throw of a later run and throws it again from a microtask, which reaches the global handler of the runtime.
91
+
92
+ If you call `subscribe` directly, wrap the body.
93
+
94
+ **A DERIVATION must contain its own failures.** A subscriber makes a computed atom eager, so the derivation itself runs inside the `set`, before any observer. No subscriber can wrap that, so the rule belongs to the derivation: report through your error channel, and return the previous value. `currentRoute` and `currentView` of the actor both do this, and a release before this one let `currentRoute` throw — which was safe only while the TC39 watcher read it from a microtask.
95
+
96
+ ```typescript
97
+ // A derivation that a subscriber may watch.
98
+ const derived = createAtom((previous) => {
99
+ try {
100
+ return expensiveDerivation(source.get());
101
+ } catch (error) {
102
+ report(error);
103
+ return previous ?? null;
104
+ }
105
+ });
106
+ ```
107
+
108
+ ### 3. There is no `untrack`
109
+
110
+ `@xstate/store` exports no equivalent of `Signal.subtle.untrack`, because it keeps the active subscriber in a variable of its own module.
111
+
112
+ **Derive the value, and read `previous`.** Almost every `untrack` guarded the same shape: a gate that compares the new value with the last one it emitted. A computed atom is handed that last value, so the gate needs no read and therefore tracks nothing. `withView` of [`@xmachines/play-xstate`](../api/@xmachines/play-xstate/README.md) is the worked example:
113
+
114
+ ```typescript
115
+ // Before: a written atom, plus untrack to read what it held.
116
+ this.currentView = new Signal.State<View | null>(null);
117
+ const last = Signal.subtle.untrack(() => this.currentView.get());
118
+ if (!equivalent(last, next)) this.currentView.set(next);
119
+
120
+ // After: a computed atom. `previous` IS what the atom holds.
121
+ this.currentView = createAtom((previous): View | null => {
122
+ const last = previous ?? null;
123
+ const next = derive(this.state.get());
124
+ return equivalent(last, next) ? last : next;
125
+ });
126
+ ```
127
+
128
+ The second form is shorter, and it removes more than the `untrack`: the atom stops being written, so the gate keeps no bookkeeping of its own.
129
+
130
+ A read that already stands outside every computed atom and every effect tracks nothing, so it needs no wrapper at all.
131
+
132
+ ### 4. `useAtomEffect` takes the sources first
133
+
134
+ `useSignalEffect(callback, deps)` tracked every signal that its callback read. `useAtomEffect(sources, callback, deps)` tracks the atoms of its FIRST argument, and the callback runs OUTSIDE the tracking scope.
135
+
136
+ The codemod renames the call, and it cannot write the source list. Add that array yourself, and move the callback one place to the right:
137
+
138
+ ```tsx
139
+ // Before
140
+ useSignalEffect(() => {
141
+ setView(actor.currentView.get());
142
+ }, [actor]);
143
+
144
+ // After
145
+ useAtomEffect(
146
+ [actor.currentView],
147
+ () => {
148
+ setView(actor.currentView.get());
149
+ },
150
+ [actor],
151
+ );
152
+ ```
153
+
154
+ The list is the reason the hook exists in this form: a callback that reads a view store no longer depends on that store, so a write of the store runs the effect never. Name every atom that must run the effect, and read whatever else you need inside the callback.
155
+
156
+ ---
157
+
158
+ ## Install ONE copy of `@xstate/store`
159
+
160
+ `@xstate/store` holds the active subscriber in a variable of its own module. Two copies build two separate graphs: a computed atom of the first copy and a subscription of the second copy never meet, the subscriber stays silent, and no error reports the fault.
161
+
162
+ [`@xmachines/play-atom`](../api/@xmachines/play-atom/README.md) declares `@xstate/store` as a PEER dependency for this reason. A renderer declares it no more: a renderer reads the atom through [`@xmachines/play-atom`](../api/@xmachines/play-atom/README.md), and it imports the engine in no source file. Declare it once in your application, and let every `@xmachines` package resolve to that copy.
163
+
164
+ Check an install:
165
+
166
+ ```bash
167
+ pnpm why @xstate/store
168
+ ```
169
+
170
+ More than one version in the output is the fault above.
171
+
172
+ ## The engine moved to `@xstate/store` 4
173
+
174
+ XMachines 5.0.0 declares `@xstate/store` `^4.2.3`, where the release before it declared `^3.17.0`. Install the new major with this release.
175
+
176
+ One signature changed. A computed getter took a `read` helper in its first position in version 3, and it takes the previous value alone now, because `get` records the dependency by itself. The codemod writes the new form, and a derivation that you wrote by hand needs the first parameter deleted:
177
+
178
+ ```diff
179
+ -const derived = createAtom((_read, previous) => …);
180
+ +const derived = createAtom((previous) => …);
181
+ ```
182
+
183
+ `createAsyncAtom` gives its getter an `AbortSignal` now. A getter that needs none takes no parameter, so nothing forces a change.
184
+
185
+ ---
186
+
187
+ ## A type error that names a type you never wrote
188
+
189
+ ```
190
+ Property 'set' is missing in type 'ReadonlyAtom<T>' but required in type 'Atom<T>'
191
+ ```
192
+
193
+ `createAtom` carries two signatures, and TypeScript must prove the argument is not a function before it reaches the writable one. For a concrete type it proves that at once. For a type parameter, or a conditional type over one, it cannot, so it picks the computed signature.
194
+
195
+ Use `createWritableAtom`, which states the one signature:
196
+
197
+ ```typescript
198
+ import { createWritableAtom } from "@xmachines/play-atom";
199
+
200
+ this.state = createWritableAtom(this.getSnapshot());
201
+ ```
202
+
203
+ ---
204
+
205
+ ## See also
206
+
207
+ - [Understanding Atoms](../guides/atoms.md) — the concepts, and the invariants
208
+ - [`@xmachines/play-atom`](../api/@xmachines/play-atom/README.md) — the API reference
209
+ - [Play RFC](../rfc/play.md) — section 5.1.1 defines the reactive substrate