Skip to content
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

feat: add dangerouslyRunInProduction flag to worker and server options #1791

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

scr2em
Copy link

@scr2em scr2em commented Oct 23, 2023

@scr2em
Copy link
Author

scr2em commented Oct 23, 2023

@kettanaito this actually breaks the current tests, do we need to enable dangerouslyRunInProduction in the package tests ?

invariant(
!this.context.startOptions.dangerouslyRunInProduction && isProduction(),
devUtils.formatMessage(
'The flag dangerouslyRunInProduction is false but you are in a production environment',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think if we phrase this error a bit better? Perhaps something like this?

  • Failed to call "setupWorker" in a production environment. Please make sure you enable API mocking conditionally so it doesn't leak to production.

Don't even mention the flag that controls it to emphasize the importance of this behavior. Still include a link to the docs about the flag for those who know what they are doing and want to suppress this behavior.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kettanaito let me know the link when you finish it

@kettanaito
Copy link
Member

Updated the branch. Still need some time to review and document this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Throw when run in production
2 participants