{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/dev_compiler/issues/284","labels_url":"https://api.github.com/repos/dart-lang/dev_compiler/issues/284/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/dev_compiler/issues/284/comments","events_url":"https://api.github.com/repos/dart-lang/dev_compiler/issues/284/events","html_url":"https://github.com/dart-lang/dev_compiler/issues/284","id":99481172,"number":284,"title":"integrate with existing JS module systems","user":{"login":"jmesserly","id":1081711,"avatar_url":"https://avatars.githubusercontent.com/u/1081711?v=3","gravatar_id":"","url":"https://api.github.com/users/jmesserly","html_url":"https://github.com/jmesserly","followers_url":"https://api.github.com/users/jmesserly/followers","following_url":"https://api.github.com/users/jmesserly/following{/other_user}","gists_url":"https://api.github.com/users/jmesserly/gists{/gist_id}","starred_url":"https://api.github.com/users/jmesserly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmesserly/subscriptions","organizations_url":"https://api.github.com/users/jmesserly/orgs","repos_url":"https://api.github.com/users/jmesserly/repos","events_url":"https://api.github.com/users/jmesserly/events{/privacy}","received_events_url":"https://api.github.com/users/jmesserly/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/dev_compiler/labels/js","name":"js","color":"fef2c0"},{"url":"https://api.github.com/repos/dart-lang/dev_compiler/labels/task","name":"task","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-08-06T17:00:05Z","updated_at":"2015-11-17T23:16:13Z","closed_at":null,"body":"We have a few issues here:\r\n* [ ] linking: we shouldn't need to change the HTML file, as long as it references the entry point. We should be able to inject the `<script>` tags at runtime for everything else. (This pattern is fairly common, for example [webcomponents.js](https://github.com/webcomponents/webcomponentsjs/blob/51c337b2327ef63ee50ee1b69f50dc19966f1483/webcomponents.js))\r\n* [ ] bootstrapping: only the module system should be special. Everything else related to Dart support (SDK, DDC's runtime files) should be treated as normal code loaded through the module system.\r\n* [ ] use existing JS module system. Right now, we have dart_library, which is sort-of like AMD. But we should just use code/patterns that exists already.\r\n* [ ] Have some way of emitting different ES5 module patterns, because server and client are (usually) a bit different. More discussion of this in #34, about ES6 modules. If we could emit ES6 modules, Babel would offer users a way to transform to various ES5 formats, but this doesn't help us in the browser (we don't want another tool in the browser toolchain).\r\n"},"comment":{"url":"https://api.github.com/repos/dart-lang/dev_compiler/issues/comments/157541221","html_url":"https://github.com/dart-lang/dev_compiler/issues/284#issuecomment-157541221","issue_url":"https://api.github.com/repos/dart-lang/dev_compiler/issues/284","id":157541221,"user":{"login":"jonaskello","id":664076,"avatar_url":"https://avatars.githubusercontent.com/u/664076?v=3","gravatar_id":"","url":"https://api.github.com/users/jonaskello","html_url":"https://github.com/jonaskello","followers_url":"https://api.github.com/users/jonaskello/followers","following_url":"https://api.github.com/users/jonaskello/following{/other_user}","gists_url":"https://api.github.com/users/jonaskello/gists{/gist_id}","starred_url":"https://api.github.com/users/jonaskello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonaskello/subscriptions","organizations_url":"https://api.github.com/users/jonaskello/orgs","repos_url":"https://api.github.com/users/jonaskello/repos","events_url":"https://api.github.com/users/jonaskello/events{/privacy}","received_events_url":"https://api.github.com/users/jonaskello/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T23:16:13Z","updated_at":"2015-11-17T23:16:13Z","body":"Interesting, maybe it works with 5.x then. I am using the latest version (6.1.18). Here is what I am seeing:\r\n\r\n```\r\n$ babel --version\r\n6.1.18 (babel-core 6.1.19)\r\n$ babel repro6.js --out-file repro_es5.js\r\nError: repro6.js: We don't know what to do with this node type. We were previously a Statement but we can't fit in here?\r\n    at NodePath.insertBefore (/usr/local/lib/node_modules/babel-cli/node_modules/babel-traverse/lib/path/modification.js:62:13)\r\n```"}}