@xmachines/docs 2.2.0 → 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 (352) hide show
  1. package/README.md +1 -1
  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 +44 -18
  49. package/api/@xmachines/play-dom-router/classes/DomRouterBridge.md +7 -7
  50. package/api/@xmachines/play-dom-router/functions/connectRouter.md +1 -1
  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 +3 -3
  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 +6 -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 +35 -6
  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 +1 -1
  87. package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +7 -7
  88. package/api/@xmachines/play-react-router/classes/RouteMap.md +4 -4
  89. package/api/@xmachines/play-react-router/functions/createPlayRouterProvider.md +1 -1
  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 +7 -7
  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 +1 -1
  99. package/api/@xmachines/play-react-router/type-aliases/PlayRouterProviderBaseProps.md +1 -1
  100. package/api/@xmachines/play-react-router/variables/PlayRouterProvider.md +1 -1
  101. package/api/@xmachines/play-router/README.md +13 -2
  102. package/api/@xmachines/play-router/classes/RouteMap.md +4 -4
  103. package/api/@xmachines/play-router/classes/RouterBridgeBase.md +7 -7
  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 +1 -1
  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 +1 -1
  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 +1 -1
  118. package/api/@xmachines/play-router/functions/getRequiredPatternParamNames.md +1 -1
  119. package/api/@xmachines/play-router/functions/getRoutableRoutes.md +1 -1
  120. package/api/@xmachines/play-router/functions/getRouteMappings.md +1 -1
  121. package/api/@xmachines/play-router/functions/getTransitionReachableRoutes.md +1 -1
  122. package/api/@xmachines/play-router/functions/isMountableBridge.md +1 -1
  123. package/api/@xmachines/play-router/functions/isRouteReachable.md +1 -1
  124. package/api/@xmachines/play-router/functions/joinBasePath.md +1 -1
  125. package/api/@xmachines/play-router/functions/machineToGraph.md +1 -1
  126. package/api/@xmachines/play-router/functions/mountKey.md +1 -1
  127. package/api/@xmachines/play-router/functions/normalizeBasePath.md +1 -1
  128. package/api/@xmachines/play-router/functions/openProviderBridge.md +5 -5
  129. package/api/@xmachines/play-router/functions/pickOwnParams.md +1 -1
  130. package/api/@xmachines/play-router/functions/repointProviderBridge.md +1 -1
  131. package/api/@xmachines/play-router/functions/resolveBasePath.md +1 -1
  132. package/api/@xmachines/play-router/functions/resolveFrameworkParams.md +1 -1
  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 +1 -1
  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 +5 -5
  139. package/api/@xmachines/play-router/interfaces/BuildPlayRouteEventOptions.md +6 -6
  140. package/api/@xmachines/play-router/interfaces/FrameworkParamsSource.md +8 -8
  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 +8 -8
  145. package/api/@xmachines/play-router/interfaces/OpenProviderBridgeArgs.md +8 -8
  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 +9 -9
  149. package/api/@xmachines/play-router/interfaces/ResolvedBasePath.md +5 -5
  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 +3 -3
  161. package/api/@xmachines/play-router/interfaces/RouterConnection.md +37 -8
  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 +1 -1
  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 +1 -1
  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 +1 -1
  190. package/api/@xmachines/play-solid-router/classes/RouteMap.md +4 -4
  191. package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +8 -8
  192. package/api/@xmachines/play-solid-router/functions/createPlayRouterProvider.md +1 -1
  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 +7 -7
  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 +1 -1
  202. package/api/@xmachines/play-solid-router/type-aliases/PlayRouterProviderBaseProps.md +1 -1
  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 +1 -1
  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 +1 -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 +7 -7
  219. package/api/@xmachines/play-svelte-spa-router/functions/connectRouter.md +1 -1
  220. package/api/@xmachines/play-svelte-spa-router/functions/createRouteMap.md +1 -1
  221. package/api/@xmachines/play-svelte-spa-router/interfaces/BasePathOptions.md +3 -3
  222. package/api/@xmachines/play-svelte-spa-router/interfaces/ConnectRouterOptions.md +6 -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 +35 -6
  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 +1 -1
  231. package/api/@xmachines/play-sveltekit-router/classes/RouteMap.md +4 -4
  232. package/api/@xmachines/play-sveltekit-router/classes/SvelteKitRouterBridge.md +7 -7
  233. package/api/@xmachines/play-sveltekit-router/functions/connectRouter.md +1 -1
  234. package/api/@xmachines/play-sveltekit-router/functions/createRouteMap.md +1 -1
  235. package/api/@xmachines/play-sveltekit-router/interfaces/BasePathOptions.md +3 -3
  236. package/api/@xmachines/play-sveltekit-router/interfaces/ConnectRouterOptions.md +6 -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 +35 -6
  243. package/api/@xmachines/play-sveltekit-router/type-aliases/RoutableActor.md +1 -1
  244. package/api/@xmachines/play-tanstack-react-router/README.md +1 -1
  245. package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +4 -4
  246. package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +7 -7
  247. package/api/@xmachines/play-tanstack-react-router/functions/createPlayRouterProvider.md +1 -1
  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 +7 -7
  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 +1 -1
  259. package/api/@xmachines/play-tanstack-react-router/type-aliases/PlayRouterProviderBaseProps.md +1 -1
  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 +1 -1
  263. package/api/@xmachines/play-tanstack-router/README.md +1 -1
  264. package/api/@xmachines/play-tanstack-router/classes/TanStackRouterBridgeBase.md +7 -7
  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 +1 -1
  268. package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +4 -4
  269. package/api/@xmachines/play-tanstack-solid-router/classes/TanStackSolidRouterBridge.md +8 -8
  270. package/api/@xmachines/play-tanstack-solid-router/functions/createPlayRouterProvider.md +1 -1
  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 +7 -7
  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 +1 -1
  279. package/api/@xmachines/play-tanstack-solid-router/type-aliases/PlayRouterProviderBaseProps.md +1 -1
  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 +1 -1
  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 +8 -8
  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 +1 -1
  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 +59 -17
  348. package/contributing/development.md +50 -28
  349. package/contributing/testing.md +3 -3
  350. package/guides/getting-started.md +7 -7
  351. package/guides/signals.md +43 -0
  352. package/package.json +1 -1
