Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] SCXML import? #411

Closed
aksonov opened this issue Apr 4, 2019 · 8 comments
Closed

[feature] SCXML import? #411

aksonov opened this issue Apr 4, 2019 · 8 comments

Comments

@aksonov
Copy link

aksonov commented Apr 4, 2019

Could I pass SCXML file to xstate?

@davidkpiano
Copy link
Member

In the future, you will be able to. It will likely be in an @xstate/scxml package.

@aksonov
Copy link
Author

aksonov commented Apr 5, 2019

@davidkpiano Thank you for your work. I started something similar three years ago (SCXML-based): https://github.com/aksonov/statem but didn't found any community interest...

I'm maintaining RNRF component (https://github.com/aksonov/react-native-router-flux) and want to integrate it with xstate to make app navigation independent from UI layer.

One issue I was not able to solve three years ago - how to support stacks with SCXML (typical push/pop operations)? Looks like it is not supported there...

@davidkpiano
Copy link
Member

Do you mean simulating pushdown automata or simply maintaining a stack?

You can use a combination of context, assign(...), and cond: ... (<data>, <assign>, and <transition cond="..."> to simulate it, I believe.

@aksonov
Copy link
Author

aksonov commented Apr 5, 2019

You can use a combination of context, assign(...), and cond: ... (, , and to simulate it, I believe.

@davvidbaker Could you clarify? I want to use state machine for app navigation. For example, from Home account, user may go to own User Profile and to Friends List. From Friends List user may go to other's User Profile pages. The question how to implement 'pop' operation for User Profile, that should go to previous state from the stack (Home OR Friends List)

@aksonov
Copy link
Author

aksonov commented Apr 5, 2019

More interesting situation will be if User Profile also contains user's "Friends List" tab. Then we could have indefinite sequence User Profile -> Friends List -> User Profile -> etc.

@kalutheo
Copy link

kalutheo commented Jul 1, 2019

hey ! great work ! any news about this feature ?

@sarimarton
Copy link

I'm also pretty interested in this feature. I find PUG as the most legible format for SCs, JSON/YAML is too verbose vertically, XML is also noisy with the closing tags. PUG would perfect, but it turns into XML, so we need xml import :)

@Andarist
Copy link
Member

Conversion is partially supported by https://github.com/davidkpiano/xstate/blob/master/src/scxml.ts , it ain't 100% ready yet though - so stay tuned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants