🔎 XState Inspector feedback, issues, feature requests! #1430
Replies: 48 comments 86 replies
-
First off this thing is freaking awesome— I'm loving it already. Here are the snags I've run into. Selecting certain of my machines causes the page to crash with this error: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@davidkpiano is there a technical breakdown of how this is working somewhere? I haven't had a chance to dig into the code yet but would love the 10000 ft view if you have time or have written it up elsewhere. |
Beta Was this translation helpful? Give feedback.
-
The JavaScript CSB template closes over the global
Outcome: Solution: |
Beta Was this translation helpful? Give feedback.
-
At least one 4.X syntax pattern doesn't work in the visualizer. This is a change I had to make: - interpreter.send('EVENT', { payload })
+ interpreter.send({ type: 'EVENT', data: payload }); |
Beta Was this translation helpful? Give feedback.
-
I have not yet reduced this reproduction, but this machine functions differently with the inspector on and off: Reproduction
At first glance this seems to happen because the |
Beta Was this translation helpful? Give feedback.
-
Hi David, love the new features! Haven’t tried it yet so I’m wondering, does this work with React Native as is? If not, support for it would be grand! Cheers :) |
Beta Was this translation helpful? Give feedback.
-
I'm absolutely loving the new Inspector, amazing job! ❤️ Have you thought about having the path and the action that triggered a transition from the previous state highlighted in a different color? I think it would really help understanding the flow of the system as you're interacting with it. |
Beta Was this translation helpful? Give feedback.
-
Do you think you’ll be open sourcing the new visualizer? I’d like to build it into a Flipper plugin, to use with React Native. |
Beta Was this translation helpful? Give feedback.
-
Is there any possibility of publishing a version of this at a different URL that isn't minified? Getting weird errors when trying to attach it to my (admittedly quite large) machine, and would love to better be able to tell what the problem is. |
Beta Was this translation helpful? Give feedback.
-
A change to the CSS layout or a button or something that enabled taking a full-page screenshot of the visualized machine would be cool, trying to share this w/ teammates but our machine is so tall that it would be very painful to manually stitch together. Since it's using JS + a CSS transform for scrolling the visualized machine none of the "scroll and take screenshots" tools I've tried recognize it as something that can be scrolled, so getting a full-height screenshot of our visualized machine would be a fully-manual process. |
Beta Was this translation helpful? Give feedback.
-
Is it going to be possible to view all the machines/actors at once instead of having to switch between the view of a single machine? Seems like it would be difficult to layout properly but it would be really amazing :D |
Beta Was this translation helpful? Give feedback.
-
This looks great. It’s going to help tremendously, not just in development but in helping to sell statecharts internally. A couple of immediate comments:
Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hey David - good job on the release! It looks like the docs have a typo: it says I also noticed there seems to be some interference with data passed in the events when devTools are turned on. I have
which works as expected without devTools, and doesn't pass href or title with devTools. |
Beta Was this translation helpful? Give feedback.
-
Hi @davidkpiano , |
Beta Was this translation helpful? Give feedback.
-
Found a bug with representation of hierarchical state machines. Little arrow of Initial state gets misplaced. |
Beta Was this translation helpful? Give feedback.
-
Can we make it so when you hover a node or line they get highlighted? Either by setting it to yellow or set the opacity of the other lines down? A lot of the machines I made have lines intersecting and I think a simple hover to highlight would fix this. |
Beta Was this translation helpful? Give feedback.
-
Hello - I'm embarking on my first use of xstate. I'm really excited to use the inspector to demo progress and complexity to non-technical audiences. When I invoke |
Beta Was this translation helpful? Give feedback.
-
Hey David, the inspector is great! I was initially looking for a way to run the XState Visualizer locally, directly importing the state machine from my local repo without having to paste all the code into the visualizer site. Eventually, I found the inspector and managed to wire it up in my React app similarly to your Storybook example above. In case anyone else finds this while searching for how to do what I did, here's my React component to launch the inspector on a standalone state machine. I may have found a small CSS bug: The right sidebar panel that shows the state doesn't scroll vertically, so when my state object gets large, it overflows off the bottom of the screen and I can't see it all without collapsing nodes. |
Beta Was this translation helpful? Give feedback.
-
I've been using XState for some months now and only today I found out about this. Loving it, thank you so much for the hard work put into this! In Vue, sometimes I create services which I can import and reuse in other components: export const toggleMachineService = interpret(toggleMachine).start();
export const useToggleMachine = () => {
return useService(toggleMachineService);
}; However, when trying to add export const toggleMachineService = interpret(toggleMachine, {devTools: true}).start(); Is this a bug or am I missing something? CSB: https://codesandbox.io/s/brave-sammet-dw009?file=/src/App.vue:718-810 Thanks once again!! |
Beta Was this translation helpful? Give feedback.
-
Suggestion: Currently Xstate Inspector sends event payload as JSON string through websockets which is much slower in comparison to sending data as compressed binary buffer by compressing the JSON object (through npm package: notepack) . Also sending event payload as JSON string makes the inspector fall into edge cases when the payload cannot be stringified (like maybe DOM node references necessary to run some functions in some actions), all of which shouldn't matter if Xstate server and client pack and unpack the JS object as binary buffer before sending it through sockets. It'll allow most machines to run nice and fast. That said, perfect would be the case that inspector works offline and with multiple machines (which is going to happen I guess) but this might be a temporary fix. |
Beta Was this translation helpful? Give feedback.
-
Suggestion: the width of boxes can get really squished some times. Would be great if the machine width wasn't locked to a fixed width. I do prefer the single column layout that this does versus the visualization on the .com website. |
Beta Was this translation helpful? Give feedback.
-
Hi @davidkpiano !
|
Beta Was this translation helpful? Give feedback.
-
Sort of... the visualization code is mostly in the Here is a small example for how to create your own visualizations, which I highly encourage: https://codesandbox.io/s/relaxed-wave-bs9oz?file=/src/index.js It's less than 100 lines of JS and less than 100 lines of CSS to implement. |
Beta Was this translation helpful? Give feedback.
-
EDIT: Please ignore this post. It is perfectly possible to edit 2 machines simultaneously, but I had non-Xstate issues (Kernel panics) which sometimes rendered WebSockets inoperable. Is it possible to inspect 2 unrelated machines simultaneously? I have an angularjs app.
It serves up a page containing an iframe It controls/visualises the machines, one at a time, very successfully without having access to the internet. Now I need 2 simultaneous inspectors, one for each machine. I've tried instantiating another inspector on a different port in the scope of the 2nd machine (b.ts) but this resulted in both inspectors showing that second machine but the session dropdown only has one entry. I want to say:
I've tried a lot of guessing and at one stage I did get the session selector to show both machines at the same time but I can't recreate that scenario for the life of me. |
Beta Was this translation helpful? Give feedback.
-
It would be really nice if there was a way to tell the inspector to ignore certain actors for a machine. For example, I have a "Discussions" machine that has ~15 message actors that are generating a lot of noise in the inspector that I'm not currently interested in looking at. |
Beta Was this translation helpful? Give feedback.
-
I've just started using XState and XState Inspector, and I've found an issue that appears to be a bug. If an event causes a transition and the destination state handles an event of the same name, a loop can occur. Here's an example that hopefully makes this more clear: Sending the |
Beta Was this translation helpful? Give feedback.
-
Loving the xstate inspector! Would love to be able to collapse child states of a compound state! |
Beta Was this translation helpful? Give feedback.
-
Thank you for the inspector. It is nice. It would be helpful to visualize "in state" guards, though. |
Beta Was this translation helpful? Give feedback.
-
A way to clear machines from the inspectorThere are various situations where we'd want to de-list machines from the inspector. For example, I have an app where logging in creates N components that contain Discord discussion: |
Beta Was this translation helpful? Give feedback.
-
Hey all, if you haven't seen, there is a new XState Inspector and home for future statechart tools here: statecharts.io
I am still writing docs for the inspector, but if you have gotten a chance to play around with it, please post any feedback here.
EDIT: documentation is here - https://xstate.js.org/docs/packages/xstate-inspect/
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions