Packages

xstate

5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed

Upgrading xstate From 4.38.3 to 5.0.0

1 release in betweenevery note read

Reading releases, release notes and advisories…

Other targets from 4.38.3Latest5.33.4
  1. 4.38.3yours
  2. 5.0.0target
  3. 30 pre

Before you upgrade

Tick each one off as you go
  • Breaking5.0.0
  • Breaking5.0.0
  • 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.0.0

    Migration needed1 Dec 202335 new · 6 fixes
    • Breaking

      If context types are specified in the machine config, the context property will now be required:

    • Breaking

      The third argument of machine.transition(state, event) has been removed. The context should always be given as part of the state.

    • Breaking

      An error will be thrown if an initial state key is not specified for compound state nodes. For example:

    • Breaking

      IDs for delayed events are no longer derived from event types so this won't work automatically:

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

5 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.