{"action":"created","issue":{"url":"https://api.github.com/repos/babel/ember-cli-babel/issues/24","labels_url":"https://api.github.com/repos/babel/ember-cli-babel/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/babel/ember-cli-babel/issues/24/comments","events_url":"https://api.github.com/repos/babel/ember-cli-babel/issues/24/events","html_url":"https://github.com/babel/ember-cli-babel/issues/24","id":60116232,"number":24,"title":"dynamic polyfil inclusion","user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"milestone":null,"comments":20,"created_at":"2015-03-06T15:30:37Z","updated_at":"2015-05-13T07:10:38Z","closed_at":null,"body":"Goals:\r\n\r\nHave babel report to us which files/modules depend on which polyfils, Babel may accomplish this by merely appending an import for the polyfil/dep the current module depends on. This would enable subsequent build-tooling to pull in only the polyfils that are needed, and isolate them to the module that explicitly depended on them.\r\n\r\nThis would help reduce the duplication caused by the small support algorithms currently inlined. \r\n\r\n```js\r\nvar _temporalAssertDefined = function (val, name, undef) { if (val === undef) { throw new ReferenceError(name + \" is not defined - temporal dead zone\"); } return true; };\r\n\r\nvar _temporalUndefined = {};\r\n\r\nvar _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); };\r\n```\r\n\r\nExample:\r\n\r\ngiven\r\n```js\r\nlet b = Symbol('foo')\r\nlet a = {\r\n  [b]() {\r\n    \r\n  }\r\n}\r\n```\r\n\r\nI would love to see something like:\r\n\r\n```js\r\nimport _temporalAssertDefined, { _temporalUndefined } from 'babel/temporal-assert-defined';\r\nimport _defineProperty from 'babel/defineProperty'\r\nimport Symbol from 'babel/core-js/symbol' // or something\r\n\r\nvar b = _temporalUndefined;\r\nvar a = _temporalUndefined;\r\n\r\nb = Symbol(\"foo\");\r\na = _defineProperty({}, _temporalAssertDefined(b, \"b\", _temporalUndefined) && b, function () {});\r\n```\r\n\r\nTodo:\r\n* [x] flesh this out more.\r\n\r\nQuestions:\r\n* [ ] should babel report back what features the module needs?\r\n* [x] should babel just drop an import and let the rest of the build system derive what is needed?\r\n* [x] does each support algorithm now need to be in its own module (i think so)"},"comment":{"url":"https://api.github.com/repos/babel/ember-cli-babel/issues/comments/101542932","html_url":"https://github.com/babel/ember-cli-babel/issues/24#issuecomment-101542932","issue_url":"https://api.github.com/repos/babel/ember-cli-babel/issues/24","id":101542932,"user":{"login":"ksnyde","id":980757,"avatar_url":"https://avatars.githubusercontent.com/u/980757?v=3","gravatar_id":"","url":"https://api.github.com/users/ksnyde","html_url":"https://github.com/ksnyde","followers_url":"https://api.github.com/users/ksnyde/followers","following_url":"https://api.github.com/users/ksnyde/following{/other_user}","gists_url":"https://api.github.com/users/ksnyde/gists{/gist_id}","starred_url":"https://api.github.com/users/ksnyde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksnyde/subscriptions","organizations_url":"https://api.github.com/users/ksnyde/orgs","repos_url":"https://api.github.com/users/ksnyde/repos","events_url":"https://api.github.com/users/ksnyde/events{/privacy}","received_events_url":"https://api.github.com/users/ksnyde/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T07:10:38Z","updated_at":"2015-05-13T07:10:38Z","body":"> I suppose we can provide an interim solution in the short term.\r\n\r\nWould love an interim solution if that's possible. Doesn't need to be optimal, just want PhantomJS to pass my tests for now."}}