Major Changes
-
#3455
ec39214c8
Thanks @davidkpiano! - Theinterpreter.onStop(...)
method has been removed. Use an observer instead viainterpreter.subscribe({ complete() { ... } })
instead. -
#3455
ec39214c8
Thanks @davidkpiano! - The.send(...)
method oninterpreter.send(...)
now requires the first argument (the event to send) to be an object; that is, either:- an event object (e.g.
{ type: 'someEvent' }
) - an SCXML event object.
The second argument (payload) is no longer supported, and should instead be included within the object:
-actor.send('SOME_EVENT') +actor.send({ type: 'SOME_EVENT' }) -actor.send('EVENT', { some: 'payload' }) +actor.send({ type: 'EVENT', some: 'payload' })
- an event object (e.g.
-
#3455
ec39214c8
Thanks @davidkpiano! - Reading the initial state from an actor viaactor.initialState
is removed. Useactor.getInitialState()
instead. -
#3455
ec39214c8
Thanks @davidkpiano! - ThematchState(...)
helper function is removed. -
#3455
ec39214c8
Thanks @davidkpiano! - Thestrict: true
option for machine config has been removed. -
#3455
ec39214c8
Thanks @davidkpiano! - Theinterpreter.onError(...)
method has been removed. Useinterpreter.subscribe({ error(err) => { ... } })
instead. -
#3455
ec39214c8
Thanks @davidkpiano! -Interpreter['off']
method has been removed. -
#3455
ec39214c8
Thanks @davidkpiano! -.nextState
method has been removed from theInterpreter
.State#can
can be used to check if sending a particular event would lead to a state change. -
#3187
c800dec47
Thanks @davidkpiano! - ThecreateModel()
function has been removed in favor of relying on strong types in the machine configuration. -
#3455
ec39214c8
Thanks @davidkpiano! -sync
option has been removed frominvoke
andspawn
.
Minor Changes
- #3727
5fb3c683d
Thanks @Andarist! -exports
field has been added to thepackage.json
manifest. It limits what files can be imported from a package - it's no longer possible to import from files that are not considered to be a part of the public API.
Patch Changes
-
#3455
ec39214c8
Thanks @davidkpiano! - Fixed an issue with inline actions not being correctly executed when there was an equally named action provided through theimplementations
argument. -
#3487
1b6e3dfb8
Thanks @Andarist, @davidkpiano! - Make it impossible to exit a root state. For example, this means that root-level transitions specified as external transitions will no longer restart root-level invocations. See #3072 for more details. -
#3389
aa8f5d5fd
Thanks @Andarist! - Fixed the declared signature of one of theStateMachine
's methods to avoid using a private namethis
. This makes it possible to emit correct.d.ts
for the associated file. -
#3374
a990f0ed1
Thanks @Andarist! - Fixed an issue with actors not being reinstantiated correctly when an actor with the same ID was first stopped and then invoked/spawned again in the same microstep. -
#3390
7abc41759
Thanks @Andarist! - Added back UMD builds. Please note that XState now comes with multiple entrypoints and you might need to load all of them (XState
,XStateActions
,XStateGuards
, etc.). It's also worth mentioning that those bundles don't reference each other so they don't actually share any code and some code might be duplicated between them.