{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/8784","repository_url":"https://api.github.com/repos/facebook/react","labels_url":"https://api.github.com/repos/facebook/react/issues/8784/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/8784/comments","events_url":"https://api.github.com/repos/facebook/react/issues/8784/events","html_url":"https://github.com/facebook/react/issues/8784","id":200759892,"number":8784,"title":"Explore encouraging users to not ship DEV mode to production","user":{"login":"addyosmani","id":110953,"avatar_url":"https://avatars.githubusercontent.com/u/110953?v=3","gravatar_id":"","url":"https://api.github.com/users/addyosmani","html_url":"https://github.com/addyosmani","followers_url":"https://api.github.com/users/addyosmani/followers","following_url":"https://api.github.com/users/addyosmani/following{/other_user}","gists_url":"https://api.github.com/users/addyosmani/gists{/gist_id}","starred_url":"https://api.github.com/users/addyosmani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/addyosmani/subscriptions","organizations_url":"https://api.github.com/users/addyosmani/orgs","repos_url":"https://api.github.com/users/addyosmani/repos","events_url":"https://api.github.com/users/addyosmani/events{/privacy}","received_events_url":"https://api.github.com/users/addyosmani/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":38,"created_at":"2017-01-13T23:49:15Z","updated_at":"2017-01-14T14:43:19Z","closed_at":null,"body":"**Do you want to request a *feature* or report a *bug*?**\r\nFeature\r\n\r\n**What is the current behavior?**\r\nDevelopers 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. \r\n\r\n<img src='https://cloud.githubusercontent.com/assets/110953/21949283/b876d642-d9a5-11e6-9b52-83a6dc3fd750.jpg' width='400px'>\r\n\r\n<img src='https://cloud.githubusercontent.com/assets/110953/21949289/c283af0c-d9a5-11e6-8f05-d100cc0814f0.jpg' width='400px'>\r\n\r\nThere's [great nuance](https://twitter.com/sebmarkbage/status/820049429268807681) 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.\r\n\r\n<img src='https://cloud.githubusercontent.com/assets/110953/21949384/b4a5b780-d9a6-11e6-917e-1b0d513e8867.jpg' width='400px'>\r\n\r\nHe'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.\r\n\r\n**What is the expected behavior?**\r\n\r\nReact encourages users to ship PROD mode to production rather than DEV. I would be open to a solution that is either provided at the library layer (or somehow tackled during build/bundling time by Webpack) that tries to ameliorate this.\r\n\r\n[This](https://twitter.com/TheLarkInn/status/820053618661408770) thread had a number of suggestions ranging from localhost detection, to alerts to injecting 'dev mode' messages to the DOM if used in a production environment. Something like this:\r\n\r\n<img src='https://cloud.githubusercontent.com/assets/110953/21949932/041fc414-d9ab-11e6-890b-b8f42f2955c8.jpg' width='500px'>\r\n\r\n\r\nAlternatively, @thelarkinn was proposing that we tried to standardize on ENV configs being [required](https://twitter.com/TheLarkInn/status/820052791225880576) to better facilitate detection of messaging like this. It's unclear which of these would be the most realistic. There are likely other ideas React core might have around how to tackle the problem.\r\n\r\n**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**\r\n\r\nAll recent versions.\r\n\r\n[This](https://twitter.com/jordwalke/status/820021509846548480) thread from @jordwalke prompted this issue. I think he also makes a fair point regarding benchmarks, but I care about how we can help folks ship the prod experience y'all have worked on optimizing to end customers in all it's glory."},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/272628433","html_url":"https://github.com/facebook/react/issues/8784#issuecomment-272628433","issue_url":"https://api.github.com/repos/facebook/react/issues/8784","id":272628433,"user":{"login":"jakearchibald","id":93594,"avatar_url":"https://avatars.githubusercontent.com/u/93594?v=3","gravatar_id":"","url":"https://api.github.com/users/jakearchibald","html_url":"https://github.com/jakearchibald","followers_url":"https://api.github.com/users/jakearchibald/followers","following_url":"https://api.github.com/users/jakearchibald/following{/other_user}","gists_url":"https://api.github.com/users/jakearchibald/gists{/gist_id}","starred_url":"https://api.github.com/users/jakearchibald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakearchibald/subscriptions","organizations_url":"https://api.github.com/users/jakearchibald/orgs","repos_url":"https://api.github.com/users/jakearchibald/repos","events_url":"https://api.github.com/users/jakearchibald/events{/privacy}","received_events_url":"https://api.github.com/users/jakearchibald/received_events","type":"User","site_admin":false},"created_at":"2017-01-14T14:43:19Z","updated_at":"2017-01-14T14:43:19Z","body":"Let's not get too hung up on the \"2 hours\" thing. It could be any period of time as long as it works.\r\n\r\nAdditionally, local storage events means it would only need to be dismissed once per origin. If you have multiple demos on one page, dismissing one would dismiss the others.\r\n\r\nIf the warning does slip into live, it's loud enough to warrant a quick fix - one that benefits users. If we're worried about how React looks in public, we really want to avoid unnecessary slow-down like this.\r\n\r\nSure, this wouldn't detect bad caching headers etc, this is about detecting \"dev mode\" only. Also \"slippery slope\" arguments aren't helpful.\r\n\r\nI don't think moving the problem to build tools is useful, as you'll have the same problem if devs use a different build tool, or fail to put that into production mode. Dev mode frameworks already produce console warnings, and that clearly isn't working.\r\n\r\nThis isn't just about benchmarks, it's about real websites, running slow for real users, because a switch wasn't switched."}}
{"actor":{"display_login":"jakearchibald"}}