xstate
5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed
201 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
5.33.4
7 Nov 2026Summary· from the note as AI read it
Read before upgrading: 1 change to make.
Patch Changes
core: Fix
assertEventnarrowing when the event type is behind a generic type parameterPreviously, calling
assertEventinside a function whose event parameter was typed with a generic (e.g.function f<TEvent extends SomeEventUnion>(event: TEvent)) would compile, but every property access oneventafterward would fail to type-check with a "Property does not exist" error. This is now fixed -assertEventnarrows generic event parameters the same way it narrows concrete ones, while still rejecting invalid event descriptors at compile time.assertEventalso keeps narrowing events whosetypefield is a union of literals (e.g.{ type: 'a' | 'b'; value: string }) when asserting one of those literals, for both concrete and generic event parameters.Partial wildcard descriptors now preserve the bare prefix event in the narrowed type, matching runtime behavior. For example,
assertEvent(event, 'FEEDBACK.*')keeps bothFEEDBACKandFEEDBACK.GOOD, so accessing a payload specific toFEEDBACK.GOODrequires further narrowing. This also applies toExtractEventand event types inferred for partial wildcard transitions.
5.33.3
17 Oct 2026Fixed 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.
5.33.2
15 Sep 2026Fixed 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.
5.33.1
15 Sep 2026AnyStateNodeandAnyStateNodeDefinitionnow 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:declare const machine: AnyStateMachine; // StateNode<any, any, any, any> passed to StateNode<any, any, MetaObject, MetaObject> takesStateNode(machine.root);
AnyTransitionDefinitionwas widened along with the new parameters; these two were missed.
5.33.0
12 Sep 2026State and transition metadata can now use separate types:
const machine = setup({ types: { meta: {} as { label: string }, transitionMeta: {} as { trackingId: number } } }).createMachine({ meta: { label: 'Root' }, on: { NEXT: { meta: { trackingId: 42 } } } });When
transitionMetais omitted,types.metacontinues to apply its type to
both state and transition metadata.
5.32.6
25 Aug 2026Machine snapshots now retain their machine-specific methods when initialization fails, so methods such as
snapshot.matches(...)remain available on error snapshots.
5.32.5
14 Jul 2026Reading the note…
5.32.4
2 Jul 2026Reading the note…
5.32.3
1 Jul 2026Reading the note…
5.32.2
23 Jun 2026Reading the note…
5.32.1
12 Jun 2026Reading the note…
5.32.0
27 May 2026Reading the note…
5.31.1
10 May 2026Reading the note…
5.31.0
27 Apr 2026Reading the note…
5.30.0
28 Mar 2026Reading the note…
5.29.0
24 Mar 2026Reading the note…
5.28.0
12 Feb 2026Reading the note…
5.27.0
11 Feb 2026Reading the note…
5.26.0
26 Jan 2026Reading the note…
5.25.1
15 Jan 2026Reading the note…
5.25.0
10 Dec 2025Reading the note…
5.24.0
3 Nov 2025Reading the note…
5.23.0
11 Oct 2025Reading the note…
5.22.1
2 Oct 2025Reading the note…
5.22.0
18 Sep 2025Reading the note…
5.21.0
30 Aug 2025Reading the note…
5.20.2
6 Aug 2025Reading the note…
5.20.1
6 Jul 2025Reading the note…
5.20.0
19 Jun 2025Reading the note…
5.19.4
31 May 2025Reading the note…
5.19.3
12 May 2025Reading the note…
5.19.2
12 Jan 2025Reading the note…
5.19.1
24 Dec 2024Reading the note…
5.19.0
12 Nov 2024Reading the note…
5.18.2
21 Sep 2024Reading the note…
5.18.1
6 Sep 2024Reading the note…
5.18.0
30 Aug 2024Reading the note…
5.17.4
15 Aug 2024Reading the note…
5.17.3
13 Aug 2024Reading the note…
5.17.2
13 Aug 2024Reading the note…
5.17.1
31 Jul 2024Reading the note…
5.17.0
30 Jul 2024Reading the note…
5.16.0
26 Jul 2024Reading the note…
5.15.0
13 Jul 2024Reading the note…
5.14.0
22 Jun 2024Reading the note…
5.13.2
11 Jun 2024Reading the note…
5.13.1
1 Jun 2024Reading the note…
5.13.0
4 May 2024Reading the note…
5.12.0
24 Apr 2024Reading the note…
5.11.0
16 Apr 2024Reading the note…
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.