The SolidJS rendering layer observes the actor signals and renders the UI components through @xmachines/json-render-solid. SolidJS reactivity only triggers the re-render. The TC39 Signals are the source of truth.
PlayUIProvider is the standard entry point. It wraps ActorProvider and JSONUIProvider into one composite provider. PlayRenderer is a leaf component without props. It reads the view context and renders the current spec.
Read the fields where you use them, and destructure them not.spec, fallback
and loading are GETTERS on the context object. The provider keeps the subtree across
an emission that holds the viewKey, so it publishes a new spec through the getter
instead of building the tree again — which is what keeps the focus and the caret of an
input alive while a stream writes into the view.
// ✅ The Renderer reads `view.spec` inside its own tracking scope, so it follows.
// ❌ The value freezes at the first render, and the screen stops following the actor.
const { spec } = usePlayView();
This changed in 2.3.0. Before it, every emission built the subtree again, so a
value that a component read one time was fresh because the component itself was new.
API Summary
Components
Export
Description
PlayUIProvider
The composite provider. Use it as the standard entry point
PlayRenderer
The leaf component without props. It renders the current view spec inside a provider tree
ActorProvider
The low-level provider for a custom provider composition
Hooks
Export
Description
useActor()
Returns the raw AnyPlayActor instance from the context. It throws outside a provider tree
usePlayView()
Returns the current ViewContextValue (spec, handlers, registry, store). Read the fields where you use them: spec, fallback and loading are getters. It throws outside the tree
Context
Export
Description
ActorContext
The SolidJS context of the actor. Use ActorContext.Provider directly for a custom composition
Re-exports from @xmachines/json-render-solid
This package re-exports the complete @xmachines/json-render-solid public API, so that a consumer does not need a direct dependency:
import {
// Providers
JSONUIProvider,
StateProvider,
ActionProvider,
VisibilityProvider,
ValidationProvider,
// Renderer
Renderer,
// Registry factory + hooks
defineRegistry,
useBoundProp,
useStateBinding,
useStateValue,
useStateStore,
useActions,
useAction,
useIsVisible,
useFieldValidation,
useOptionalValidation,
useVisibility,
} from"@xmachines/play-solid";
Key Types
Type
Description
PlayUIProviderProps
Props for PlayUIProvider
ActorProviderProps
Props for ActorProvider
ViewContextValue
Shape of the context value from usePlayView()
AnyPlayActor
AbstractActor<AnyActorLogic> — the bare actor type that the context providers accept
Testing
Run tests for this package in isolation:
Terminal window
pnpm--filter@xmachines/play-solidtest
Or from within the package directory:
Terminal window
pnpmtest# single run (jsdom environment)
pnpmruntest:watch# watch mode
pnpmruntest:ui# interactive Vitest UI
The v8 provider collects the coverage, with a threshold of 80% for lines, functions, branches, and statements. The browser tests are in test/browser/. The default jsdom run excludes them.
License
MIT
@xmachines/play-solid - SolidJS renderer for the XMachines Play architecture
This package is the SolidJS rendering layer. It observes the actor signals and
renders the UI components through @xmachines/json-render-solid. SolidJS
reactivity only triggers the re-render. The signals are the source of truth.