Hey, creator of XState here! Just want to mention that we're very close to releasing XState v5 beta, which brings even more features to the state machines & statecharts you can create, and greatly improves the developer experience, but also makes it more usable as a general-purpose state management library (or orchestration "framework" if you want to consider it that), whether on the frontend or backend.
Would you consider supporting Deno? (The npm module can probably be imported as-is in newer Deno versions, but a dedicated module is always nice and likely wouldn't be much work)
Xstate: State machines and statecharts for the modern web
71–80 of 81 posts
Re: Xstate: State machines and statecharts for the modern web
#72Hey, creator of XState here! Just want to mention that we're very close to releasing XState v5 beta, which brings even more features to the state machines & statecharts you can create, and greatly improves the developer experience, but also makes it more usable as a general-purpose state management library (or orchestration "framework" if you want to consider it that), whether on the frontend or backend.
do you foresee sysml like diagrams in your roadmap? if you could do activity diagrams with swimlanes…dude. that'd be huge.
Re: Xstate: State machines and statecharts for the modern web
#73I'm a simple man. I just want to embed a state machine in my objects. I want to let it know when an event occurs. I want it to let me know when an event occurs. Sigh.. Found xstates desire too control everything made a simple embedding use case really awkward. The hoops to jump through for good typescript support while breaking the config down into reusable components... Really wanted to like xstates but it felt like…
Re: Xstate: State machines and statecharts for the modern web
#74The readme gives the example of a traffic light to demo a state machine usecase. Fair enough, but what's a rudimentary usecase for 'the modern web'? What everyday UI thing is better done with this than other methods? Why is it better?
Re: Xstate: State machines and statecharts for the modern web
#75Re: Xstate: State machines and statecharts for the modern web
#76Re: Xstate: State machines and statecharts for the modern web
#77All I see here is a switch statement, the input is an enum, and the action that's taken is also determined by an enum.
Re: Xstate: State machines and statecharts for the modern web
#78The visualizer is a major selling point - especially if I need to explain something to non-dev people or someone new to the concept.
The one downside is that building state machines is an art in and of itself and I had to throw away my first implementation in favour of something simpler once I got the hang of it.
Re: Xstate: State machines and statecharts for the modern web
#79Re: Xstate: State machines and statecharts for the modern web
#80I was one half of a team that heavily leveraged XState in 2020. We used it to build a general-purpose kiosk app (in Electron) that could be updated remotely using an Xstate configuration served by a graphene-django app. One of the most technically impressive pieces of software I've ever had the pleasure to work on. (I mostly did server/backend stuff). The entire kiosk device could be repurposed on the fly and Xstate…
I'm also exploring xstate for a similar use case and would love to know more about your experience with it. I'm particularly interested in understanding the level of customizability you allowed in your implementation. My use case involves implementing various user flows in my app and I'm currently weighing the benefits of using xstate versus react-router. Also, I'm curious about how you integrated graphql into this p…
We used Xstate over react-router by using a parallel machine:
- One for application state - One for view state
We had to hack the innards of the events a bit to get the two machines to communicate. This allowed the view to re-render the jsonschema form at the exact right time, and not flicker on multiple state transitions.
In hindsight, graphql wasn’t as necessary as we initially thought. The important part was storing the mutation as a string as an xstate transition parameter. We used federation, so it did help us deal with multiple backends.
All database. Versions were handled by having a core machine that pulled the kiosk’s workflow from the server and ran it as a submachine. So the code on the device (core machine) could switch sub machine workflows on the fly between runs.