cassiozen / useStateMachine

The <1 kb state machine hook for React
MIT License
2.38k stars 47 forks source link

Documentation discussion #71

Open devanshj opened 3 years ago

devanshj commented 3 years ago

@cassiozen How and where would you want me to write that document covering typescript features? Like maybe in a "Features" section? Or like in a changelog? (that would be lame haha)

And if I'm going to use shiki-twoslash we'd have to host it somewhere. So should we make a documentation website? Or if all this is on low priority I can simply add a wiki page mentioning typescript features with screenshots?

I'm not sure how to go about this haha

cassiozen commented 3 years ago

We will need a site at some point, given that GitHub's wiki solution is so poor, but that's not something I could take on immediately.

Do you think you could, for now, use the wiki with screenshots and links to the TypeScript playground?

cassiozen commented 3 years ago

To be even more specific, I think it would be great to have a Primer, a tl;dr on the readme plus the full article on its own documentation / wiki page.

devanshj commented 3 years ago

that's not something I could take on immediately.

No problems!

use the wiki with screenshots and links to the TypeScript playground?

Yep that's not bad, doable

a Primer, a tl;dr on the readme

Yeah my thoughts are similar it's good to point out key-selling features on the readme and then dive into all features in details in a separate place like a wiki page

cassiozen commented 3 years ago

As discussed we now have a docusaurus setup under the website folder, with shiki-twoslash configured.

This is not hosted yet, but you can start working there and we will publish it before the final 1.0.0 release

cassiozen commented 3 years ago

Deployed: https://usestatemachine.js.org/

devanshj commented 3 years ago

Looks so cool! Sorry haven't got time to write the documentation (building my blog :P) but will do it asap.

Also make sure to not release v1 with [state, send] or else with sendT feature it would be a breaking change so v1 should be published (if at all you're doing that already) with the return type as...

{ state: ...
, context: ...
, event: ...
, nextEvents: ...
, nextEventsT: ...
, send: ...
}

I'll send a PR making the change

cassiozen commented 3 years ago

Yeah, I just copied the current readme. Send the PR and I work on properly splitting and updating the docs.

cassiozen commented 3 years ago

With that the only thing missing for the 1.0 release will be your article and my video, correct? Am I missing something?

We can target sendT for 1.1 and hierarchical for 1.2

devanshj commented 3 years ago

Am I missing something?

Probably not, just types-lite but we can have them for later release

We can target sendT for 1.1 and hierarchical for 1.2

Sure