xstate
5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed
Upgrading xstate From 5.13.2 to 5.33.4
45 releases in betweenevery note read
Reading releases, release notes and advisories…
- 1
- change to make
- 0
- advisories fixed
- 30
- new
- 29
- fixes
Before you upgrade
Tick each one off as you go- Breaking5.19.4
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
- 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.stringifyon the event, which could throw and mask the intended warning. The warning is now emitted safely regardless of the event's contents.
- Fixed
- Fixed
Fixed a bug where targeting a history state that is a direct child of a
parallelstate 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.
- Fixed
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.