Packages

xstate

5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed

Upgrading xstate From 4.35.3 to 5.33.4

83 releases in betweenevery note read

Reading releases, release notes and advisories…

Other targets from 4.35.3Newest 4.x4.38.3
  1. 4.35.3yours
  2. 9 releases
  3. 5.0.0major
  4. 16 releases
  5. 5.7.1breaking
  6. 26 releases
  7. 5.19.4breaking
  8. 28 releases
  9. 5.33.4target
  10. 30 pre

Before you upgrade

Tick each one off as you go
  • Breaking5.19.4
  • Breaking5.7.1
  • Breaking5.0.0
  • Breaking5.0.0
  • Breaking5.0.0
  • Breaking5.0.0
  • Breaking5.0.0
  • Breaking5.0.0
  • Breaking5.0.0
  • Breaking5.0.0

Release by release

  1. 5.33.4

    7 Nov 20261 fix
    • Fixed

      core: Fix assertEvent narrowing when the event type is behind a generic type parameter

  2. 5.33.3

    17 Oct 20261 fix
    • Fixed

      Fixed child actors not being stopped when a machine errors because of an unhandled error from an invoked actor. The remaining invoked and spawned actors are now stopped (and their cleanup functions are called) before the machine settles in the error state, instead of being left running as orphans.

  3. 5.33.2

    15 Sep 20261 fix
    • Fixed

      Fixed metadata types in generic history values, snapshot nodes, and directed graph results. These containers now accept arbitrary state and transition metadata consistently with AnyStateNode and AnyTransitionDefinition, avoiding unsafe-type warnings when inspecting machines through generic APIs.

  4. 5.33.1

    15 Sep 20261 fix
    • Fixed

      AnyStateNode and AnyStateNodeDefinition now widen the TStateMeta and TTransitionMeta parameters that were added to StateNode and StateNodeDefinition in 5.33.0. Those parameters default to MetaObject, while the nodes of an AnyStateMachine have them as any, so tooling that tracks any (such as @typescript-eslint's no-unsafe-argument and no-unsafe-return) reported every node read off an untyped machine as unsafe:

  5. 5.33.0

    12 Sep 20261 new
    • New

      State and transition metadata can now use separate types:

  6. 5.32.6

    25 Aug 20261 fix
    • Fixed

      Machine snapshots now retain their machine-specific methods when initialization fails, so methods such as snapshot.matches(...) remain available on error snapshots.

  7. 5.32.5

    14 Jul 20261 fix
    • Fixed

      Sending an event to a stopped actor no longer throws when the event contains unserializable data (e.g. circular references). Previously, the development-only warning that an event was sent to a stopped actor used JSON.stringify on the event, which could throw and mask the intended warning. The warning is now emitted safely regardless of the event's contents.

  8. 5.32.4

    2 Jul 20261 fix
    • Fixed

      Fixed a bug where targeting a history state that is a direct child of a parallel state would silently do nothing when that parallel state had not been visited yet and the history state had no default target. The machine now enters the parallel state's initial configuration, matching the behavior of history states inside compound states.

17 other lines we could not sort, mostly version bumps
  • status: 'active' | 'done' | 'error' | 'stopped'

    5.0.0
  • output: The output data of the actor when it has reached status: 'done'

    5.0.0
  • error: The error thrown by the actor when it has reached status: 'error'

    5.0.0
  • context: The context of the actor

    5.0.0
  • and([guard1, guard2, /* ... */]) returns true if all guards evaluate to truthy, otherwise false

    5.0.0
  • or([guard1, guard2, /* ... */]) returns true if any guard evaluates to truthy, otherwise false

    5.0.0
  • not(guard1) returns true if a single guard evaluates to false, otherwise true

    5.0.0
  • An event object (e.g. { type: 'someEvent' })

    5.0.0
  • An SCXML event object.

    5.0.0
  • ✅ "*"

    5.0.0

6 internal lines (docs, tests, tooling) left out.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.