-
Notifications
You must be signed in to change notification settings - Fork 17
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
Development diagnostics should be dropped from production version #35
Comments
@Satyam the link you provided does not show the problem you addressed. Could you fix it so that we could see exactly what you mean? |
You can see it at work in Facebook's own prop-types where the whole code for the property checker is enclosed in an Cases like the code I linked to might be more useful like this:
Notice also that the error has been changed to a |
Oh I get it. So your proposal is to add these kind of checks. |
It is the best way to provide them without concern as to how they may affect the performance/size of the end product. With this trick, they will be gone. As I mentioned in my first post, it is the end-developer who should create the bundle in production mode and strip the diagnostics. The library creator should publish it with those warnings still on,for the benefit of the final developer. Utilities like
|
Diagnostics like this one are not helpful in production versions. It is better to drop them conditionally:
When minimized for production by the final developer, it will be dropped as it is dead code.
The version of this utility published on npm should not be packed in production mode so the final developer gets this diagnostics.
The text was updated successfully, but these errors were encountered: