{"action":"created","issue":{"url":"https://api.github.com/repos/finom/babel-plugin-transform-es2015-modules-simple-amd/issues/3","repository_url":"https://api.github.com/repos/finom/babel-plugin-transform-es2015-modules-simple-amd","labels_url":"https://api.github.com/repos/finom/babel-plugin-transform-es2015-modules-simple-amd/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/finom/babel-plugin-transform-es2015-modules-simple-amd/issues/3/comments","events_url":"https://api.github.com/repos/finom/babel-plugin-transform-es2015-modules-simple-amd/issues/3/events","html_url":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-amd/issues/3","id":145354051,"number":3,"title":"[feature request] support for non-default exports / imports","user":{"login":"dgoldstein0","id":1075063,"avatar_url":"https://avatars.githubusercontent.com/u/1075063?v=3","gravatar_id":"","url":"https://api.github.com/users/dgoldstein0","html_url":"https://github.com/dgoldstein0","followers_url":"https://api.github.com/users/dgoldstein0/followers","following_url":"https://api.github.com/users/dgoldstein0/following{/other_user}","gists_url":"https://api.github.com/users/dgoldstein0/gists{/gist_id}","starred_url":"https://api.github.com/users/dgoldstein0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgoldstein0/subscriptions","organizations_url":"https://api.github.com/users/dgoldstein0/orgs","repos_url":"https://api.github.com/users/dgoldstein0/repos","events_url":"https://api.github.com/users/dgoldstein0/events{/privacy}","received_events_url":"https://api.github.com/users/dgoldstein0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-02T09:12:36Z","updated_at":"2016-04-11T10:41:13Z","closed_at":null,"body":"It would be really cool if this could support non-default exports / destructuring-style imports, e.g.\r\n\r\nfoo.js\r\n```\r\nexport function a(){...};\r\nexport function b(){...};\r\n```\r\n\r\nbar.js\r\n```\r\nimport {a, b} from foo;\r\n```\r\n\r\nor at least support it with a syntax like\r\n\r\nfoo.js\r\n```\r\nexport default {a: function(){...}, b: function(){...}};\r\n```\r\n\r\nI imagine this would come with the restriction that no module compiled with this plugin could have both an `export default` and named exports - even though that's technically allowed by the ES6 spec.\r\n\r\nWhy I want this: I work on a fairly sizeable coffeescript / AMD codebase, and we are looking to migrate to ES6.  We were going to use babel-plugin-transform-es2015-modules-amd, but the problem we found with it is that our coffeescript modules do not understand it's version of default exports - they are not going to `.default` anything without modification, which makes incremental upgrading hard for some of our modules.  I was very happy to see this plugin which does default exports the way I wanted, but we also have a penchant for using destructuring on coffeescript imports and I would like to be able to use `import {...} from foo` as an alternative to that; the few ES6 modules we've written so far already make use of this syntax."},"comment":{"url":"https://api.github.com/repos/finom/babel-plugin-transform-es2015-modules-simple-amd/issues/comments/208278340","html_url":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-amd/issues/3#issuecomment-208278340","issue_url":"https://api.github.com/repos/finom/babel-plugin-transform-es2015-modules-simple-amd/issues/3","id":208278340,"user":{"login":"dgoldstein0","id":1075063,"avatar_url":"https://avatars.githubusercontent.com/u/1075063?v=3","gravatar_id":"","url":"https://api.github.com/users/dgoldstein0","html_url":"https://github.com/dgoldstein0","followers_url":"https://api.github.com/users/dgoldstein0/followers","following_url":"https://api.github.com/users/dgoldstein0/following{/other_user}","gists_url":"https://api.github.com/users/dgoldstein0/gists{/gist_id}","starred_url":"https://api.github.com/users/dgoldstein0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgoldstein0/subscriptions","organizations_url":"https://api.github.com/users/dgoldstein0/orgs","repos_url":"https://api.github.com/users/dgoldstein0/repos","events_url":"https://api.github.com/users/dgoldstein0/events{/privacy}","received_events_url":"https://api.github.com/users/dgoldstein0/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T10:41:13Z","updated_at":"2016-04-11T10:41:13Z","body":"actually after reading about ES6 imports some more I'm not sure this is\neven supposed to work this way - my reading of a bunch of ES6 blogs / docs\nseems to suggest this syntax is for importing named imports, not\ndestructuring the default import.  Doesn't mean it wouldn't be useful\nthough.\n\nOn Mon, Apr 4, 2016 at 9:29 AM Andrey Gubanov <notifications@github.com>\nwrote:\n\n> import {a, b} from foo;\n>\n> This syntax makes sense and I will definitely do it. Unfortunately I'm not\n> sponsored dev and I don't have enough time to close this issue quickly.\n> Thank you for your message.\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/finom/babel-plugin-transform-es2015-modules-simple-amd/issues/3#issuecomment-205379208>\n>\n"}}