{"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":11,"created_at":"2016-08-13T21:26:04Z","updated_at":"2016-08-14T02:09:24Z","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/239651840","html_url":"https://github.com/facebookincubator/create-react-app/issues/435#issuecomment-239651840","issue_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/435","id":239651840,"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},"created_at":"2016-08-14T02:09:24Z","updated_at":"2016-08-14T02:09:24Z","body":"tldr;\r\nGiven that `babel-preset-es2015` would be replaced with `babel-plugin-transform-es2015-modules-commonjs` and `babel-plugin-transform-es2015-destructuring`\r\n\r\n* Chrome 52 and Safari TP will work the same as they do now (if I don't miss something)\r\n* Firefox and Edge do support very much `babel-preset-es2015` features, but miss a couple less known ones.\r\n\r\nI have been looking at http://kangax.github.io/compat-table/es6 a bit.\r\n\r\n**Safari:**\r\nSafari 9 support 53% of ES6. That is clearly not enough, but Safari 10 (which is in beta) supports 99% of ES2015.  I read that Safari 10 will be released somewhere this fall. I was trying out Safari TP today, and it has actually very good developers tools. It actually seems like a pretty much direct copy of what Chrome has (even the UI). Reminds me of this quote of Steve Jobs hehe:\r\nhttps://www.youtube.com/watch?v=CW0DUg63lqU\r\n\r\nBut all in all, leaving out babel-preset-es2015 in development, means that if you develop a create-react-app in Safari, you need to download Safari TP, which I think is reasonable. \r\n\r\nThere is one thing that Safari doesn't support (and Babel does), and that is that is doesn't throw an error if you do an assigment in a for ... in statement:\r\nhttp://kangax.github.io/compat-table/es6/#test-miscellaneous_no_assignments_allowed_in_for-in_head\r\n\r\nNot any browser support this, is this because this would be a breaking change? Anyway, it doesn't matter, as in an create-react-app environment, doing an assignment in a for ... in statement, causes a compile time error.\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1035299/17646429/e6e1de50-61c8-11e6-8b73-fda95f827995.png)\r\n\r\n**Chrome:**\r\nChrome 52 has the same story as Safari TP, expect that it also doesn't support `Array.prototype.values`. I tried this in a create-react-app, but doesn't seem to work with babel-preset-es2015 included either. Is this a bug? I can only get this to work in a create-react app, if I include `import 'babel-polyfill';` to index.js. Not sure if this is the expected behaviour.\r\n\r\nAll in all, for Chrome 52 and Safari 10/TP, it seems that indeed, babel-preset-2015 can be replaced without problems with `babel-plugin-transform-es2015-modules-commonjs` and `babel-plugin-transform-es2015-destructuring` (as @hzoo suggested).\r\n\r\nNow for Firefox and Edge 14, it is a little bit different story. Firefox 50 supports 92% and Edge 14 supports 95%. There are quite a few things that babel supports and those 2 doesn't support yet, or only partly supports, or support using a flag.\r\n\r\nBoth Firefox and Edge doesn't support all well known symbols:\r\n* http://kangax.github.io/compat-table/es6/#test-well-known_symbols\r\n\r\nEdge supports all, but one with a flag, firefox doesn't support a couple that babel does support:\r\n* http://kangax.github.io/compat-table/es6/#test-function_name_property\r\n\r\nFirefox doesn't support two for ... of features and a static array method:\r\n* http://kangax.github.io/compat-table/es6/#test-for..of_loops\r\n* http://kangax.github.io/compat-table/es6/#test-Array_static_methods\r\n\r\nEdge doesn't support:\r\n* http://kangax.github.io/compat-table/es6/#test-Date.prototype[Symbol.toPrimitive]\r\n\r\nThose doesn't seem to well known babel features, but yes, it seems a bit odd that they won't work in development on Edge and Firefox and do work in production."}}
{"actor":{"display_login":"kasperpeulen"}}