# XState 6.0.0-alpha.40 - Product: XState (https://whatsnew.fyi/product/xstate) - Vendor: Stately - Date: 2026-08-17 - Version: 6.0.0-alpha.40 - Original notes: https://github.com/statelyai/xstate/releases/tag/xstate%406.0.0-alpha.40 - Permalink: https://whatsnew.fyi/product/xstate/releases/6.0.0-alpha.40 - 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** — Represent historical machine versions with Standard Schema snapshot and event descriptors instead of retaining their executable machines, with versioned machines exposing the same snapshotSchema and eventSchema interface - **changed** — Machine-backed snapshot schemas now default omitted history and timer records during migration - **fixed** — actor.getPersistedSnapshot() is now typed to the actor's logic so persist/restore round-trips through createActor(logic, { snapshot }) no longer require a cast ###### Minor Changes - 107d0c2: Represent historical machine versions with Standard Schema snapshot and event descriptors instead of retaining their executable machines. Versioned machines expose the same `snapshotSchema` and `eventSchema` interface. Machine-backed snapshot schemas default omitted history and timer records during migration. ```ts const versions = machineVersions([ { id: 'checkout', version: '1', snapshotSchema: checkoutV1Snapshot, eventSchema: checkoutV1Event }, checkoutV2 ]); const snapshot = await versions.migrateSnapshot(persisted, { to: '2', migrations: { '1': (snapshot) => ({ ...snapshot, context: { total: snapshot.context.count } }) } }); ``` ###### Patch Changes - 2e77ff6: `actor.getPersistedSnapshot()` is now typed to the actor’s logic, so persist/restore round-trips through `createActor(logic, { snapshot })` no longer require a cast. Restoring a snapshot into a machine with a different `id` is a type error, while snapshots from other versions of the same machine remain assignable (for runtime migration via `migrate`). ```ts const actor = createActor(machine).start(); const snapshot = actor.getPersistedSnapshot(); // No cast needed: const restored = createActor(machine, { snapshot }).start(); ```