-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
@xstate/inspect should not bail in production #2020
Comments
Right, the integration with Redux DevTools is available in production (from what I see in the source code) so this should be too. We probably should put a doc in place to explain to people how to configure stuff properly though so they don't start opening popups in production by accident 🤔 |
I too tracked it down to this. I raised an MR without thinking too deeply about it, this morning it occurs to me that we have 2 checks for this, as shown below. https://github.com/davidkpiano/xstate/blob/f3870f837e7d86bd4e3a1d28485e76b026579291/packages/core/src/devTools.ts#L43-L47 I think we can just remove the
I don't think we need anything extra to do this, the popup is triggered from @xstate/inspect and isn't actually checking for |
@Andarist what do you think about the above just removing the |
You are right. I think it should be OK to remove this production check then - unless @davidkpiano doesn't think so. |
That's fine. Just have to make a note in the docs that it's important to prevent the inspector from running in prod, if that is not desirable. |
@xstate/inspect
works whenprocess.env.NODE_ENV === 'development'
, but fails whenNODE_ENV === 'production'
. This is due to this line of code:https://github.com/davidkpiano/xstate/blob/f3870f837e7d86bd4e3a1d28485e76b026579291/packages/core/src/devTools.ts#L43
Reproduction:
https://github.com/mattpocock/xstate-inspect-repro
Instead of bailing here, we should leave it up to the user whether or not they choose to have
devTools: true
in productionThe text was updated successfully, but these errors were encountered: