{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel-preset-env/issues/56","repository_url":"https://api.github.com/repos/babel/babel-preset-env","labels_url":"https://api.github.com/repos/babel/babel-preset-env/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel-preset-env/issues/56/comments","events_url":"https://api.github.com/repos/babel/babel-preset-env/issues/56/events","html_url":"https://github.com/babel/babel-preset-env/pull/56","id":193161467,"number":56,"title":"add useBuiltIns option","user":{"login":"hzoo","id":588473,"avatar_url":"https://avatars.githubusercontent.com/u/588473?v=3","gravatar_id":"","url":"https://api.github.com/users/hzoo","html_url":"https://github.com/hzoo","followers_url":"https://api.github.com/users/hzoo/followers","following_url":"https://api.github.com/users/hzoo/following{/other_user}","gists_url":"https://api.github.com/users/hzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/hzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzoo/subscriptions","organizations_url":"https://api.github.com/users/hzoo/orgs","repos_url":"https://api.github.com/users/hzoo/repos","events_url":"https://api.github.com/users/hzoo/events{/privacy}","received_events_url":"https://api.github.com/users/hzoo/received_events","type":"User","site_admin":false},"labels":[{"id":424467600,"url":"https://api.github.com/repos/babel/babel-preset-env/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-02T16:40:26Z","updated_at":"2016-12-07T04:36:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/babel/babel-preset-env/pulls/56","html_url":"https://github.com/babel/babel-preset-env/pull/56","diff_url":"https://github.com/babel/babel-preset-env/pull/56.diff","patch_url":"https://github.com/babel/babel-preset-env/pull/56.patch"},"body":"Ref https://github.com/babel/babel-preset-env/issues/20\r\n\r\nTD;LR:\r\n\r\nturns \r\n\r\n```js\r\nimport 'babel-polyfill'; // all of the polyfill\r\n```\r\n\r\ninto \r\n\r\n```js\r\nimport \"core-js/modules/es6.object.assign\"; // required individual modules\r\nimport \"core-js/modules/...\";`\r\n...\r\n```\r\n\r\nbased on supported environment\r\n\r\n<img width=\"1015\" alt=\"screen shot 2016-12-01 at 8 34 51 pm\" src=\"https://cloud.githubusercontent.com/assets/588473/20842106/4cff59ee-b884-11e6-9328-974324c94f5b.png\">\r\n\r\ncc @zloirock, @chicoxyzzy, @Kovensky, @keyanzhang, @ljharb\r\n\r\ncompat-table data -> data/builtInFeatures.js (mapping core-js module to builtins) -> babel plugin that turns `import babel-polyfill` into individual imports\r\n\r\n---\r\n- [x] add the rest of the built-ins (there's a lot)\r\n- [ ] verify that the mapping for polyfill-> compat-table is correct\r\n  - example: \"typed/array-buffer\"/typed arrays - should it be per array or just the whole feature?\r\n  - references are https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-runtime/src/definitions.js\r\n  - http://kangax.github.io/compat-table/es6\r\n  - https://github.com/zloirock/core-js\r\n- [x] create the option in the preset to turn this on\r\n- [x] write the babel plugin to transform the import/require statement for `import babel-polyfill`\r\n- [x] test the plugin with http://henryzoo.com/esprima_ast_explorer/#/ZOw13NK8Tr/4\r\n- [x] readme update\r\n- [x] tests\r\n- [x] fix empty data bug\r\n- [x] prevent duplicate imports\r\n- [ ] what to do about experimental built-ins and compatibility with the regular `import \"babel-polyfill\"`?\r\n- [x] regenerator\r\n---\r\n\r\n` data/builtInFeatures.js` is similar to `data/pluginFeatures.js`\r\n\r\nWe try to match the [core-js](https://github.com/zloirock/core-js#commonjs) module name with the corresponding test name in the [compat-table](https://github.com/kangax/compat-table/blob/gh-pages/data-es6.js).\r\n\r\n```\r\n\"es6.typed.int8-array\": \"typed arrays / Int8Array\",\r\n```\r\n\r\nExample:\r\n\r\n![screen shot 2016-12-02 at 5 09 10 pm](https://cloud.githubusercontent.com/assets/588473/20852121/14224392-b8b2-11e6-8c91-365cd3272301.png)\r\n\r\n```\r\n\"es6.object.assign\": \"Object static methods / Object.assign\",\r\n\"es6.object.is\": \"Object static methods / Object.is\",\r\n```\r\n\r\n`import 'babel-polyfill'` -> `import \"core-js/modules/es6.object.assign\";`\r\n"},"comment":{"url":"https://api.github.com/repos/babel/babel-preset-env/issues/comments/265353748","html_url":"https://github.com/babel/babel-preset-env/pull/56#issuecomment-265353748","issue_url":"https://api.github.com/repos/babel/babel-preset-env/issues/56","id":265353748,"user":{"login":"Kovensky","id":73085,"avatar_url":"https://avatars.githubusercontent.com/u/73085?v=3","gravatar_id":"","url":"https://api.github.com/users/Kovensky","html_url":"https://github.com/Kovensky","followers_url":"https://api.github.com/users/Kovensky/followers","following_url":"https://api.github.com/users/Kovensky/following{/other_user}","gists_url":"https://api.github.com/users/Kovensky/gists{/gist_id}","starred_url":"https://api.github.com/users/Kovensky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kovensky/subscriptions","organizations_url":"https://api.github.com/users/Kovensky/orgs","repos_url":"https://api.github.com/users/Kovensky/repos","events_url":"https://api.github.com/users/Kovensky/events{/privacy}","received_events_url":"https://api.github.com/users/Kovensky/received_events","type":"User","site_admin":false},"created_at":"2016-12-07T04:36:09Z","updated_at":"2016-12-07T04:36:09Z","body":"`core-js/shim` also includes `web.timers` (only needed for IE <= 9?), `web.immediate` (experimental?) and `web.dom.iterable`."}}
{"actor":{"display_login":"Kovensky"}}