-
Notifications
You must be signed in to change notification settings - Fork 42
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
Capture any string in the meta field of a machine or state #225
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 47ac2a6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
What does this solve? Where do you expect to see those extra keys? |
609baff
to
47ac2a6
Compare
At the moment, I would like to use them here to generate gherkin tests from an xstate statechart. Meta keys are generally useful for any type of statechart reflection like this. If they are captured by the machine-extractor, it becomes much easier to build these types of tools that rely on state metadata. |
This is a favorable change, since |
I'm just slightly worried about the ripple effect of this change at the moment. I'm unsure how the previous thing was exactly utilized by our system. The current API of this package is really coupled at times to the underlying AST - and in fact, this change is a breaking change for this package. I don't mind this change but I would have to do a deeper analysis to see if this would be a breaking change for us. |
Totally makes sense. Let me know if I can be helpful in analyzing that. If it helps, the previous behavior was to capture
If a file had a machine that defined:
With this change, you may get a meta without a description (which may not have been expected previously). That is the main way that this could break existing code. However, based on the type returned from |
The breaking change I had in mind is about the shape of the extracted node - unfortunately, the AST shape leaks there. Now you have |
@Andarist - 2 thoughts:
Would either of these be helpful? |
Currently, only description is captured from meta. It would be super helpful to capture any string meta field.