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

document machine-extractor and shared packages #215

Open
with-heart opened this issue Sep 16, 2022 · 0 comments
Open

document machine-extractor and shared packages #215

with-heart opened this issue Sep 16, 2022 · 0 comments

Comments

@with-heart
Copy link
Contributor

with-heart commented Sep 16, 2022

The @xstate/machine-extractor and @xstate/tools-shared packages are fairly powerful packages that could eventually serve as the foundation for a universe of XState-focused open source libs/tooling.

imo, we're just barely scratching the surface of what could be possible if we make it easy for anyone to translate between XState and ASTs/metadata

image

Unfortunately, the system currently feels pretty inaccessible. Which is totally fine! Not meant as a criticism in any way, that's just how it goes when you're building stuff.

That said though, I'm moderately knowledgeable in both babel and ASTs and it still took me quite awhile to wrap my head around the various pieces to the point that I could make any large-scale changes.

I'd like to propose creating at least entry-level documentation for these packages. A few reasons:

  • Forces us to define a clear public api

    It's still early with these packages, but I think it's better to start thinking about this sooner rather than later. Hard to think about it when it's not even clear what that api is, which documentation will help us discover.

  • Makes the packages more accessible to consumers or contributors

    I think this is important because more consumers = more feedback = better ideas + more paths forward, and similarly more contributors = more contributions + feedback = faster paths forward

  • Allows us the chance to define a language for some of the patterns and workflows the libraries use in order to achieve their outcomes

    An example of this is the parseNode key of the createParser options object as mentioned over here by @Andarist. That name tripped me up quite a few times. Writing documentation will help us find this type of ambiguous or confusing language and replace it with more clearly-defined terms.

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

No branches or pull requests

1 participant