@@ -4,7 +4,7 @@
4
4
 
5
5
  Vanilla DOM renderer for XMachines Play architecture with signal-driven rendering.
6
6
 
7
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Version](https://img.shields.io/badge/version-2.2.0-blue)](https://www.npmjs.com/package/@xmachines/play-dom)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Version](https://img.shields.io/badge/version-3.0.0-blue)](https://www.npmjs.com/package/@xmachines/play-dom)
8
8
 
9
9
  ## Installation
10
10
 
@@ -116,7 +116,7 @@ disconnect();
116
116
 
117
117
  Use `createPlayUI` when you need a render error handler, a fallback element, a navigation integration, a computed function, or a custom check. Use it also when your code needs the `registryResult` value, for example for `executeAction`.
118
118
 
119
- The factory holds the factory options (`functions`, `validationFunctions`, `navigate`, `onRenderError`, and `fallback`) from the moment of its creation, and it applies them on every `mount()` call. Give the mount options (`store` and `loading`) to `mount()` itself.
119
+ The factory holds the factory options (`functions`, `validationFunctions`, `navigate`, `onRenderError`, `onError`, and `fallback`) from the moment of its creation, and it applies them on every `mount()` call. Give the mount options (`store` and `loading`) to `mount()` itself.
120
120
 
121
121
  ```typescript
122
122
  import { defineRegistry, createPlayUI, schema } from "@xmachines/play-dom";
@@ -279,6 +279,69 @@ The order of the arguments is the same as in the `RenderErrorHandler` type of `@
279
279
 
280
280
  Without `onRenderError`, the renderer writes all three types of error to `console.error`, then stops them. No exception goes to the caller, and no promise rejection stays unhandled.
281
281
 
282
+ ### The renderer contains a failed rebuild — a change of behaviour in 2.3.0
283
+
284
+ **Read this if you catch what `mount()` or `connect()` throws.**
285
+
286
+ In 2.2.0 the renderer had no containment. A view that failed the rebuild threw out of
287
+ `mount()` and out of the callback of the signal watcher, so a `try` of the host, an error
288
+ boundary of the framework around it, or the global handler of the page received it.
289
+
290
+ In 2.3.0 the renderer contains such a failure ALWAYS. No option turns the containment on,
291
+ and no option turns it off. The renderer clears the container, it shows the `fallback`,
292
+ and `mount()` returns normally. A host that shows its own error page from a `catch` around
293
+ `mount()` sees that `catch` never again.
294
+
295
+ The four framework renderers contain a failed render always, because an error boundary of
296
+ a framework is not an option that a caller turns off. This change puts play-dom on the
297
+ same rule.
298
+
299
+ **To escalate a failure, raise it from a task of your own:**
300
+
301
+ ```typescript
302
+ const mount = createPlayUI(registryResult, {
303
+ onError: (err) => {
304
+ reportToSentry(err);
305
+ queueMicrotask(() => {
306
+ throw err; // the page keeps its own global handler
307
+ });
308
+ },
309
+ });
310
+ ```
311
+
312
+ A throw that leaves the handler itself reaches no caller. The renderer contains it and
313
+ writes it to `console.error`, exactly as the four framework renderers do. The five hold
314
+ this one rule, so a host learns it one time and writes the same handler for each of them.
315
+
316
+ ### `onError` — the failure of a complete rebuild
317
+
318
+ `onRenderError` covers one element: the inner renderer contains a render error of a component, and a rejection of an action handler, per element, and the rebuild continues. Some failures escape that boundary — a `$computed` function that throws during the resolution of a prop, for example — and they abort the complete rebuild.
319
+
320
+ `onError` receives such a failure. The renderer contains it with this option and without it: it resets the state of the failed rebuild, so that the next emission makes a complete render again, and it clears the container. `connect()` renders the first view synchronously, so a bad initial view makes `connect()` throw no more.
321
+
322
+ A write of the store takes the same path. The renderer resolves the props of every element that the write touched, so a `$computed` function that throws on the new state aborts that render too. The renderer contains such a failure as well, and the action handler that wrote the state receives no exception.
323
+
324
+ The second parameter is the **reset**, for a retry that the host starts. It renders the view that the actor holds at the moment of the call, so a retry cannot rewind the screen to the view that failed. A reset that the host calls from inside the handler does nothing, because no input changed between the two attempts, and a reset after the provider goes away does nothing. The five renderers hold the same three rules.
325
+
326
+ A reset of `PlayRenderer` belongs to ONE connection. `connect()` starts a connection, and the reset of a report of an older connection does nothing. A host that calls `connect()` again from inside the handler abandons the connection that reported. The "Retry" button of that report must not render into the connection that took its place. Call the reset of the newest report.
327
+
328
+ A fourth rule holds in all five: each of them CONTAINS a handler that throws, and writes the throw to `console.error`. A host that must escalate raises the failure from a task of its own, as the section above shows.
329
+
330
+ ```typescript
331
+ const mount = createPlayUI(registryResult, {
332
+ onError: (err) => reportToSentry(err),
333
+ fallback: document.getElementById("crashed")!,
334
+ });
335
+ ```
336
+
337
+ `createPlayUI` adds the parity with the framework providers: the renderer contains the failure, and it appends the `fallback` to the container that the failed rebuild left clear. A later view that renders clears the container again, which removes the fallback.
338
+
339
+ `onError` says WHERE the report goes, and `fallback` says what the empty container shows. Neither option turns the containment on. Without `onError` the renderer writes the contained error to `console.error`, in the same way as it does for a component that throws without an `onRenderError` handler. Give `onError` to send the failure to your own observability tool instead.
340
+
341
+ **One fallback element belongs to one mount.** `appendChild` moves a node. Two mounts of the same factory therefore take the element from each other on every null view, and the container of the first one goes empty without a notice. Build one element for each `mount()` call.
342
+
343
+ **A `fallback` producer that throws is contained too — on a null view and after a failed rebuild alike — and it reports to `console.error` and NOT to `onError`.** After a failed rebuild the renderer calls the producer from inside the containment of the view, so a second trip through `onError` would report the failure of your fallback as a failure of the view. The container stays empty, and the renderer renders the next view that works.
344
+
282
345
  A component implementation can also read the handler at `ctx.ctx.onRenderError`. A component therefore sends its own internal errors through the same channel:
283
346
 
284
347
  ```typescript
@@ -298,14 +361,15 @@ const Home: ComponentFn<typeof catalog, "Home"> = ({ ctx }) => {
298
361
 
299
362
  ### XMachines Layer
300
363
 
301
- | Export | Kind | Description |
302
- | ---------------------------------------- | -------- | --------------------------------------------------------------------------------- |
303
- | `createRenderer(catalog, components)` | function | The one-call factory. It returns `mount(actor, container, options?) → disconnect` |
304
- | `createPlayUI(registryResult, options?)` | function | The complete factory. It returns a `MountFn` |
305
- | `PlayRenderer` | class | The renderer class, with a `connect()` and `disconnect()` lifecycle |
306
- | `defineRegistry(catalog, options)` | function | Build a catalog-typed `DomRegistry` with typed handlers |
307
- | `renderSpec(...)` | function | The pure low-level Spec → DOM renderer |
308
- | `schema` | const | The `@xmachines/json-render-dom` schema — pass to `defineCatalog()` |
364
+ | Export | Kind | Description |
365
+ | ---------------------------------------- | -------- | ------------------------------------------------------------------- |
366
+ | `createRenderer(catalog, components)` | function | The one-call factory. Its `mount` hands a `Cleanup` back |
367
+ | `createPlayUI(registryResult, options?)` | function | The complete factory. It returns a `DisposablePlayUI` |
368
+ | `PlayRenderer` | class | The renderer class, with a `connect()` and `disconnect()` lifecycle |
369
+ | `defineRegistry(catalog, options)` | function | Build a catalog-typed `DomRegistry` with typed handlers |
370
+ | `renderSpec(...)` | function | The pure low-level Spec → DOM renderer |
371
+ | `schema` | const | The `@xmachines/json-render-dom` schema — pass to `defineCatalog()` |
372
+ | `Cleanup` | type | The release a mount returns, re-exported from `@xmachines/play` |
309
373
 
310
374
  ### Key Types
311
375
 
@@ -317,21 +381,23 @@ const Home: ComponentFn<typeof catalog, "Home"> = ({ ctx }) => {
317
381
  | `EventHandle` | The handle that `on(eventName)` returns. It has `emit()`, `shouldPreventDefault`, and `bound` |
318
382
  | `SetState` | State updater: `(prev => next) => void` |
319
383
  | `DefineRegistryResult` | The result of `defineRegistry`. It has `registry`, `handlers`, and `executeAction` |
320
- | `PlayDomOptions` | Options for `PlayRenderer` — extends `UIProviderOptions` |
321
- | `CreatePlayUIOptions` | Options for `createPlayUI` — extends `UIProviderOptions`, adds `fallback` |
384
+ | `PlayDomOptions` | Options for `PlayRenderer` — extends `UIProviderOptions`, adds `fallback` and `onError` |
385
+ | `CreatePlayUIOptions` | Options for `createPlayUI` — extends `UIProviderOptions`, adds `fallback` and `onError` |
322
386
  | `MountOptions` | Per-mount options for `MountFn`: `store`, `loading` |
323
- | `MountFn` | The mount function that `createPlayUI` returns: `(actor, container, options?) → disconnect` |
387
+ | `MountFn` | The type of a mount that a consumer writes: `(actor, container, options?) → disconnect` |
388
+ | `DisposablePlayUI` | The mount that `createPlayUI` builds. It hands a `Cleanup` back, so `using` releases it |
324
389
  | `UIProviderOptions` | Shared options: `functions`, `validationFunctions`, `navigate`, `onRenderError` |
325
390
  | `BaseComponentProps<P>` | Catalog-agnostic component props for shared component libraries |
326
391
  | `DomRegistry` | Raw registry type: `Record<string, DomComponentRenderer>` |
327
392
  | `DomSchema` | Type of the `schema` export |
328
393
  | `ComputedFunction` | The type of a named compute function for the `functions` option |
394
+ | `Cleanup` | The release of a mount, re-exported from `@xmachines/play` |
329
395
 
330
396
  ## Rendering Behavior
331
397
 
332
398
  - **The first render is synchronous** — the renderer fills the container before `connect()` returns.
333
399
  - **A signal-driven render waits for a microtask** — `watchSignal` puts each update on the next tick of the microtask queue.
334
- - **A null view** clears the container. The renderer can show a `fallback` element on the first mount, when the view is `null`. It does **not** add that element again when the view returns to `null` after a view that was not null.
400
+ - **A null view** clears the container, and the renderer then shows the `fallback` element when you give one. It shows it for every null view, and not for the first mount only the four framework providers hold the same rule for their placeholder content.
335
401
  - **A second `connect()` is safe** — a `connect()` call on a connected renderer disconnects it first.
336
402
  - **`disconnect()` clears the container** and cancels every signal watcher and store watcher.
337
403
 
@@ -354,9 +420,9 @@ The public API has two layers:
354
420
  **The XMachines layer**, in this package:
355
421
 
356
422
  - `createRenderer()` — the one-call factory. It returns `mount(actor, container, options?) → disconnect`
357
- - `createPlayUI()` — the complete factory, with every option. It returns a `MountFn`
423
+ - `createPlayUI()` — the complete factory, with every option. It returns a `DisposablePlayUI`
358
424
  - `PlayRenderer` — the renderer class, with a `connect()` and `disconnect()` lifecycle
359
- - `PlayDomOptions`, `CreatePlayUIOptions`, `MountFn`, `MountOptions`
425
+ - `PlayDomOptions`, `CreatePlayUIOptions`, `MountFn`, `DisposablePlayUI`, `MountOptions`
360
426
 
361
427
  **The json-render layer**, re-exported from @xmachines/json-render-dom:
362
428
 
@@ -397,10 +463,12 @@ The public API has two layers:
397
463
  - [Actions](type-aliases/Actions.md)
398
464
  - [BaseComponentProps](type-aliases/BaseComponentProps.md)
399
465
  - [CatalogHasActions](type-aliases/CatalogHasActions.md)
466
+ - [Cleanup](type-aliases/Cleanup.md)
400
467
  - [ComponentFn](type-aliases/ComponentFn.md)
401
468
  - [ComponentRegistry](type-aliases/ComponentRegistry.md)
402
469
  - [ConfirmHandler](type-aliases/ConfirmHandler.md)
403
470
  - [DefineRegistryOptions](type-aliases/DefineRegistryOptions.md)
471
+ - [DisposablePlayUI](type-aliases/DisposablePlayUI.md)
404
472
  - [DomComponentRenderer](type-aliases/DomComponentRenderer.md)
405
473
  - [DomRegistry](type-aliases/DomRegistry.md)
406
474
  - [DomSchema](type-aliases/DomSchema.md)
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Class: PlayRenderer
4
4
 
5
- Defined in: [packages/play-dom/src/PlayRenderer.ts:72](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-dom/src/PlayRenderer.ts#L72)
5
+ Defined in: [packages/play-dom/src/PlayRenderer.ts:131](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/PlayRenderer.ts#L131)
6
6
 
7
7
  PlayRenderer connects the `currentView` signal of an actor to the DOM renderer.
8
8
 
@@ -63,16 +63,16 @@ new PlayRenderer(
63
63
  options?): PlayRenderer;
64
64
  ```
65
65
 
66
- Defined in: [packages/play-dom/src/PlayRenderer.ts:130](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-dom/src/PlayRenderer.ts#L130)
66
+ Defined in: [packages/play-dom/src/PlayRenderer.ts:225](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/PlayRenderer.ts#L225)
67
67
 
68
68
  #### Parameters
69
69
 
70
- | Parameter | Type | Description |
71
- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
72
- | `container` | `HTMLElement` | The `HTMLElement` to render into. Each view transition clears it and fills it again. |
73
- | `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Viewable`](../../play-actor/interfaces/Viewable.md) | The actor with the `currentView` signal. It must implement `Viewable`. |
74
- | `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | The map of the component renderers, usually `registryResult.registry` from `defineRegistry`. |
75
- | `options` | [`PlayDomOptions`](../interfaces/PlayDomOptions.md) | The configuration. See [PlayDomOptions](../interfaces/PlayDomOptions.md): - `registryResult` — it connects `setState` and `state` of the xstate store for you. - `store` — an external `StateStore`, which is the controlled mode. It replaces the values of `spec.state`. - `loading` — the flag of the streaming mode. It stops each warning about an absent child. - `functions` — the named compute functions of a `$computed` prop expression. - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props. - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`. - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: "..." }`. - `onRenderError` — the `(error, name)` handler of a component render error and of an action handler rejection. It stops the `console.error` fallback. |
70
+ | Parameter | Type | Description |
71
+ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
72
+ | `container` | `HTMLElement` | The `HTMLElement` to render into. Each view transition clears it and fills it again. |
73
+ | `actor` | [`AbstractActor`](../../play-actor/classes/AbstractActor.md)\<[`AnyActorLogic`](https://www.jsdocs.io/package/xstate#AnyActorLogic), [`EventObject`](https://www.jsdocs.io/package/xstate#EventObject)\> & [`Viewable`](../../play-actor/interfaces/Viewable.md) | The actor with the `currentView` signal. It must implement `Viewable`. |
74
+ | `registry` | [`DomRegistry`](../type-aliases/DomRegistry.md) | The map of the component renderers, usually `registryResult.registry` from `defineRegistry`. |
75
+ | `options` | [`PlayDomOptions`](../interfaces/PlayDomOptions.md) | The configuration. See [PlayDomOptions](../interfaces/PlayDomOptions.md): - `registryResult` — it connects `setState` and `state` of the xstate store for you. - `store` — an external `StateStore`, which is the controlled mode. It replaces the values of `spec.state`. - `loading` — the flag of the streaming mode. It stops each warning about an absent child. - `functions` — the named compute functions of a `$computed` prop expression. - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props. - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`. - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: "..." }`. - `onRenderError` — the `(error, name)` handler of a component render error and of an action handler rejection. It stops the `console.error` fallback. - `onError` — the `(error, reset)` handler of a failure of a complete rebuild. The renderer contains such a failure always, and this option says where the report goes. - `fallback` — the element to show for every null view, and after a contained failure. |
76
76
 
77
77
  #### Returns
78
78
 
@@ -86,7 +86,7 @@ Defined in: [packages/play-dom/src/PlayRenderer.ts:130](https://gitlab.com/xmach
86
86
  connect(): void;
87
87
  ```
88
88
 
89
- Defined in: [packages/play-dom/src/PlayRenderer.ts:146](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-dom/src/PlayRenderer.ts#L146)
89
+ Defined in: [packages/play-dom/src/PlayRenderer.ts:241](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/PlayRenderer.ts#L241)
90
90
 
91
91
  Starts the watch of actor.currentView, and renders into the container.
92
92
  It renders the first view synchronously, then it subscribes to the signal changes.
@@ -108,7 +108,7 @@ renderer first.
108
108
  disconnect(): void;
109
109
  ```
110
110
 
111
- Defined in: [packages/play-dom/src/PlayRenderer.ts:155](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-dom/src/PlayRenderer.ts#L155)
111
+ Defined in: [packages/play-dom/src/PlayRenderer.ts:285](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/PlayRenderer.ts#L285)
112
112
 
113
113
  Stops the watch and clears the container.
114
114
 
@@ -3,10 +3,10 @@
3
3
  # Function: createPlayUI()
4
4
 
5
5
  ```ts
6
- function createPlayUI(registryResult, options?): MountFn;
6
+ function createPlayUI(registryResult, options?): DisposablePlayUI;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-dom/src/create-play-ui.ts:95](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-dom/src/create-play-ui.ts#L95)
9
+ Defined in: [packages/play-dom/src/create-play-ui.ts:126](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/create-play-ui.ts#L126)
10
10
 
11
11
  Creates the mount function of the complete DOM renderer.
12
12
 
@@ -16,13 +16,13 @@ and a container.
16
16
 
17
17
  ## Parameters
18
18
 
19
- | Parameter | Type | Description |
20
- | ---------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
- | `registryResult` | [`DefineRegistryResult`](../interfaces/DefineRegistryResult.md) | The result of `defineRegistry()`. It gives the registry and the factory of the handlers, which it builds late. |
22
- | `options` | [`CreatePlayUIOptions`](../interfaces/CreatePlayUIOptions.md) | The factory configuration. See [CreatePlayUIOptions](../interfaces/CreatePlayUIOptions.md): - `functions` — the named compute functions of a `$computed` prop expression. - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props. - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`. - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: "..." }`. - `onRenderError` — the `(error, name)` handler of a component render error and of an action handler rejection. - `fallback` — the element to show when the first view of the actor is `null`. |
19
+ | Parameter | Type | Description |
20
+ | ---------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
21
+ | `registryResult` | [`DefineRegistryResult`](../interfaces/DefineRegistryResult.md) | The result of `defineRegistry()`. It gives the registry and the factory of the handlers, which it builds late. |
22
+ | `options` | [`CreatePlayUIOptions`](../interfaces/CreatePlayUIOptions.md) | The factory configuration. See [CreatePlayUIOptions](../interfaces/CreatePlayUIOptions.md): - `functions` — the named compute functions of a `$computed` prop expression. - `directives` — your own dynamic values with a `$` prefix. The renderer resolves them with the props. - `validationFunctions` — your own check functions. They are available at `ctx.ctx.validationFunctions`. - `navigate` — the navigation callback. The renderer calls it for `onSuccess: { navigate: "..." }`. - `onRenderError` — the `(error, name)` handler of a component render error and of an action handler rejection. - `onError` — the `(error, reset)` handler of a failure of a complete rebuild. The renderer contains such a failure always, and this option says where the report goes. - `fallback` — the content to show when the view of the actor is `null`, and after a contained failure of a rebuild. Give a FUNCTION when the factory mounts more than one time, so that each renderer owns its own element. |
23
23
 
24
24
  ## Returns
25
25
 
26
- [`MountFn`](../type-aliases/MountFn.md)
26
+ [`DisposablePlayUI`](../type-aliases/DisposablePlayUI.md)
27
27
 
28
- The `MountFn`: `(actor, container, mountOptions?) → disconnect`
28
+ The [DisposablePlayUI](../type-aliases/DisposablePlayUI.md): `(actor, container, mountOptions?) → disconnect`
@@ -3,10 +3,10 @@
3
3
  # Function: createRenderer()
4
4
 
5
5
  ```ts
6
- function createRenderer<C>(catalog, componentMap): (actor, container, options?) => () => void;
6
+ function createRenderer<C>(catalog, componentMap): (actor, container, options?) => Cleanup;
7
7
  ```
8
8
 
9
- Defined in: [packages/play-dom/src/create-renderer.ts:88](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-dom/src/create-renderer.ts#L88)
9
+ Defined in: [packages/play-dom/src/create-renderer.ts:89](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/create-renderer.ts#L89)
10
10
 
11
11
  Creates a DOM renderer factory from a catalog and a component map. You can use
12
12
  the factory more than one time.
@@ -31,7 +31,7 @@ the PlayRenderer in one call, and it returns a `disconnect` cleanup function.
31
31
 
32
32
  A `mount` function. It accepts `(actor, container, options?)`, and it returns `disconnect`.
33
33
 
34
- (`actor`, `container`, `options?`) => () => `void`
34
+ (`actor`, `container`, `options?`) => [`Cleanup`](../type-aliases/Cleanup.md)
35
35
 
36
36
  ## Remarks
37
37
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Interface: CreatePlayUIOptions
4
4
 
5
- Defined in: [packages/play-dom/src/types.ts:69](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-dom/src/types.ts#L69)
5
+ Defined in: [packages/play-dom/src/types.ts:152](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/types.ts#L152)
6
6
 
7
7
  The options of `createPlayUI()`, the complete DOM factory.
8
8
 
@@ -11,6 +11,11 @@ This type extends [UIProviderOptions](UIProviderOptions.md), which gives `functi
11
11
  holds all of them from the moment of its creation, and it gives them to
12
12
  `PlayRenderer` on every `mount()` call.
13
13
 
14
+ It also takes [PlayDomOptions.onError](PlayDomOptions.md#property-onerror), which the factory forwards without a
15
+ change: `PlayRenderer` owns it, and it receives every failure of a rebuild that the
16
+ renderer contains. Read that entry for the complete rule. `fallback` below says what
17
+ the factory adds to [PlayDomOptions.fallback](PlayDomOptions.md#property-fallback).
18
+
14
19
  This type is parallel to the props of `PlayUIProvider` in the framework renderers.
15
20
 
16
21
  ## See
@@ -19,16 +24,17 @@ createPlayUI
19
24
 
20
25
  ## Extends
21
26
 
22
- - [`UIProviderOptions`](UIProviderOptions.md)
27
+ - [`UIProviderOptions`](UIProviderOptions.md).`Pick`\<[`PlayDomOptions`](PlayDomOptions.md), `"onError"`\>
23
28
 
24
29
  ## Properties
25
30
 
26
- | Property | Type | Description | Inherited from | Defined in |
27
- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
28
- | <a id="property-directives"></a> `directives?` | `DirectiveDefinition`\<`ZodType`\<`unknown`, `unknown`, `$ZodTypeInternals`\<`unknown`, `unknown`\>\>\>[] | Custom directives — user-defined `$`-prefixed dynamic values that extend the spec expression language (e.g. `{ $format: "currency", value: ... }`). Each entry is a `DirectiveDefinition` built with `defineDirective` from `@xmachines/json-render-core`. The array is converted to a `DirectiveRegistry` once per render pass and forwarded to `resolveElementProps` via `PropResolutionContext.directives`. Built-in expressions (`$state`, `$cond`, etc.) always take precedence over custom directives. Mirrors the `directives` prop on `JSONUIProvider` / `JsonUIProvider` introduced in **Json-render** 0.19. **Example** `import { defineDirective, resolvePropValue } from "@xmachines/json-render-core"; import { z } from "zod"; const formatDirective = defineDirective({ name: "$format", description: "Locale-aware number formatting.", schema: z.object({ $format: z.enum(["number", "currency"]), value: z.unknown() }), resolve(value, ctx) { const resolved = resolvePropValue(value.value, ctx); return new Intl.NumberFormat().format(resolved as number); }, }); renderSpec(spec, store, registry, { directives: [formatDirective] });` | [`UIProviderOptions`](UIProviderOptions.md).[`directives`](UIProviderOptions.md#property-directives) | - |
29
- | <a id="property-fallback"></a> `fallback?` | `HTMLElement` \| `null` | The optional fallback element. The factory shows it when `currentView` is `null` on the **first mount** only. The factory appends the fallback directly after `mount()`, when the container is empty at that moment, which means that the first view of the actor is `null`. **Limitation:** when the view of the actor becomes `null` after the mount, the renderer clears the container, and it does NOT append this fallback again. For a dynamic fallback, which follows a null view after a view that was not null, use `PlayRenderer` directly and wrap the `actor.currentView` signal to add the fallback content. | - | [packages/play-dom/src/types.ts:82](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-dom/src/types.ts#L82) |
30
- | <a id="property-functions"></a> `functions?` | `Record`\<`string`, `ComputedFunction`\> | Named compute functions for `{ $computed: "name", args: {...} }` prop expressions. Each function receives the resolved `args` object and returns the computed value. Forwarded directly to `resolveElementProps` via `PropResolutionContext.functions`, matching the `FunctionsContext` provider in the framework renderers. Without this option, `$computed` expressions resolve to `undefined` (no throw). **Example** `renderSpec(spec, store, registry, { functions: { fullName: (args) => `${args.first} ${args.last}`, formatCurrency: (args) => new Intl.NumberFormat().format(args.amount as number), }, });` Mirrors the `functions` prop on `JSONUIProvider` / `JsonUIProvider`. | [`UIProviderOptions`](UIProviderOptions.md).[`functions`](UIProviderOptions.md#property-functions) | - |
31
- | <a id="property-navigate"></a> `navigate?` | (`path`) => `void` | Programmatic navigation function. Called automatically when an action binding resolves with `onSuccess: { navigate: "/path" }`. The resolved path string is passed as the sole argument. Mirrors the `navigate` prop in `ActionProvider` from the framework renderers, where it is captured in the `execute()` closure. Also available to component implementations directly via `ctx.ctx.navigate` for cases where navigation needs to be triggered outside of an action binding. **Example** `import { useNavigate } from "my-router"; const navigate = useNavigate(); renderSpec(spec, store, registry, { navigate });` Spec binding that triggers navigation: `{ "on": { "click": { "action": "doSomething", "onSuccess": { "navigate": "/dashboard" } } } }` | [`UIProviderOptions`](UIProviderOptions.md).[`navigate`](UIProviderOptions.md#property-navigate) | - |
32
- | <a id="property-onconfirm"></a> `onConfirm?` | [`ConfirmHandler`](../type-aliases/ConfirmHandler.md) | Confirmation hook for actions that declare `confirm` in their binding. Consulted by `emit()` before executing a confirm-gated action. Return (or resolve) `true` to execute, `false` to skip. Without this handler, confirm-gated actions are skipped with a `console.warn` — they never execute unconfirmed. See [ConfirmHandler](../type-aliases/ConfirmHandler.md) for the full contract. This is the headless equivalent of the `pendingConfirmation` / `confirmAction()` / `cancelAction()` flow in the framework adapters. | [`UIProviderOptions`](UIProviderOptions.md).[`onConfirm`](UIProviderOptions.md#property-onconfirm) | - |
33
- | <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) | Unified error handler for component render errors and action handler rejections. Matches `RenderErrorHandler = (error: unknown, name: string) => void`. Invoked for three distinct error classes: - `(error, elementType)` when a component renderer throws synchronously during `renderSpec` - `(error, actionName)` when an action handler rejects during `emit()` (on-event path) - `(error, actionName)` when an action handler rejects during a `watch` binding callback When provided, suppresses the `console.error` fallback for all three error types. Forwarded into `renderSpec` as the `onRenderError` parameter and into `DomRenderContext.onRenderError` so both `emit()` and `watch` handlers route their errors through the same channel as component render errors. **Example** `renderSpec(spec, store, registry, { onRenderError: (err, name) => { myErrorReporter.capture(err, { context: name }); }, });` | [`UIProviderOptions`](UIProviderOptions.md).[`onRenderError`](UIProviderOptions.md#property-onrendererror) | - |
34
- | <a id="property-validationfunctions"></a> `validationFunctions?` | `Record`\<`string`, (`value`, `args?`) => `boolean`\> | Custom validation functions for inline field validation. Each function receives `(value, args?)` and returns `true` (valid) or `false` (invalid). Functions are available to component implementations via `ctx.ctx.validationFunctions` and should be passed as `customFunctions` to `runValidationCheck` / `runValidation` from `@xmachines/json-render-core`. Mirrors `customFunctions` in `ValidationProvider` from the framework renderers. The DOM renderer has no automatic `ValidationProvider` tree validation must be invoked explicitly by component implementations. **Example** `import { runValidationCheck } from "@xmachines/json-render-core"; renderSpec(spec, store, registry, { validationFunctions: { isEven: (value) => typeof value === "number" && value % 2 === 0, phoneNumber: (value) => /^\+?[\d\s\-()]{7,}$/.test(String(value)), }, }); // Inside a ComponentFn: const MyField: ComponentFn<typeof catalog, "MyField"> = ({ ctx }) => { const result = runValidationCheck( { type: "isEven", message: "must be even" }, { value: someValue, stateModel: {}, customFunctions: ctx.ctx.validationFunctions }, ); // result.valid, result.message };` | [`UIProviderOptions`](UIProviderOptions.md).[`validationFunctions`](UIProviderOptions.md#property-validationfunctions) | - |
31
+ | Property | Type | Description | Inherited from | Defined in |
32
+ | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
33
+ | <a id="property-directives"></a> `directives?` | `DirectiveDefinition`\<`ZodType`\<`unknown`, `unknown`, `$ZodTypeInternals`\<`unknown`, `unknown`\>\>\>[] | Custom directives — user-defined `$`-prefixed dynamic values that extend the spec expression language (e.g. `{ $format: "currency", value: ... }`). Each entry is a `DirectiveDefinition` built with `defineDirective` from `@xmachines/json-render-core`. The array is converted to a `DirectiveRegistry` once per render pass and forwarded to `resolveElementProps` via `PropResolutionContext.directives`. Built-in expressions (`$state`, `$cond`, etc.) always take precedence over custom directives. Mirrors the `directives` prop on `JSONUIProvider` / `JsonUIProvider` introduced in **Json-render** 0.19. **Example** `import { defineDirective, resolvePropValue } from "@xmachines/json-render-core"; import { z } from "zod"; const formatDirective = defineDirective({ name: "$format", description: "Locale-aware number formatting.", schema: z.object({ $format: z.enum(["number", "currency"]), value: z.unknown() }), resolve(value, ctx) { const resolved = resolvePropValue(value.value, ctx); return new Intl.NumberFormat().format(resolved as number); }, }); renderSpec(spec, store, registry, { directives: [formatDirective] });` | [`UIProviderOptions`](UIProviderOptions.md).[`directives`](UIProviderOptions.md#property-directives) | - |
34
+ | <a id="property-fallback"></a> `fallback?` | `HTMLElement` \| (() => `HTMLElement`) \| `null` | The optional fallback content — see [PlayDomOptions.fallback](PlayDomOptions.md#property-fallback) for what the renderer does with it. The factory shows it for every null view, and after a failure of a rebuild that the renderer contains. **Give a FUNCTION when the factory mounts more than one time.** ONE factory serves every `mount()` call, and `appendChild` MOVES a node. A single element therefore passes from one container to the next on every null view, and the container that loses it goes empty without a notice. A function runs one time for each mount, so every renderer owns its own element: `const mount = createPlayUI(registryResult, { fallback: () => { const element = document.createElement("p"); element.textContent = "Loading…"; return element; }, });` An element stays correct for a factory that mounts one time. | - | [packages/play-dom/src/types.ts:176](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/types.ts#L176) |
35
+ | <a id="property-functions"></a> `functions?` | `Record`\<`string`, `ComputedFunction`\> | Named compute functions for `{ $computed: "name", args: {...} }` prop expressions. Each function receives the resolved `args` object and returns the computed value. Forwarded directly to `resolveElementProps` via `PropResolutionContext.functions`, matching the `FunctionsContext` provider in the framework renderers. Without this option, `$computed` expressions resolve to `undefined` (no throw). **Example** `renderSpec(spec, store, registry, { functions: { fullName: (args) => `${args.first} ${args.last}`, formatCurrency: (args) => new Intl.NumberFormat().format(args.amount as number), }, });` Mirrors the `functions` prop on `JSONUIProvider` / `JsonUIProvider`. | [`UIProviderOptions`](UIProviderOptions.md).[`functions`](UIProviderOptions.md#property-functions) | - |
36
+ | <a id="property-navigate"></a> `navigate?` | (`path`) => `void` | Programmatic navigation function. Called automatically when an action binding resolves with `onSuccess: { navigate: "/path" }`. The resolved path string is passed as the sole argument. Mirrors the `navigate` prop in `ActionProvider` from the framework renderers, where it is captured in the `execute()` closure. Also available to component implementations directly via `ctx.ctx.navigate` for cases where navigation needs to be triggered outside of an action binding. **Example** `import { useNavigate } from "my-router"; const navigate = useNavigate(); renderSpec(spec, store, registry, { navigate });` Spec binding that triggers navigation: `{ "on": { "click": { "action": "doSomething", "onSuccess": { "navigate": "/dashboard" } } } }` | [`UIProviderOptions`](UIProviderOptions.md).[`navigate`](UIProviderOptions.md#property-navigate) | - |
37
+ | <a id="property-onconfirm"></a> `onConfirm?` | [`ConfirmHandler`](../type-aliases/ConfirmHandler.md) | Confirmation hook for actions that declare `confirm` in their binding. Consulted by `emit()` before executing a confirm-gated action. Return (or resolve) `true` to execute, `false` to skip. Without this handler, confirm-gated actions are skipped with a `console.warn` — they never execute unconfirmed. See [ConfirmHandler](../type-aliases/ConfirmHandler.md) for the full contract. This is the headless equivalent of the `pendingConfirmation` / `confirmAction()` / `cancelAction()` flow in the framework adapters. | [`UIProviderOptions`](UIProviderOptions.md).[`onConfirm`](UIProviderOptions.md#property-onconfirm) | - |
38
+ | <a id="property-onerror"></a> `onError?` | (`error`, `reset`) => `void` | The optional handler of a failure of a complete rebuild of the view. This option is NOT the same as `onRenderError`, which [UIProviderOptions](UIProviderOptions.md) gives: the inner renderer routes a render error of one component, and a rejection of one action handler, to `onRenderError`. It contains each of them per element, and the rebuild continues. `onError` receives the failure of the complete rebuild that no per-element boundary caught. The renderer CONTAINS a rebuild that throws, with this option and without it: it resets the state of the failed rebuild, so that the next emission makes a complete render again, and it clears the container. `connect()` renders the first view synchronously, so a bad initial view makes `connect()` throw no more. A WRITE of the store takes the same path. The renderer resolves the props of every element that the write touched, so a `$computed` function that throws on the new state aborts that render too. The renderer contains such a failure as well, and the action handler that wrote the state receives no exception. This option says WHERE the report goes. Without it, the renderer writes the contained failure to `console.error`. A handler that THROWS reaches no caller: the renderer contains that throw too, and it writes the throw to `console.error`. A host that must escalate a failure raises it from a task of its own — `queueMicrotask(() => { throw error; })` which reaches the global handler of the page and leaves the containment whole. The five renderers hold this one rule. The second parameter is the RESET, for a retry that the host starts — a "Retry" button of its own. It renders the view that the actor holds at the MOMENT OF THE CALL, so a host that keeps the callback cannot rewind the screen to the view that failed. A reset that the host calls from inside this handler does nothing, because no input changed between the two attempts, and a reset after `disconnect()` does nothing. A reset belongs to ONE connection. `connect()` starts a connection, and the reset of a report of an older connection does nothing. A host that calls `connect()` again from inside this handler abandons the connection that reported. The "Retry" button of that report must not render into the connection that took its place. Call the reset of the newest report. This option matches the `onError` prop of the framework renderer providers, and the five renderers hold the same three rules for the reset. | [`PlayDomOptions`](PlayDomOptions.md).[`onError`](PlayDomOptions.md#property-onerror) | [packages/play-dom/src/types.ts:100](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/types.ts#L100) |
39
+ | <a id="property-onrendererror"></a> `onRenderError?` | [`RenderErrorHandler`](../type-aliases/RenderErrorHandler.md) | Unified error handler for component render errors and action handler rejections. Matches `RenderErrorHandler = (error: unknown, name: string) => void`. Invoked for three distinct error classes: - `(error, elementType)` when a component renderer throws synchronously during `renderSpec` - `(error, actionName)` when an action handler rejects during `emit()` (on-event path) - `(error, actionName)` — when an action handler rejects during a `watch` binding callback When provided, suppresses the `console.error` fallback for all three error types. Forwarded into `renderSpec` as the `onRenderError` parameter and into `DomRenderContext.onRenderError` so both `emit()` and `watch` handlers route their errors through the same channel as component render errors. **Example** `renderSpec(spec, store, registry, { onRenderError: (err, name) => { myErrorReporter.capture(err, { context: name }); }, });` | [`UIProviderOptions`](UIProviderOptions.md).[`onRenderError`](UIProviderOptions.md#property-onrendererror) | - |
40
+ | <a id="property-validationfunctions"></a> `validationFunctions?` | `Record`\<`string`, (`value`, `args?`) => `boolean`\> | Custom validation functions for inline field validation. Each function receives `(value, args?)` and returns `true` (valid) or `false` (invalid). Functions are available to component implementations via `ctx.ctx.validationFunctions` and should be passed as `customFunctions` to `runValidationCheck` / `runValidation` from `@xmachines/json-render-core`. Mirrors `customFunctions` in `ValidationProvider` from the framework renderers. The DOM renderer has no automatic `ValidationProvider` tree — validation must be invoked explicitly by component implementations. **Example** `import { runValidationCheck } from "@xmachines/json-render-core"; renderSpec(spec, store, registry, { validationFunctions: { isEven: (value) => typeof value === "number" && value % 2 === 0, phoneNumber: (value) => /^\+?[\d\s\-()]{7,}$/.test(String(value)), }, }); // Inside a ComponentFn: const MyField: ComponentFn<typeof catalog, "MyField"> = ({ ctx }) => { const result = runValidationCheck( { type: "isEven", message: "must be even" }, { value: someValue, stateModel: {}, customFunctions: ctx.ctx.validationFunctions }, ); // result.valid, result.message };` | [`UIProviderOptions`](UIProviderOptions.md).[`validationFunctions`](UIProviderOptions.md#property-validationfunctions) | - |
@@ -2,17 +2,18 @@
2
2
 
3
3
  # Interface: MountOptions
4
4
 
5
- Defined in: [packages/play-dom/src/create-play-ui.ts:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-dom/src/create-play-ui.ts#L49)
5
+ Defined in: [packages/play-dom/src/create-play-ui.ts:51](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/create-play-ui.ts#L51)
6
6
 
7
7
  The mount options of the `MountFn` that `createPlayUI` returns.
8
8
 
9
9
  They replace or complete the factory options, for one actor and one container.
10
10
  The `createPlayUI` call sets the factory options (`functions`,
11
- `validationFunctions`, `navigate`, `onRenderError`, and `fallback`) one time.
11
+ `validationFunctions`, `navigate`, `onRenderError`, `onError`, and `fallback`) one
12
+ time.
12
13
 
13
14
  ## Properties
14
15
 
15
16
  | Property | Type | Description | Defined in |
16
17
  | ---------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
17
- | <a id="property-loading"></a> `loading?` | `boolean` | With the value `true`, the renderer stops each warning about an absent child during the ingestion of a streaming spec. It also gives `ctx.ctx.loading` to each component implementation. | [packages/play-dom/src/create-play-ui.ts:61](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-dom/src/create-play-ui.ts#L61) |
18
- | <a id="property-store"></a> `store?` | `StateStore` | The optional external `StateStore`, which is the controlled mode. Without it, the renderer makes a new `@xstate/store` atom for each view transition, with the values of `spec.state`. | [packages/play-dom/src/create-play-ui.ts:55](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v2.2.0/packages/play-dom/src/create-play-ui.ts#L55) |
18
+ | <a id="property-loading"></a> `loading?` | `boolean` | With the value `true`, the renderer stops each warning about an absent child during the ingestion of a streaming spec. It also gives `ctx.ctx.loading` to each component implementation. | [packages/play-dom/src/create-play-ui.ts:63](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/create-play-ui.ts#L63) |
19
+ | <a id="property-store"></a> `store?` | `StateStore` | The optional external `StateStore`, which is the controlled mode. Without it, the renderer makes a new `@xstate/store` atom for each view transition, with the values of `spec.state`. | [packages/play-dom/src/create-play-ui.ts:57](https://gitlab.com/xmachin-es/xmachines-js/-/blob/v3.0.0/packages/play-dom/src/create-play-ui.ts#L57) |