{"action":"created","comment":{"url":"https://api.github.com/repos/guardian/frontend/pulls/comments/27114418","id":27114418,"diff_hunk":"@@ -5,6 +5,27 @@\n \n @* Scripts that should be executed after CSS is loaded *@\n \n+@if(item.isJspm) {\n+    @if(play.Play.isDev()) {\n+        <script src=\"/assets/jspm_packages/system.js\"></script>\n+        <!-- Due to Babel conflcting with curl, we have to manually load.\n+        As per https://github.com/systemjs/systemjs/issues/378#issuecomment-83982349 -->\n+        <script src=\"/assets/jspm_packages/babel.js\"></script>\n+        <script src=\"/assets/jspm-config.js\"></script>\n+        <script>\n+            System.import('es6/bootstraps/app')\n+                .catch(function (error) {\n+                    // Throw error outside of promise\n+                    setTimeout(function () {\n+                        throw error;\n+                    });\n+                });\n+        </script>\n+    } else {\n+        <script src=\"@Static(\"bundles/app.js\")\"></script>","path":"common/app/views/fragments/javaScriptLaterSteps.scala.html","position":21,"original_position":21,"commit_id":"67c6992afdb131f46d290052b00584875f9871b5","original_commit_id":"67c6992afdb131f46d290052b00584875f9871b5","user":{"login":"theefer","id":36964,"avatar_url":"https://avatars.githubusercontent.com/u/36964?v=3","gravatar_id":"","url":"https://api.github.com/users/theefer","html_url":"https://github.com/theefer","followers_url":"https://api.github.com/users/theefer/followers","following_url":"https://api.github.com/users/theefer/following{/other_user}","gists_url":"https://api.github.com/users/theefer/gists{/gist_id}","starred_url":"https://api.github.com/users/theefer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theefer/subscriptions","organizations_url":"https://api.github.com/users/theefer/orgs","repos_url":"https://api.github.com/users/theefer/repos","events_url":"https://api.github.com/users/theefer/events{/privacy}","received_events_url":"https://api.github.com/users/theefer/received_events","type":"User","site_admin":false},"body":"@phamann Are you saying `async` (or `defer`) is not reliable enough to guarantee non-blocking fetching even in modern browsers?","created_at":"2015-03-25T12:06:04Z","updated_at":"2015-03-25T12:06:04Z","html_url":"https://github.com/guardian/frontend/pull/8688#discussion_r27114418","pull_request_url":"https://api.github.com/repos/guardian/frontend/pulls/8688","_links":{"self":{"href":"https://api.github.com/repos/guardian/frontend/pulls/comments/27114418"},"html":{"href":"https://github.com/guardian/frontend/pull/8688#discussion_r27114418"},"pull_request":{"href":"https://api.github.com/repos/guardian/frontend/pulls/8688"}}},"pull_request":{"url":"https://api.github.com/repos/guardian/frontend/pulls/8688","id":31911191,"html_url":"https://github.com/guardian/frontend/pull/8688","diff_url":"https://github.com/guardian/frontend/pull/8688.diff","patch_url":"https://github.com/guardian/frontend/pull/8688.patch","issue_url":"https://api.github.com/repos/guardian/frontend/issues/8688","number":8688,"state":"open","locked":false,"title":"jspm + SystemJS: crosswords","user":{"login":"OliverJAsh","id":921609,"avatar_url":"https://avatars.githubusercontent.com/u/921609?v=3","gravatar_id":"","url":"https://api.github.com/users/OliverJAsh","html_url":"https://github.com/OliverJAsh","followers_url":"https://api.github.com/users/OliverJAsh/followers","following_url":"https://api.github.com/users/OliverJAsh/following{/other_user}","gists_url":"https://api.github.com/users/OliverJAsh/gists{/gist_id}","starred_url":"https://api.github.com/users/OliverJAsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OliverJAsh/subscriptions","organizations_url":"https://api.github.com/users/OliverJAsh/orgs","repos_url":"https://api.github.com/users/OliverJAsh/repos","events_url":"https://api.github.com/users/OliverJAsh/events{/privacy}","received_events_url":"https://api.github.com/users/OliverJAsh/received_events","type":"User","site_admin":false},"body":"Introduction to jspm + SystemJS: https://www.youtube.com/watch?v=szJjsduHBQQ\r\n\r\nThis change moves the crosswords app from the RequireJS (RJS) app bundle to a new jspm app (bundled only in production).\r\n\r\nBecause SystemJS works with all module formats out of the box, we haven't had to modify any of our modules—with the exception of some changes to the dependency list, where some module IDs have been modified.\r\n\r\nThe jspm app is architected in such a way that it intersects with the RJS app. E.g., both the RJS and jspm apps can depend on `common/utils/_`. Beware that this means both apps will bundle this common dependency. There is no easy way (that I know of) to share dependencies between the RJS and jspm app. The jspm app is configured in such a way that module IDs can be consistent across both apps, allowing for this intersection.\r\n\r\nThe same is true for third party dependencies. [RJS sources its dependencies from Bower](https://github.com/guardian/frontend/blob/660af8e58b52911a9055ae7fc186dab4ef7ea88c/grunt-configs/requirejs.js#L10), whereas [SystemJS sources its dependencies from jspm](https://github.com/guardian/frontend/blob/660af8e58b52911a9055ae7fc186dab4ef7ea88c/static/src/jspm-config.js#L8-L9).\r\n\r\nWe decided that this was a fair compromise given the small size of the crosswords dependency graph, as well as the small size of our crosswords audience. As we migrate more of our dependency graph into jspm, however, this is something to beware of. We should contemplate how much of a performance impact this might have, or whether we could go from Bower + RJS to jspm + SystemJS in one move.\r\n\r\nNotes:\r\n- `jspm install` is part of `grunt prepare`; `jspm bundle is part of `grunt compile`\r\n- The jspm app lives in `javascript/es6`. We have created an [`es6` path](https://github.com/guardian/frontend/blob/660af8e58b52911a9055ae7fc186dab4ef7ea88c/static/src/jspm-config.js#L6) so that files in this folder can be easily referenced.\r\n- We have converted all of the crosswords modules from AMD to ES6 modules in a separate branch, [`jspm-es6`](https://github.com/guardian/frontend/compare/jspm...jspm-es6), based on top of this branch.\r\n\r\n/cc @theefer @rich-nguyen","created_at":"2015-03-25T10:54:24Z","updated_at":"2015-03-25T12:06:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa51977eb818a03dd479f3a835b88fd3eebce1ed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/guardian/frontend/pulls/8688/commits","review_comments_url":"https://api.github.com/repos/guardian/frontend/pulls/8688/comments","review_comment_url":"https://api.github.com/repos/guardian/frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/frontend/issues/8688/comments","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/67c6992afdb131f46d290052b00584875f9871b5","head":{"label":"guardian:jspm","ref":"jspm","sha":"67c6992afdb131f46d290052b00584875f9871b5","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":4370755,"name":"frontend","full_name":"guardian/frontend","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/frontend","description":"Source for theguardian.com","fork":false,"url":"https://api.github.com/repos/guardian/frontend","forks_url":"https://api.github.com/repos/guardian/frontend/forks","keys_url":"https://api.github.com/repos/guardian/frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/frontend/teams","hooks_url":"https://api.github.com/repos/guardian/frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/frontend/events","assignees_url":"https://api.github.com/repos/guardian/frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/frontend/tags","blobs_url":"https://api.github.com/repos/guardian/frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/frontend/subscription","commits_url":"https://api.github.com/repos/guardian/frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/frontend/merges","archive_url":"https://api.github.com/repos/guardian/frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/frontend/downloads","issues_url":"https://api.github.com/repos/guardian/frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/frontend/releases{/id}","created_at":"2012-05-18T15:39:15Z","updated_at":"2015-03-25T11:25:51Z","pushed_at":"2015-03-25T11:48:10Z","git_url":"git://github.com/guardian/frontend.git","ssh_url":"git@github.com:guardian/frontend.git","clone_url":"https://github.com/guardian/frontend.git","svn_url":"https://github.com/guardian/frontend","homepage":"http://www.theguardian.com","size":527097,"stargazers_count":2716,"watchers_count":2716,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":248,"mirror_url":null,"open_issues_count":241,"forks":248,"open_issues":241,"watchers":2716,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"2ba4b3ae3aa73e76ba771cf9d68a2785f5c660af","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":4370755,"name":"frontend","full_name":"guardian/frontend","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/frontend","description":"Source for theguardian.com","fork":false,"url":"https://api.github.com/repos/guardian/frontend","forks_url":"https://api.github.com/repos/guardian/frontend/forks","keys_url":"https://api.github.com/repos/guardian/frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/frontend/teams","hooks_url":"https://api.github.com/repos/guardian/frontend/hooks","issue_events_url":"https://api.github.com/repos/guardian/frontend/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/frontend/events","assignees_url":"https://api.github.com/repos/guardian/frontend/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/frontend/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/frontend/tags","blobs_url":"https://api.github.com/repos/guardian/frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/frontend/languages","stargazers_url":"https://api.github.com/repos/guardian/frontend/stargazers","contributors_url":"https://api.github.com/repos/guardian/frontend/contributors","subscribers_url":"https://api.github.com/repos/guardian/frontend/subscribers","subscription_url":"https://api.github.com/repos/guardian/frontend/subscription","commits_url":"https://api.github.com/repos/guardian/frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/frontend/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/frontend/merges","archive_url":"https://api.github.com/repos/guardian/frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/frontend/downloads","issues_url":"https://api.github.com/repos/guardian/frontend/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/frontend/labels{/name}","releases_url":"https://api.github.com/repos/guardian/frontend/releases{/id}","created_at":"2012-05-18T15:39:15Z","updated_at":"2015-03-25T11:25:51Z","pushed_at":"2015-03-25T11:48:10Z","git_url":"git://github.com/guardian/frontend.git","ssh_url":"git@github.com:guardian/frontend.git","clone_url":"https://github.com/guardian/frontend.git","svn_url":"https://github.com/guardian/frontend","homepage":"http://www.theguardian.com","size":527097,"stargazers_count":2716,"watchers_count":2716,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":248,"mirror_url":null,"open_issues_count":241,"forks":248,"open_issues":241,"watchers":2716,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/frontend/pulls/8688"},"html":{"href":"https://github.com/guardian/frontend/pull/8688"},"issue":{"href":"https://api.github.com/repos/guardian/frontend/issues/8688"},"comments":{"href":"https://api.github.com/repos/guardian/frontend/issues/8688/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/frontend/pulls/8688/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/frontend/pulls/8688/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/frontend/statuses/67c6992afdb131f46d290052b00584875f9871b5"}}}}