-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(deps): update dependency xstate to v5 #154
Open
renovate
wants to merge
1
commit into
main
Choose a base branch
from
renovate/major-xstate-monorepo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
⚠ Artifact update problemRenovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is. ♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below: File name: package-lock.json
|
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
5 times, most recently
from
December 8, 2023 01:45
02caf15
to
6b5cf9c
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
4 times, most recently
from
December 18, 2023 03:48
7ccdbdc
to
520d6c6
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
from
December 19, 2023 00:58
520d6c6
to
bd98580
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
2 times, most recently
from
December 30, 2023 09:03
64bc682
to
986bc3e
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
3 times, most recently
from
January 8, 2024 01:07
cfcf15c
to
dac8610
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
5 times, most recently
from
January 16, 2024 00:48
ce6aec0
to
523b356
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
4 times, most recently
from
January 23, 2024 00:15
78f7676
to
d0120a1
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
4 times, most recently
from
January 29, 2024 02:56
d1b3f19
to
398b446
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
10 times, most recently
from
November 1, 2024 04:43
a34a0b2
to
bf61857
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
3 times, most recently
from
November 5, 2024 05:20
c4f2a29
to
26cf503
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
2 times, most recently
from
November 19, 2024 00:37
daf79a5
to
59d2409
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
5 times, most recently
from
November 26, 2024 05:03
71dd85c
to
d9120b3
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
3 times, most recently
from
December 3, 2024 01:10
b4c4a90
to
5941b7b
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
3 times, most recently
from
December 17, 2024 09:39
d5f6011
to
5e1ba30
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
2 times, most recently
from
January 3, 2025 01:49
bf6f0b2
to
dd6fd67
Compare
renovate
bot
force-pushed
the
renovate/major-xstate-monorepo
branch
from
January 3, 2025 21:55
dd6fd67
to
c7a815b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^4.13.0
->^5.0.0
Release Notes
statelyai/xstate (xstate)
v5.18.2
Compare Source
Patch Changes
25963966c394fc904dc9b701a420b6e204ebe7f7
Thanks @davidkpiano! - The inspection event interfaces now expectActorRefLike
instead ofAnyActorRef
v5.18.1
Compare Source
Patch Changes
ad38c35c37
Thanks @SandroMaglione! - ExportedRequiredActorOptionsKeys
type meant to be used by integration packages like@xstate/react
v5.18.0
Compare Source
Minor Changes
#5042
54c9d9e6a4
Thanks @boneskull! -waitFor()
now accepts a{signal: AbortSignal}
inWaitForOptions
#5006
1ab974547f
Thanks @davidkpiano! - The state value typings for setup state machine actors (setup({}).createMachine({ ... })
) have been improved to represent the actual expected state values.Patch Changes
#5054
853f6daa0b
Thanks @davidkpiano! - TheCallbackLogicFunction
type (previouslyInvokeCallback
) is now exported. This is the callback function that you pass intofromCallback(callbackLogicFn)
to create an actor from a callback function.v5.17.4
Compare Source
Patch Changes
d6df8fb470
Thanks @Andarist! - Fixed an inference issue that preventedemit
used directly insetup
(or barecreateMachine
) to benefit fromtypes.emitted
types.v5.17.3
Compare Source
Patch Changes
7bed484c38
Thanks @davidkpiano! - FixEventFrom
andContextFrom
typesv5.17.2
Compare Source
Patch Changes
#5029
88bd87ab41
Thanks @davidkpiano! - RevertActorRefFrom
change#5011
a275d274de
Thanks @davidkpiano! - There is a new type helper:ActorRefFromLogic<TLogic>
. This type is a stricter form ofActorRefFrom<TLogic>
that only accepts actor logic types. See #4997 for more details.v5.17.1
Compare Source
Patch Changes
51d4c4fc5
Thanks @davidkpiano! - The internal types forStateMachine<...>
have been improved so that all type params are required, to prevent errors when using the types. This fixes weird issues like #5008.v5.17.0
Compare Source
Minor Changes
#4979
a0e9ebcef
Thanks @davidkpiano! - State IDs are now strongly typed as keys ofsnapshot.getMeta()
for state machine actor snapshots.Patch Changes
9877d548b
Thanks @davidkpiano! - Fix an issue whereclearTimeout(undefined)
was sometimes being called, which can cause errors for some clock implementations. See #5001 for details.v5.16.0
Compare Source
Minor Changes
#4996
5be796cd2
Thanks @ronvoluted! - The actor snapshotstatus
type ('active' | 'done' | 'error' | 'stopped'
) is now exposed asSnapshotStatus
#4981
c4ae156b2
Thanks @davidkpiano! - AddedsendParent
to theenqueueActions
feature. This allows users to enqueue actions that send events to the parent actor within theenqueueActions
block.v5.15.0
Compare Source
Minor Changes
#4976
452bce71e
Thanks @with-heart! - Added exports for actor logic-specificActorRef
types:CallbackActorRef
,ObservableActorRef
,PromiseActorRef
, andTransitionActorRef
.Each type represents
ActorRef
narrowed to the corresponding type of logic (the type ofself
within the actor's logic):CallbackActorRef
: actor created byfromCallback
ObservableActorRef
: actor created byfromObservable
andfromEventObservable
PromiseActorRef
: actor created byfromPromise
TransitionActorRef
: actor created byfromTransition
#4949
8aa4c2b90
Thanks @davidkpiano! - The TypeGen-related types have been removed from XState, simplifying the internal types without affecting normal XState usage.v5.14.0
Compare Source
Minor Changes
#4936
c58b36dc3
Thanks @davidkpiano! - Inspecting an actor system viaactor.system.inspect(ev => …)
now accepts a function or observer, and returns a subscription:#4942
9caaa1f70
Thanks @boneskull! -DoneActorEvent
andErrorActorEvent
now contain propertyactorId
, which refers to the ID of the actor the event refers to.#4935
2ac08b700
Thanks @davidkpiano! - All actor logic creators now support emitting events:Promise actors
Transition actors
Observable actors
Callback actors
Patch Changes
417f35a11
Thanks @boneskull! - Expose typeUnknownActorRef
for use when callinggetSnapshot()
on an unknownActorRef
.v5.13.2
Compare Source
Patch Changes
71a7f8692
Thanks @davidkpiano! - Actors with emitted events should no longer cause type issues: #4931v5.13.1
Compare Source
Patch Changes
#4905
dbeafeb25
Thanks @davidkpiano! - You can now use a wildcard to listen for any emitted event from an actor:v5.13.0
Compare Source
Minor Changes
#4832
148d8fcef
Thanks @cevr! -fromPromise
now passes a signal into its creator function.This will be called whenever the state transitions before the promise is resolved. This is useful for cancelling the promise if the state changes.
Patch Changes
#4876
3f6a73b56
Thanks @davidkpiano! - XState will now warn when calling built-in actions likeassign
,sendTo
,raise
,emit
, etc. directly inside of a custom action. See https://stately.ai/docs/actions#built-in-actions for more details.v5.12.0
Compare Source
Minor Changes
#4863
0696adc21
Thanks @davidkpiano! - Meta objects for state nodes and transitions can now be specified insetup({ types: … })
:v5.11.0
Compare Source
Minor Changes
#4806
f4e0ec48c
Thanks @davidkpiano! - Inline actor logic is now permitted when named actors are present. Defining inline actors will no longer cause a TypeScript error:v5.10.0
Compare Source
Minor Changes
#4822
f7f1fbbf3
Thanks @davidkpiano! - Theclock
andlogger
specified in theoptions
object ofcreateActor(logic, options)
will now propagate to all actors created within the same actor system.v5.9.1
Compare Source
Patch Changes
567267ed2
Thanks @Andarist! - Add missingemit
exportv5.9.0
Compare Source
Minor Changes
#4746
b570ba20d
Thanks @davidkpiano! - The newemit(…)
action creator emits events that can be received by listeners. Actors are now event emitters.#4777
4abeed9df
Thanks @Andarist! - Added support forparams
toenqueueActions
v5.8.2
Compare Source
Patch Changes
9a0120901
Thanks @Andarist! - Fixed a type issue that preventsendParent
to be accepted bysetup
whendelays
stayed not configured.v5.8.1
Compare Source
Patch Changes
4a29f8aab
Thanks @Andarist! - Correctly use falsy outputs (instead of accidentally converting them toundefined
).v5.8.0
Compare Source
Minor Changes
a9e3c086f
Thanks @Andarist! - Revampedsetup
and actions types to disallow usage of non-configured implementationsv5.7.1
Compare Source
Patch Changes
15b7dd1f0
Thanks @devanfarrell! - Removedthis
from machine snapshot methods to fix issues with accessing those methods from union of actors and their snapshots.v5.7.0
Compare Source
Minor Changes
#4290
7a8796f80
Thanks @davidkpiano! - An error will now be thrown if an incompatible state value is passed tomachine.resolveState({ value })
.#4693
11b6a1ae1
Thanks @davidkpiano! - You can now inspect microsteps (@xstate.microstep
) and actions (@xstate.action
):v5.6.2
Compare Source
Patch Changes
#4731
960cdcbcb
Thanks @davidkpiano! - You can now importgetInitialSnapshot(…)
fromxstate
directly, which is useful for getting a mock of the initial snapshot when interacting with machines (or other actor logic) withoutcreateActor(…)
:v5.6.1
Compare Source
Patch Changes
#4728
659efd5c1
Thanks @Andarist! - Fixed compatibility issue of the internal type definitions with TypeScript 5.0#4712
2f1d36a9d
Thanks @davidkpiano! - Ensure thatInteropObservable
andInteropSubscribable
are present in the type definition file.#4694
0b6dff210
Thanks @davidkpiano! - AddUnknownMachineConfig
typev5.6.0
Compare Source
Minor Changes
#4704
78699aef6
Thanks @Andarist! -createActor
will now error if the requiredinput
is not given to it.#4688
14902e17a
Thanks @Andarist! - Theschemas
property insetup(...)
is now passed through to the resulting machine. This property is meant to be used with future developer tooling, and is typed asunknown
for now.Patch Changes
51b844230
Thanks @Andarist! - Fixed compatibility with the upcoming TypeScript 5.4v5.5.2
Compare Source
Patch Changes
#4685
e43eab144
Thanks @davidkpiano! - State IDs that have periods in them are now supported if those periods are escaped.The motivation is that external tools, such as Stately Studio, may allow users to enter any text into the state ID field. This change allows those tools to escape periods in state IDs, so that they don't conflict with the internal path-based state IDs.
E.g. if a state ID of
"Loading..."
is entered into the state ID field, instead of crashing either the external tool and/or the XState state machine, it should be converted by the tool to"Loading\\.\\.\\."
, and those periods will be ignored by XState.v5.5.1
Compare Source
Patch Changes
64ee3959c
Thanks @Andarist! - Fixed compatibility with older versions of integration packages.v5.5.0
Compare Source
Minor Changes
#4596
6113a590a
Thanks @davidkpiano! - IntroducegetNextSnapshot(...)
, which determines the next snapshot for the givenactorLogic
based on the givensnapshot
andevent
.If the
snapshot
isundefined
, the initial snapshot of theactorLogic
is used.Patch Changes
1ae07f5bf
Thanks @Andarist! - Allowevent
in transitions to be narrowed down even when its.type
is defined using a union.v5.4.1
Compare Source
Patch Changes
1f2ccb97c
Thanks @davidkpiano! - Typegen-based types for detecting missing implementations have been removed internally.v5.4.0
Compare Source
Minor Changes
#4616
e8c0b15b2
Thanks @Andarist! -context
factories receiveself
now so you can immediately pass that as part of the input to spawned actors.v5.3.1
Compare Source
Patch Changes
#4597
ae0b05f11
Thanks @davidkpiano! - Update the argument object ofenqueueActions(...)
to include theself
andsystem
properties:v5.3.0
Compare Source
Minor Changes
#4547
8e8d2ba38
Thanks @davidkpiano! - AddassertEvent(...)
to help provide strong typings for events that can't be easily inferred, such as events inentry
andexit
actions, or ininvoke.input
.The
assertEvent(event, 'someType')
function will throw if the event is not the expected type. This ensures that theevent
is guaranteed to have that type, and assumes that the event object has the expected payload (naturally enforced by TypeScript).Patch Changes
97f1cbd5f
Thanks @Andarist! - Fixed an issue with ancestors of the default history target that lie outside of the transition domain being incorrectly entered.v5.2.1
Compare Source
Patch Changes
677fb35b7
Thanks @davidkpiano! - Update README.mdv5.2.0
Compare Source
Minor Changes
#4198
ca58904ad
Thanks @davidkpiano! - IntroducetoPromise(actor)
, which creates a promise from anactor
that resolves with the actor snapshot'soutput
when done, or rejects with the actor snapshot'serror
when it fails.Patch Changes
#4568
a5c55fae2
Thanks @Andarist! - Fixed an issue withspawn
withinassign
not returning a narrowed downActorRef
type on TypeScrip 5.0#4570
c11127336
Thanks @Andarist! - Fixed an issue that caused acomplete
listener to be called instead of theerror
one when the actor was subscribed after being stopped.v5.1.0
Compare Source
Minor Changes
d7f220225
Thanks @davidkpiano! - Internal: abstract the scheduler for delayed events so that it is handled centrally by thesystem
.Patch Changes
80818017b
Thanks @davidkpiano! - Fix higher-level logic for state machine logicv5.0.2
Compare Source
Patch Changes
80b9afbae
Thanks @Andarist! - Fixed definingactors
withinput
withinsetup
.v5.0.1
Compare Source
Patch Changes
5041764b2
Thanks @laurakalbag! - Flag that docs in this repo are deprecated in favour of docs at stately.ai/docs/xstatev5.0.0
Compare Source
Major Changes
d3d6149
: If context types are specified in the machine config, thecontext
property will now be required:d3d6149
: - The third argument ofmachine.transition(state, event)
has been removed. Thecontext
should always be given as part of thestate
.machine.microstep(snapshot, event)
which returns the resulting intermediateMachineSnapshot
object that represents a single microstep being taken when transitioning fromsnapshot
via theevent
. This is theMachineSnapshot
that does not take into account transient transitions nor raised events, and is useful for debugging.state.events
property has been removed from theState
objectstate.historyValue
property now more closely represents the original SCXML algorithm, and is a mapping of state node IDs to their historic descendent state nodes. This is used for resolving history states, and should be considered internal.stateNode.isTransient
property is removed fromStateNode
..initial
property of a state node config object can now contain executable content (i.e., actions):assign()
) will now be executed "in order", rather than automatically prioritized. They will be evaluated after previously defined actions are evaluated, and actions that read fromcontext
will have those intermediate values applied, rather than the final resolved value of allassign()
actions taken, which was the previous behavior.This shouldn't change the behavior for most state machines. To maintain the previous behavior, ensure that
assign()
actions are defined before any other actions.d3d6149
: An error will be thrown if aninitial
state key is not specified for compound state nodes. For example:You will get the error:
d3d6149
: IDs for delayed events are no longer derived from event types so this won't work automatically:Please use explicit IDs:
d3d6149
: RemovedState#toStrings
method.d3d6149
: The machine'scontext
is now restricted to anRecord<string, any>
. This was the most common usage, but now the typings preventcontext
from being anything but an object:If
context
isundefined
, it will now default to an empty object{}
.d3d6149
: Actors are now always part of a "system", which is a collection of actors that can communicate with each other. Systems are implicitly created, and can be used to get and set references to any actor in the system via thesystemId
prop:Any invoked/spawned actor that is part of a system will be able to reference that actor:
Each top-level
createActor(...)
call creates a separate implicit system. In this example example,actor1
andactor2
are part of different systems and are unrelated:d3d6149
:external
property on transitions has been renamed toreenter
d3d6149
: Theinterpreter.onStop(...)
method has been removed. Use an observer instead viaactorRef.subscribe({ complete() { ... } })
instead.d3d6149
: RemovedMachineSnapshot['nextEvents']
.d3d6149
: Renamedmachine.withConfig(...)
tomachine.provide(...)
.d3d6149
: Removed third parameter (context) from Machine's transition method. If you want to transition with a particular context value you should create appropriateMachineSnapshot
usingmachine.resolveState
. So instead of this -machine.transition('green', { type: 'TIMER' }, { elapsed: 100 })
, you should do this -machine.transition(machine.resolveState({ value: 'green', context: { elapsed: 100 } }), { type: 'TIMER' })
.d3d6149
: Sending a string event toactorRef.send('some string')
will now throw a proper error message.d3d6149
: Theself
actor reference is now available in all action metas. This makes it easier to reference the "self"ActorRef
so that actions such assendTo
can include it in the event payload:d3d6149
:isState
/isStateConfig
were replaced byisMachineSnapshot
. Similarly,AnyState
type was deprecated and it's replaced byAnyMachineSnapshot
type.d3d6149
: All actor snapshots now have a consistent, predictable shape containing these common properties:status
:'active' | 'done' | 'error' | 'stopped'
output
: The output data of the actor when it has reachedstatus: 'done'
error
: The error thrown by the actor when it has reachedstatus: 'error'
context
: The context of the actorThis makes it easier to work with actors in a consistent way, and to inspect their snapshots.
d3d6149
: Restoring persisted state is now done by passing the state into thesnapshot: ...
property of thecreateActor
options argument:The persisted snapshot is obtained from an actor by calling
actor.getPersistedSnapshot()
:d3d6149
: - Theexecute
option for an interpreted service has been removed. If you don't want to execute actions, it's recommended that you don't hardcode implementation details into the basemachine
that will be interpreted, and extend the machine'soptions.actions
instead. By default, the interpreter will execute all actions according to SCXML semantics (immediately upon transition).xstate/devTools/redux
:By default, dev tools are attached to the global
window.__xstate__
object:And creating your own custom dev tools adapter is a function that takes in the
actorRef
:These handlers have been removed, as they are redundant and can all be accomplished with
.onTransition(...)
and/or.subscribe(...)
:actorRef.onEvent()
actorRef.onSend()
actorRef.onChange()
The
actorRef.send(...)
method no longer returns the next state. It is avoid
function (fire-and-forget).The
actorRef.sender(...)
method has been removed as redundant. UseactorRef.send(...)
instead.d3d6149
: The output data on final states is now specified as.output
instead of.data
:d3d6149
: Support for getters as a transition target (instead of referencing state nodes by ID or relative key) has been removed.The
Machine()
andcreateMachine()
factory functions no longer support passing incontext
as a third argument.The
context
property in the machine configuration no longer accepts a function for determining context (which was introduced in 4.7). This might change as the API becomes finalized.The
activities
property was removed fromState
objects, as activities are now part ofinvoke
declarations.The state nodes will not show the machine's
version
on them - theversion
property is only available on the root machine node.d3d6149
: Thein: ...
property for transitions is removed and replaced with guards. It is recommended to usestateIn()
andnot(stateIn())
guard creators instead:d3d6149
: RemovedActor['status']
from publicly available properties.d3d6149
: All builtin action creators (assign
,sendTo
, etc) are now returning functions. They exact shape of those is considered an implementation detail of XState and users are meant to only pass around the returned values.d3d6149
: Autoforwarding events is noConfiguration
📅 Schedule: Branch creation - "after 9pm,before 6am" in timezone Europe/Zurich, Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.