#3063c826559b4 Thanks @Andarist! - Fixed a type compatibility with Svelte's readables. It should be possible again to use XState interpreters directly as readables at the type-level.
#305104091f29c Thanks @Andarist! - Fixed type compatibility with functions accepting machines that were created before typegen was a thing in XState. This should make it possible to use the latest version of XState with @xstate/vue, @xstate/react@^1 and some community packages.
Note that this change doesn't make those functions to accept machines that have typegen information on them. For that the signatures of those functions would have to be adjusted.
#30772c76ecac5 Thanks @Andarist! - Fixed an issue with nested state.matches calls when the typegen was involved. The state ended up being never and thus not usable.
xstate@4.30.1
Patch Changes
#304018dc2b3e2 Thanks @davidkpiano! - The AnyState and AnyStateMachine types are now available, which can be used to express any state and state machine, respectively:
import type { AnyState, AnyStateMachine } from 'xstate';
// A function that takes in any state machine
function visualizeMachine(machine: AnyStateMachine) {
// (exercise left to reader)
}
function logState(state: AnyState) {
// ...
}
#3042e53396f08 Thanks @suerta-git! - Added the AnyStateConfig type, which represents any StateConfig<...>:
import type { AnyStateConfig } from 'xstate';
import { State } from 'xstate';
// Retrieving the state config from localStorage
const stateConfig: AnyStateConfig = JSON.parse(
localStorage.getItem('app-state')
);
// Use State.create() to restore state from config object with correct type
const previousState = State.create(stateConfig);
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps xstate from 4.30.0 to 4.30.2.
Release notes
Sourced from xstate's releases.
Commits
945a707
Version Packages (#3054)2c76eca
Fixed an issue with nestedstate.matches
calls causing state to be narrowed...555b7df
Update bug_report.ymlec2fda2
Update bug_report.ymlae2fb1e
Simplify howSymbol.observable
alias is declared (#3068)c826559
Fixed a type compatibility with Svelte's readables (#3063)de08b61
Fixed an issue withstate.matches(...)
narrowing downstate
tonever
fo...7b05b27
Tweak the tic-tax-toe example to avoid unsound code from spreading (#3060)b9a609c
Run core tests using TS strict mode (#3057)04091f2
Fixed type compatibility with typegen-less functions (#3051)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)