Explore encouraging users to not ship DEV mode to production
Problem
*Do you want to request a feature or report a bug? Feature What is the current behavior? Developers meaning to do the right thing will often accidentally ship DEV mode to production rather than PROD mode. This can have a significant impact on performance. Although DEV->PROD is a one line change, it's something React could explore encouraging. <img src='https://cloud.githubusercontent.com/assets/110953/21949283/b876d642-d9a5-11e6-9b52-83a6dc3fd750.jpg' width='400px'> <img src='https://cloud.githubusercontent.com/assets/110953/21949289/c283af0c-d9a5-11e6-8f05-d100cc0814f0.jpg' width='400px'> There's great nuance here and I know that there's balance to be struck between the overall DX value this brings vs UX. Another challenge is that the change itself is trivial to make. It's unclear whether the right solution here is better defaults or stronger advocacy. Folks like @sebmarkbage have been acknowledging that this is a known issue so perhaps there's room for discussion to help improve this. <img src='https://cloud.githubusercontent.com/assets/110953/21949384/b4a5b780-d9a6-11e6-917e-1b0d513e8867.jpg' width='400px'> He's also noted that a switch from no warnings to DEV may require some folks to fix whole codebases which is also suboptimal. There may be an in-between solution worth talking about here however. What is the expected behavior? React encourages users to ship PROD mode to production rather than DEV. I would be open to a solution that is either provided at the lib
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Explore encouraging users to not ship DEV mode to production
@surma maybe they should use `console.warn` or `console.error` for better visibility ๐ I don't see how it would be acceptable in any scenario to inject content into an application only when it's running in production. You're making a huge assumption that the message would be caught before the application was pushed to actual users, where the message could potentially hurt UX in a major way.
Trust Score
6 verifications
- 1
@surma maybe they should use `console.warn` or `console.error` for better visibi
@surma maybe they should use `console.warn` or `console.error` for better visibility ๐
- 2
I don't see how it would be acceptable in any scenario to inject content into an
I don't see how it would be acceptable in any scenario to inject content into an application only when it's running in production. You're making a huge assumption that the message would be caught before the application was pushed to actual users, where the message could potentially hurt UX in a major way.
Validation
Resolved in facebook/react GitHub issue #8784. Community reactions: 13 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep