# XState 6.0.0-alpha.1 - Product: XState (https://whatsnew.fyi/product/xstate) - Vendor: Stately - Date: 2026-06-20 - Version: 6.0.0-alpha.1 - Original notes: https://github.com/statelyai/xstate/releases/tag/xstate%406.0.0-alpha.1 - Permalink: https://whatsnew.fyi/product/xstate/releases/6.0.0-alpha.1 - 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** — Invoked and spawned actors now start as part of the transition that creates them via an internal deferred start action instead of being started directly by actor.start() - **changed** — Child failures that occur synchronously while starting now surface through the invoking state's onError transition instead of throwing out of actor.start() - **removed** — Remove action and guard creators: assign, raise, sendTo, sendParent, forwardTo, emit, log, cancel, spawnChild, stop, stopChild, enqueueActions, and guard creators and, or, not, stateIn - **changed** — Actions, guards, and transitions are now plain inline functions that receive args and an enqueue object for side effects - **changed** — Update context by returning a partial or full context patch instead of using assign - **changed** — Perform side effects through the enqueue object with methods: raise, sendTo, emit, log, cancel, spawn, stop, and arbitrary effects via enq(fn, ...args) - **changed** — Guards are now plain functions that return a boolean instead of using guard creators - **changed** — Replace stateIn guard by checking the snapshot directly using snapshot.matches() inside a transition function - **added** — Export checkStateIn(snapshot, '#id') helper for matching state by id - **removed** — Remove deprecated interpret function and Interpreter type - **changed** — Use createActor(machine) and Actor type instead of interpret(machine) and Interpreter - **changed** — Replace schemas as the primary way to type a machine, supporting Standard Schema (Zod, Valibot, etc) for both type inference and runtime validation - **changed** — schemas.events is now a map of event-type to payload schema instead of a union type - **changed** — schemas.context types context values with literal initial values widened for update typechecking - **changed** — schemas.input types createActor(machine, { input }) and the context initializer argument - **changed** — schemas.output types snapshot.output - **changed** — schemas.emitted types actor.on() callbacks with emitted event payloads - **changed** — schemas.tags constrains snapshot.hasTag() parameter values - **changed** — schemas.meta types state meta values - **changed** — Move actors, actions, guards, and delays to top-level config keys instead of schemas keys ###### Major Changes - [#44](https://github.com/balrog-typescript/xstate/pull/44) [`52970ea`](https://github.com/statelyai/xstate/commit/52970ea75489305fd7bf1223f9b413770cd6d925) Thanks [@pull](https://github.com/apps/pull)! - Invoked and spawned actors are no longer started directly by `actor.start()`. They now start as part of the transition that creates them (via an internal deferred start action), the same way other entry effects run. The user-visible consequence: a child that fails synchronously while starting now surfaces that failure through the invoking state's `onError` transition instead of throwing out of `actor.start()`: ```ts const machine = createMachine({ initial: 'loading', states: { loading: { invoke: { src: createAsyncLogic({ run: () => { throw new Error('boom'); // sync failure on start } }), onError: 'failed' } }, failed: {} } }); const actor = createActor(machine).start(); // does not throw actor.getSnapshot().value; // 'failed' ``` Restored (rehydrated) children that were active when a snapshot was persisted are still restarted on `actor.start()`, so persistence behavior is unchanged. - [#44](https://github.com/balrog-typescript/xstate/pull/44) [`52970ea`](https://github.com/statelyai/xstate/commit/52970ea75489305fd7bf1223f9b413770cd6d925) Thanks [@pull](https://github.com/apps/pull)! - Actions, guards, and transitions are now plain inline functions, and the v5 action/guard creators are removed. Removed exports: `assign`, `raise`, `sendTo`, `sendParent`, `forwardTo`, `emit`, `log`, `cancel`, `spawnChild`, `stop`, `stopChild`, `enqueueActions`, and the guard creators `and`, `or`, `not`, `stateIn`. Instead, a transition/action/guard is a function `(args, enq) => ...`: - Update context by **returning** a partial-or-full `{ context }` patch (no more `assign`). - Perform side effects through the `enq` enqueue object: `enq.raise`, `enq.sendTo`, `enq.emit`, `enq.log`, `enq.cancel`, `enq.spawn`, `enq.stop`, plus `enq(fn, ...args)` for arbitrary effects. - Guards are just functions that return a boolean (or `undefined`/`false` to block). ```diff - import { assign, raise, sendTo, and, not } from 'xstate'; const machine = createMachine({ context: { count: 0 }, on: { - INC: { - guard: and([not('isMax'), 'isReady']), - actions: assign({ count: ({ context }) => context.count + 1 }) - } + INC: ({ context, guards }) => { + if (guards.isMax(context) || !guards.isReady(context)) return; + return { context: { count: context.count + 1 } }; + } } }); ``` The `stateIn` guard is replaced by checking the snapshot directly — use `snapshot.matches(...)` inside a transition function: ```ts on: { CHECK: ({ self }) => { if (self.getSnapshot().matches({ b: 'b2' })) { return { target: 'a2' }; } }; } ``` For matching by state **id** (the `'#id'` form, which `matches()` doesn't resolve), the exported `checkStateIn(snapshot, '#id')` helper is also available. - [#44](https://github.com/balrog-typescript/xstate/pull/44) [`52970ea`](https://github.com/statelyai/xstate/commit/52970ea75489305fd7bf1223f9b413770cd6d925) Thanks [@pull](https://github.com/apps/pull)! - Remove the deprecated `interpret` function and `Interpreter` type. Use `createActor(...)` and `Actor` (or `ActorRefFrom<...>`) instead. ```diff - import { interpret, type Interpreter } from 'xstate'; - const actor = interpret(machine); + import { createActor, type Actor } from 'xstate'; + const actor = createActor(machine); ``` - [#44](https://github.com/balrog-typescript/xstate/pull/44) [`52970ea`](https://github.com/statelyai/xstate/commit/52970ea75489305fd7 _[Truncated at 4000 characters — full notes: https://github.com/statelyai/xstate/releases/tag/xstate%406.0.0-alpha.1]_