-
Notifications
You must be signed in to change notification settings - Fork 516
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
fix(utils): warn only in development environment #3367
Conversation
Deploy preview for instantsearchjs ready! Built with commit 5eb1e79 |
the boolean trap as first argument seems a bit odd, since I would be surprised if the bundler can actually detect this as unused code when DEV is false. It probably needs to have its own if around each of them |
The bundler does detect them. If we keep the wrapping // ...
{
// whatever was here on top on the warning
}
// ... With the condition inside the FYI this is what React is doing for their |
Ah you're right, it's quite surprising that the bundler inlines those things. I didn't expect that, but that's good news! |
81f7739
to
541c6ac
Compare
Removed unnecessary checks.
This is the new signature of the
warning
method:It logs a warning only if the condition is not met.
The condition is now part of the method so that the production UMD build is stripped correctly with less code.