You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe in the future: 1. other browser extensions, 2. other tools listening to messages from the service (e.g. services running in Node.js, visualized in a separate program listening to the state of the service via HTTP requests)
Obstacles
The existing implementation of XState only supports a single browser extension as an inspection tool (Redux DevTools)
We want to keep XState core as small as possible, but logic for conforming to each listening device's interface gets in the way of that goal
Solutions
There are three approaches:
A. Move the DevTools logic completely outside of XState core (See implementation details at the bottom)
B. Keep the DevTools logic in XState core, but separate it from interpreter.ts (e.g. the proposedBrowserExtensionsManagerclass, which with the above context can be renamed to a more general ExternalDevices class)
C. Keep the DevTools logic in XState core, in interpreter.ts
Impact on end-user API:
A. User must import external devices and plug them in directly:
Make XState itself completely agnostic to DevTools. For most intents and purposes, XState just knows that some external device wants to know when the service:
starts
is updated
stops
And for each of these events, some data useful to that external device will be sent:
the machine being executed (on start)
the state of the service (on update)
the last XState event received (on update)
In this approach, XState has no logic dedicated to the external device, and it relies on it being set up externally (via another package, imported and passed in the options object as shown above)
Goal
We want to add more extensions:
Obstacles
Solutions
There are three approaches:
A. Move the DevTools logic completely outside of XState core (See implementation details at the bottom)
B. Keep the DevTools logic in XState core, but separate it from
interpreter.ts
(e.g. the proposedBrowserExtensionsManager
class, which with the above context can be renamed to a more generalExternalDevices
class)C. Keep the DevTools logic in XState core, in
interpreter.ts
Impact on end-user API:
A. User must import external devices and plug them in directly:
B. and C. : no impact, same API:
A - Implementation Details
And for each of these events, some data useful to that external device will be sent:
In this approach, XState has no logic dedicated to the external device, and it relies on it being set up externally (via another package, imported and passed in the options object as shown above)
In XState, this would look like:
The text was updated successfully, but these errors were encountered: