25
Import from code
complete
David Khourshid
Users should be able to import existing XState code into the editor so that the machine can be visually edited.
Users should be able to import machines from valid JS, TS, or JSON files.
JS/TS would be the XState createMachine(...) syntax, whereas JSON files would be the serialized machine definitions.
David Khourshid
complete
David Khourshid
in progress
Try Stately
Yes!
For context I started with a Mermaid state diagram and stumbled across XState/Stately looking for a tool that would generate code stubs from that. Since Mermaid is very terse it wasn't too much trouble manually creating a machine, validating it on https://xstate.js.org and visually comparing the two.
For reference I've attached my mermaid diagram (which leaves out a few transitions). I find it much easier to read than
I assumed I would be able to import it into statelyai and touch up the layout to more closely approximate the Mermaid one and was surprised to discover I couldn't do that.
I was also hoping I could use the vscode extension but it's not working for me either (tried it on a simpler machine yesterday https://github.com/statelyai/xstate/discussions/3441#discussioncomment-3226865 )

David Khourshid
planned
Florian Warschewske
David Khourshid: nice!
David Khourshid