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
I propose MSW, both setupWorker and setupServer throw an exception when detected being run in NODE_ENV === 'production'.
Motivation
When MSW gets to a production environment that's a mistake on the developer's end 9 times out of 10. I believe this would be a good default behavior to have to prevent this kind of mistake.
Implementation
Apart from raising an exception, this feature should also introduce an opt-out mechanism for those who explicitly wish to run MSW in production. We must still permit to run MSW anywhere the end user want but they need to explicitly state their intention. I know that a lot of teachers rely on MSW in production to teach their workshops. I want them to keep doing that without hindrance.
@kentcdodds hi, 👋 Do you have any considerations I may be not seeing in regard to this feature? How would this impact your and your students' experience, for example?
Scope
Adds a new behavior
Compatibility
Feature description
I propose MSW, both
setupWorker
andsetupServer
throw an exception when detected being run inNODE_ENV === 'production'
.Motivation
When MSW gets to a production environment that's a mistake on the developer's end 9 times out of 10. I believe this would be a good default behavior to have to prevent this kind of mistake.
Implementation
Apart from raising an exception, this feature should also introduce an opt-out mechanism for those who explicitly wish to run MSW in production. We must still permit to run MSW anywhere the end user want but they need to explicitly state their intention. I know that a lot of teachers rely on MSW in production to teach their workshops. I want them to keep doing that without hindrance.
When the
dangerouslyRunInProduction
is provided and equalstrue
, suppress the said exception.The text was updated successfully, but these errors were encountered: