#XState in a library setting?

1 messages · Page 1 of 1 (latest)

fervent ocean
#

do you think xstate is suitable to be used as an implementation detail in a library?

i'm creating a library which essentially consists of two actors, on different machines, that need to communicate and manage state together. i've implemented a PoC already using xstate, but i now need to generalise it and distribute as a library

some points:

  • performance doesn't really matter at this stage (i'm sure xstate is adequate), but bundle size is a concern (one actor can be in the browser)
  • my machine requires nested and parallel states as well as invoked services

i ideally wanna support deno in the future, which i know probably isn't gonna be easily possible with xstate (maybe in v5 it will be tho?)

stone iron
#

I think using it as part of a library should be just fine. As you said, the main downside might be that it adds to the bundle size, so that's I guess for you to decide - how much bloat would the library be with xstate (or any state management system) add than without

fervent ocean
#

I think supporting Deno is a main thing, but I can have some restraint and ship an MVP first 😅 I struggle a lot with having to have these things perfect from the beginning haha

#

Oh xstate is only 17kb minified and gzipped, that's way better than I was expecting

#

Dunno why I didn't check that before