{"action":"created","issue":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/435","repository_url":"https://api.github.com/repos/facebookincubator/create-react-app","labels_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/435/labels{/name}","comments_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/435/comments","events_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/435/events","html_url":"https://github.com/facebookincubator/create-react-app/issues/435","id":171028169,"number":435,"title":"Consider leaving out babel-preset-es2015 in development.","user":{"login":"kasperpeulen","id":1035299,"avatar_url":"https://avatars.githubusercontent.com/u/1035299?v=3","gravatar_id":"","url":"https://api.github.com/users/kasperpeulen","html_url":"https://github.com/kasperpeulen","followers_url":"https://api.github.com/users/kasperpeulen/followers","following_url":"https://api.github.com/users/kasperpeulen/following{/other_user}","gists_url":"https://api.github.com/users/kasperpeulen/gists{/gist_id}","starred_url":"https://api.github.com/users/kasperpeulen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasperpeulen/subscriptions","organizations_url":"https://api.github.com/users/kasperpeulen/orgs","repos_url":"https://api.github.com/users/kasperpeulen/repos","events_url":"https://api.github.com/users/kasperpeulen/events{/privacy}","received_events_url":"https://api.github.com/users/kasperpeulen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-08-13T21:26:04Z","updated_at":"2016-08-14T03:06:03Z","closed_at":null,"body":"I think I have suggested this before, but I never saw anything that convinced me that this is a bad idea.\r\n\r\nIt is great that for *production* that IE and other older browsers are supported, but just for development, I like to have a super fast rebuild. And I like to debug code that is close to my own source.\r\n\r\nSo why would we enable all of the plugins of babel-preset-es2015, if the browser we develop in support ES6 syntax natively? I think the only exception is if you develop in IE11 on windows 7. But I think a good estimation would be that 99% of the people develop in Chrome, Firefox, Edge or Safari.\r\n\r\nNow it happens to be that those browser support ES6. So I think it would make sense to *not* use babel-preset-es2015 in development. The only plugin you need is `babel-plugin-transform-es2015-modules-commonjs` as the import spec is not yet finalised and implemented in browsers.\r\n\r\nI have been trying that in an eject. And it seems much faster on larger apps. And because the lack of source-map support, it does help with understanding where the error is located."},"comment":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/comments/239653320","html_url":"https://github.com/facebookincubator/create-react-app/issues/435#issuecomment-239653320","issue_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/435","id":239653320,"user":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"created_at":"2016-08-14T03:06:03Z","updated_at":"2016-08-14T03:06:03Z","body":"Here's my proposal.\r\n\r\nBy default we compile assuming the browser is evergreen. This gives us fastest build times and least mangled output.\r\n\r\nWe also add a middleware to Webpack dev server. It sniffs user agent.\r\n\r\nIf it detects an evergreen browser then nothing happens. Bundle is served as usual.\r\n\r\nHowever if UA is outdated (or unknown) the server \"downgrades\". Practically it means that we restart the server with full ES2015 preset. The rest of the current session will now be using it. \r\n\r\nIf you restart the server, it will start in modern mode again.\r\n\r\nTo sum up:\r\n\r\n1. By default we use modern mode. Use case: normal development. \r\n2. A request from an old or unknown UA \"downgrades\" us to compat mode with all transforms, and it stays enabled throughout the session. Use case: testing in older browsers. \r\n\r\nI don't know how \"downgrading\" would work. It would be neat to avoid restarting the server, and just swap out the Webpack compiler. I'm not sure if WDS allows this but we might want to have our own custom server anyway (WDS is a tiny wrapper over Express) so maybe it makes sense to do it manually.\r\n\r\nAny exploration work is welcome here and will be most appreciated. I understand the first impulse is to \"put a flag on it\" but that's not what we do in Create React App. "}}
{"actor":{"display_login":"gaearon"}}