xstate
5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed
Upgrading xstate From 4.38.3 to 5.33.4
74 releases in betweennotes for 27
Reading releases, release notes and advisories…
- 100+
- changes to make
- 0
- advisories fixed
- 64+
- new
- 16+
- fixes
Counted from 27 of 74 release notes, and the breaking changes of 1 pre-release on the way to a major. Advisories are counted from the advisory database, in full.
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
- Fixed
core: Fix
assertEventnarrowing when the event type is behind a generic type parameter
- Fixed
- 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.
- Fixed
- 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
AnyStateNodeandAnyTransitionDefinition, avoiding unsafe-type warnings when inspecting machines through generic APIs.
- Fixed
- Fixed
AnyStateNodeandAnyStateNodeDefinitionnow widen theTStateMetaandTTransitionMetaparameters that were added toStateNodeandStateNodeDefinitionin 5.33.0. Those parameters default toMetaObject, while the nodes of anAnyStateMachinehave them asany, so tooling that tracksany(such as@typescript-eslint'sno-unsafe-argumentandno-unsafe-return) reported every node read off an untyped machine as unsafe:
- Fixed
- New
State and transition metadata can now use separate types:
- New
- Fixed
Machine snapshots now retain their machine-specific methods when initialization fails, so methods such as
snapshot.matches(...)remain available on error snapshots.
- Fixed
5.32.1 – 5.32.55 releases, no release note
- New
Export
InspectedTransitionEventfromxstate.
- New
17 other lines we could not sort, mostly version bumps
- 5.0.0
status:'active' | 'done' | 'error' | 'stopped' - 5.0.0
output: The output data of the actor when it has reachedstatus: 'done' - 5.0.0
error: The error thrown by the actor when it has reachedstatus: 'error' - 5.0.0
context: The context of the actor - 5.0.0
and([guard1, guard2, /* ... */])returnstrueif all guards evaluate to truthy, otherwisefalse - 5.0.0
or([guard1, guard2, /* ... */])returnstrueif any guard evaluates to truthy, otherwisefalse - 5.0.0
not(guard1)returnstrueif a single guard evaluates tofalse, otherwisetrue - 5.0.0
An event object (e.g.
{ type: 'someEvent' }) - 5.0.0
An SCXML event object.
- 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.