{"action":"created","issue":{"url":"https://api.github.com/repos/BladeRunnerJS/brjs/issues/1389","labels_url":"https://api.github.com/repos/BladeRunnerJS/brjs/issues/1389/labels{/name}","comments_url":"https://api.github.com/repos/BladeRunnerJS/brjs/issues/1389/comments","events_url":"https://api.github.com/repos/BladeRunnerJS/brjs/issues/1389/events","html_url":"https://github.com/BladeRunnerJS/brjs/issues/1389","id":75989681,"number":1389,"title":"SPIKE: Convert BRJS to use SystemJS","user":{"login":"dchambers","id":283294,"avatar_url":"https://avatars.githubusercontent.com/u/283294?v=3","gravatar_id":"","url":"https://api.github.com/users/dchambers","html_url":"https://github.com/dchambers","followers_url":"https://api.github.com/users/dchambers/followers","following_url":"https://api.github.com/users/dchambers/following{/other_user}","gists_url":"https://api.github.com/users/dchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/dchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchambers/subscriptions","organizations_url":"https://api.github.com/users/dchambers/orgs","repos_url":"https://api.github.com/users/dchambers/repos","events_url":"https://api.github.com/users/dchambers/events{/privacy}","received_events_url":"https://api.github.com/users/dchambers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"dchambers","id":283294,"avatar_url":"https://avatars.githubusercontent.com/u/283294?v=3","gravatar_id":"","url":"https://api.github.com/users/dchambers","html_url":"https://github.com/dchambers","followers_url":"https://api.github.com/users/dchambers/followers","following_url":"https://api.github.com/users/dchambers/following{/other_user}","gists_url":"https://api.github.com/users/dchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/dchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchambers/subscriptions","organizations_url":"https://api.github.com/users/dchambers/orgs","repos_url":"https://api.github.com/users/dchambers/repos","events_url":"https://api.github.com/users/dchambers/events{/privacy}","received_events_url":"https://api.github.com/users/dchambers/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2015-05-13T13:45:37Z","updated_at":"2015-05-19T19:47:57Z","closed_at":null,"body":"I've been working on three separate design proposals, all of which are affected by the need for a common bundling format that can also support something akin to sub-realms:\r\n\r\n  * [NPM Design Proposal](https://github.com/BladeRunnerJS/brjs/wiki/BladeRunnerJS-NPM-Integration-Strawman) (requires unified bundling format)\r\n  * [ES6 Design Proposal](https://github.com/BladeRunnerJS/brjs/issues/1303) (requires unified bundling format)\r\n  * [New Service Registry Design Proposal](https://github.com/BladeRunnerJS/brjs/wiki/New-Registry-Proposal) (dependent on whether our new module system can allow modules to be mocked in test)\r\n\r\nI've so far been able to prove within a spike that [SystemJS](https://github.com/systemjs/systemjs) fulfills all of our needs, and appears to be supported by the transpilers we might want to use to add support for ES6. The next thing to do is to convert BRJS to use SystemJS within a branch to further validate these three design proposals before any work is done.\r\n\r\nThis requires the following tasks to be performed:\r\n\r\n  - [x] Verify that I can use babelify to generate named modules that can be consumed by SystemJS (within the [es6-module-loader-spike](https://github.com/dchambers/es6-module-loader-spike)).\r\n  - [ ] Convert BRJS to use SystemJS (verify the app runs).\r\n  - [ ] Implement a [MockableSystem](https://github.com/whatwg/loader/issues/30#issuecomment-101567409) library and update sub-realms to proxy through to it (verify the tests run).\r\n"},"comment":{"url":"https://api.github.com/repos/BladeRunnerJS/brjs/issues/comments/103649050","html_url":"https://github.com/BladeRunnerJS/brjs/issues/1389#issuecomment-103649050","issue_url":"https://api.github.com/repos/BladeRunnerJS/brjs/issues/1389","id":103649050,"user":{"login":"dchambers","id":283294,"avatar_url":"https://avatars.githubusercontent.com/u/283294?v=3","gravatar_id":"","url":"https://api.github.com/users/dchambers","html_url":"https://github.com/dchambers","followers_url":"https://api.github.com/users/dchambers/followers","following_url":"https://api.github.com/users/dchambers/following{/other_user}","gists_url":"https://api.github.com/users/dchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/dchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchambers/subscriptions","organizations_url":"https://api.github.com/users/dchambers/orgs","repos_url":"https://api.github.com/users/dchambers/repos","events_url":"https://api.github.com/users/dchambers/events{/privacy}","received_events_url":"https://api.github.com/users/dchambers/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T19:47:57Z","updated_at":"2015-05-19T19:47:57Z","body":"After speaking to @james-shaw-turner earlier today I realized that it's worth documenting the various NPM bundling options:\r\n\r\n  1. [browserify](http://browserify.org/): this produces a CommonJS style bundle which involves defining `require()`, making it a little hard to combine with [browser-modules](https://github.com/BladeRunnerJS/browser-modules), which does the same, and also meaning that the sub-realms feature would only allow BRJS modules to be mocked, but not NPM modules.\r\n  1. [babelify](https://github.com/babel/babelify): although this can be used to transpile ES6, it is also of interest here because it supports bundling to [`System.register`](https://github.com/ModuleLoader/es6-module-loader/wiki/System.register-Explained) format, which allows bundles from different places to be more easily combined. Unfortunately, it outputs anonymous bundles which are designed for on-demand loading on a server rather than pre-emptive bundling.\r\n  1. [jspm](http://jspm.io/): This also produces `System.register` bundles, and produces bundles designed for sending to the browser, but requires `jspm install` to be used instead of `npm install`.\r\n"}}