Skip to content

Optimizing XState for production environments #1458

Discussion options

You must be logged in to vote

So I was wondering if devTools: true has performance implications which would suggest to turn them off in production?

It probably has a minimal impact; what it does is notify listeners that services have been registered on a global window.__xstate__ object, if it exists. If it doesn't exist, it does nothing. Still, it's better to set it to false in production, especially for security purposes.

I think it would be useful to have a global configuration ability to configure devTools and a logger for all interpreted services. The global config can be partially overwritten by local configurations.

I thought this at first too, but what if you're using 3rd-party components that are using XSt…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by christoph-fricke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants