Skip to content

Releases: tivac/xstate-component-tree

v6.1.1

28 Feb 00:59
9a7e7b5
Compare
Choose a tag to compare

Patch Changes

  • #119 743433d Thanks @tivac! - Support multiple invoked items per state

    Previously it would only use the last invocation at each state.

v6.1.0

27 Feb 19:33
fce39cf
Compare
Choose a tag to compare

Minor Changes

  • #117 0cec0db Thanks @tivac! - Add machine info to each result

    Otherwise 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

25 Feb 07:46
95287a2
Compare
Choose a tag to compare

Patch Changes

  • #115 51cfe5e Thanks @tivac! - Fix an issue where in specific situations child trees would not be built.

    If a child machine has an invoke that immediately triggers a no-op event, the ComponentTree instance wouldn't actually walk that child machine for components to render. This was due to an interesting interaction between the xstate .changed property and when invokes within the statechart are run.

    Now whenever the ComponentTree sees a new machine it hasn't walked is running, it will walk it.

v6.0.1

25 Feb 00:19
199b424
Compare
Choose a tag to compare

Patch Changes

v6.0.0

19 Feb 01:14
fc714f2
Compare
Choose a tag to compare

Major Changes

  • #111 a0ec633 Thanks @tivac! - Add .d.ts files 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 88d1dba Thanks @tivac! - Component helper preserves .meta fields

    Previous using the helper like this:

    helper(Component, {
      meta: {
        fooga: "wooga",
      },
    });

    would return an object with no meta.fooga property. Now those keys are properly preserved if they exist.

    meta.load will 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

29 Nov 23:43
3ea2ccb
Compare
Choose a tag to compare

Minor Changes

  • #98 e7cd20d Thanks @tivac! - Support for components at the root of machines

    createMachine({
      initial: "foo",
    
      meta: {
        component: RootComponent,
      },
    
      states: {
        foo: {
          meta: {
            component: FooComponent,
          },
        },
      },
    });

    Previously RootComponent would be ignored, now it will be the first component in the tree and FooComponent will be placed as a child of it.

v5.1.0

12 Jul 23:43
0991745
Compare
Choose a tag to compare

Minor Changes

  • #74 951cea7 Thanks @tivac! - Adding .can() API from XState

    The .can() API is a simple passthrough to the interpreter for the root statechart being managed by xstate-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.

v5.0.1

28 Jun 23:10
037d088
Compare
Choose a tag to compare

Patch Changes

  • #71 00dcf48 Thanks @tivac! - Fix .hasTag & .matches before interpreter is running

v5.0.0

28 Jun 19:20
df60219
Compare
Choose a tag to compare

Major Changes

  • #69 b6c9fc8 Thanks @tivac! - Always provide a valid initial value to subscribers

    Previously if you called the .subscribe() method on a ComponentTree instance before the statechart had been processed the return value would be false. This meant that subscribers would have to add checks to do anything against the returned value, since they couldn't depend on the .matches/.hasTag/.broadcast APIs existing.

    This change fixes that, and ensures that even if the statechart hasn't been walked yet the initial value stored has all the expected APIs, along with a reasonable value for the tree property of []. There isn't a great fallback value for .state at this time though.

v4.2.0

23 Jun 19:19
44775e0
Compare
Choose a tag to compare

Minor Changes

  • #67 a8aa4ac Thanks @tivac! - Added .send() API

    The .send() API is a simple passthrough to the interpreter for the root statechart being managed by xstate-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.

    XState Docs on .send()