xstate
5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed
4.38.3 is the newest release of 4.x.
In short
1 deprecated2 new4 fixed
- Deprecated
Marked all phantom properties on the
StateMachinetype as deprecated. This deprioritized them in IDEs so they don't popup as first suggestions during property access.
Release note
Minor Changes
All actions are now available in the
actionsvariable when importing:import { actions } from 'xstate'Persisted state can now be easily restored to a state compatible with the machine without converting it to a
Stateinstance first:// Persisting a state someService.subscribe(state => { localStorage.setItem('some-state', JSON.stringify(state)); }); // Restoring a state const stateJson = localStorage.getItem('some-state'); // No need to convert `stateJson` object to a state! const someService = interpret(someMachine).start(stateJson);
Patch Changes
Fixed an issue with a reference to
@types/nodebeing inserted into XState's compiled output. This could cause unexpected issues in projects expecting APIs likesetTimeoutto be typed with browser compatibility in mind.Fixed an issue with states created using
machine.getInitialStatenot being "resolved" in full. This could cause some things, such asaftertransitions, not being executed correctly after starting an interpreter using such state.- Deprecated
Marked all phantom properties on the
StateMachinetype as deprecated. This deprioritized them in IDEs so they don't popup as first suggestions during property access. Fixed an issue with
state.contextbecominganyafterstate.matcheswhen typegen is used.Moved an internal
@ts-ignoreto a JSDoc-style comment to fix consuming projects that do not useskipLibCheck. Regular inline and block comments are not preserved in the TypeScript's emit.
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.