Releases: tivac/xstate-component-tree
v8.0.0
Major Changes
-
#230
fdba194Thanks @tivac! - Matching state and invoke names would causexstate-component-treeto fail to return child components in some cases because internally it named them the same thing and stomped all over itself.states : { foo : { invoke : { id : "foo", // ... }, }, },This should work now.
BREAKING CHANGE: All
machinevalues in the output that previously looked likeroot.foowill now look likeroot.#foo, in order to help differentiate the child machineidfrom the parent state path.
v7.1.0
Minor Changes
-
ca3d879Thanks @tivac! - Fixed issue where newly-created actors were immediately receiving the event that had been.broadcast(...).This was happening because the actors were being iterated in such a way that new actors added because of the event were also being iterated. This led to weird behaviors where events would seem to be duplicated.
v7.0.1
v6.1.1
v6.1.0
Minor Changes
-
#117
0cec0dbThanks @tivac! - Add machine info to each resultOtherwise root components of parallel sibling child machines can end up not being actually comparable.
[ [Object: null prototype] { + machine: "(machine).child-one", path: false, component: [Function: child], props: false, children: [] }, [Object: null prototype] { + machine: "(machine).child-two", path: false, component: [Function: child], props: false, children: [] } ]
v6.0.2
Patch Changes
-
#115
51cfe5eThanks @tivac! - Fix an issue where in specific situations child trees would not be built.If a child machine has an
invokethat immediately triggers a no-op event, theComponentTreeinstance wouldn't actually walk that child machine for components to render. This was due to an interesting interaction between the xstate.changedproperty and wheninvokes within the statechart are run.Now whenever the
ComponentTreesees a new machine it hasn't walked is running, it will walk it.
v6.0.1
v6.0.0
Major Changes
-
#111
a0ec633Thanks @tivac! - Add.d.tsfiles to releases and restructure exports.Previously
import ComponentTree from "xstate-component-tree"; import componentHelper from "xstate-component-tree/component";Now
import { ComponentTree, componentHelper } from "xstate-component-tree";
Minor Changes
-
#113
88d1dbaThanks @tivac! - Component helper preserves.metafieldsPrevious using the helper like this:
helper(Component, { meta: { fooga: "wooga", }, });
would return an object with no
meta.foogaproperty. Now those keys are properly preserved if they exist.meta.loadwill still be overwritten if it exists, because it is required for the helper to function. A warning if it exists may be introduced in a future release.
v5.2.0
Minor Changes
-
#98
e7cd20dThanks @tivac! - Support for components at the root of machinescreateMachine({ initial: "foo", meta: { component: RootComponent, }, states: { foo: { meta: { component: FooComponent, }, }, }, });
Previously
RootComponentwould be ignored, now it will be the first component in the tree andFooComponentwill be placed as a child of it.
v5.1.0
Minor Changes
-
#74
951cea7Thanks @tivac! - Adding.can()API from XStateThe
.can()API is a simple passthrough to the interpreter for the root statechart being managed byxstate-component-tree, and is intended as a convenience function to make it easier to interact with a ComponentTree instance instead of a direct XState Interpreter reference.From the XState docs on
.can():Determines whether sending the event will cause a non-forbidden transition to be selected, even if the transitions have no actions nor change the state value.