# XState 6.0.0-alpha.4 - Product: XState (https://whatsnew.fyi/product/xstate) - Vendor: Stately - Date: 2026-06-23 - Version: 6.0.0-alpha.4 - Original notes: https://github.com/statelyai/xstate/releases/tag/xstate%406.0.0-alpha.4 - Permalink: https://whatsnew.fyi/product/xstate/releases/6.0.0-alpha.4 - Labels: Pre-release What's New is an index, not a publisher: every entry below links to the vendor's own release notes, which are the authoritative source. Entries are labelled where they are hand-curated sample data, pre-releases, or drawn from a secondary source such as a developer blog. Reuse: the summaries, labels and curation here are © What's New. Quote freely with attribution and a link back; wholesale republication of the corpus is not permitted — terms: https://whatsnew.fyi/terms. The vendors' own release notes remain their publishers'. --- - **changed** — Actor logic now returns effects from both regular and initial transitions, with transition(...) and initialTransition(...) returning [snapshot, effects] tuples - **added** — Add schemas.children for explicitly typing child actor refs by child ID with declared child refs type, child snapshots, and invoke configs - **added** — Add isBuiltInExecutableAction(...) to narrow executable effects to XState's built-in effect union for declarative inspection - **changed** — Built-in executable effects now expose stable named metadata fields accessible via effect.type including @xstate.start, @xstate.sendTo, @xstate.raise, and @xstate.stop - **changed** — fromStore(...) effects now run after the actor snapshot is committed so effect callbacks read the updated snapshot from enqueue.getSnapshot() ###### Major Changes - c3f7a9d: Actor logic now returns effects from both regular and initial transitions. Hand-written actor logic should return `[snapshot, effects]` from `transition(...)` and provide `initialTransition(...)` for creating the initial `[snapshot, effects]` tuple. `getInitialSnapshot(...)` remains available for snapshot-only reads. ```ts const logic = { transition: (snapshot, event) => [snapshot, []], initialTransition: (input, _scope) => [ { status: 'active', output: undefined, error: undefined, input }, [] ], getInitialSnapshot: (scope, input) => logic.initialTransition(input, scope)[0] }; ``` `transition(...)` and `initialTransition(...)` continue to return `[snapshot, actions]` for machine logic. `fromStore(...)` effects now run after the actor snapshot is committed, so effect callbacks read the updated snapshot from `enqueue.getSnapshot()`. - 309b106: Add `schemas.children` for explicitly typing child actor refs by child ID. Declared child refs type `children.someId`, child snapshots, and invoke configs so `invoke: { id: 'someId', src }` must match the declared child actor contract. - fa2bbf0: Built-in executable effects returned from `transition(...)` and `initialTransition(...)` are now easier to inspect declaratively. Use `isBuiltInExecutableAction(effect)` to narrow an executable effect to XState's built-in effect union, then switch on `effect.type` to access stable, named metadata fields: ```ts const [snapshot, effects] = initialTransition(machine); for (const effect of effects) { if (!isBuiltInExecutableAction(effect)) { continue; } switch (effect.type) { case '@xstate.start': effect.id; effect.logic; effect.src; effect.input; break; case '@xstate.sendTo': effect.target; effect.event; effect.delay; break; case '@xstate.raise': effect.event; effect.delay; break; } } ``` The built-in stop effect is now exposed as `@xstate.stop`, matching `@xstate.start`.