4 ms·
xstate seems to support SCXML, keep seeing it in docs but not sure: what’s the benefit of SCXML support?
by dmitryminkovsky 6y ago
xstate seems to support SCXML, keep seeing it in docs but not sure: what’s the benefit of SCXML support?
- jlu 6y agoSCXML is a universal standard which means it could be consumed by any programming language.
- dmitryminkovsky 6y agoBut I’m only implementing my machine in one language, why would this be useful? When do I need the same machine in multiple environments? Or are you referring to things like tooling for visualization etc?
- CitizenKane 6y agoIt could be useful in a number of scenarios. For instance you may want to resolve state between a front-end and a back-end, so the ability to make transitions on both could be very useful.
- jlu 6y agoAs @CitizenKane pointed out, reusing statcharts between backend and frontend is a growingly popular use case. Another benefit is you could use any visual tool (preferably web-based with collaborative capabilities so that all stackholders could work togehter) for state modeling to encapsulate business logics completely in statechart then export SCXML to any language you might be using.
- davidkpiano 6y agoRight; for tests, it internally converts SCXML documents to a JSON format that XState can consume. In the next version of XState, it will be able to consume and produce SCXML documents as part of its public API. Another notable library that works with SCXML directly is SCION: http://scion.scxml.io/ http://scion.scxml.io/