{"action":"created","comment":{"url":"https://api.github.com/repos/dockyard/styleguides/pulls/comments/27061661","id":27061661,"diff_hunk":"@@ -0,0 +1,187 @@\n+# Ember.js Style Guide\n+\n+## Table Of Contents\n+\n+## General\n+\n+### Create local version of Ember.\\* and DS.\\*\n+\n+Future versions of Ember will be released as ES6 modules, so we'll be\n+able to import `Ember.computed` directly as `computed`. This includes\n+`computed.alias` or `computed.bool`, should be set to `alias` and\n+`bool`, respectively\n+\n+```javascript\n+// Good\n+\n+var computed = Ember.computed;\n+var alias = computed.alias;\n+var attr = DS.attr;\n+var Model = DS.Model;\n+\n+export default Model.extend({\n+  firstName: attr('string'),\n+  lastName: attr('string'),\n+\n+  surname: alias('lastName'),\n+\n+  fullName: computed('firstName', 'lastName', function() {\n+    // Code\n+  })\n+});\n+\n+// Bad\n+\n+export default DS.Model.extend({\n+  firstName: DS.attr('string'),\n+  lastName: DS.attr('string'),\n+\n+  fullName: Ember.computed('firstName', 'lastName', function() {\n+    // Code\n+  })\n+});\n+```\n+\n+## Organizing your modules\n+\n+### Define default values first\n+\n+Define your object's default values first.\n+\n+### Define single line computed properties second\n+\n+Define single line computed properties (`thing: alias('myThing')`)\n+after default values\n+\n+### Define multi-line computed properties third\n+\n+Multi-line computed properties should follow your single line computeds.\n+\n+### Define actions last\n+\n+Define your route/component/controller's action last, to provide a\n+common place that actions can be found.\n+\n+### Avoid overwriting init\n+\n+Unless you want to change an object's `init` function, perform actions\n+by hooking into the object's `init` hook via `on`. This prevents you\n+from forgetting to call `_super`\n+\n+### Use Pods structure\n+\n+Store local components within their pod, global components in the\n+`components` structure\n+\n+```\n+app\n+  application/\n+    template.hbs\n+    route.js\n+  blog/\n+    index/\n+      blog-listing/ - component only used on the index template\n+        template.hbs\n+      route.js\n+      template.hbs\n+    route.js\n+    comment-details/ - used within blog templats\n+      component.js\n+      template.hbs\n+\n+  components/\n+    tag-listing/ - used throughout the app\n+      template.hbs\n+\n+  post/\n+    adapter.js\n+    model.js\n+    serializer.js\n+```\n+\n+## Controllers\n+\n+### Define query params first\n+\n+For consistancy and ease of discover, list your query params first in\n+yout contoller. These should be listed above default values.\n+\n+\n+### Do not use ObjectController or ArrayController\n+\n+ObjectController is presently deprecated, and ArrayController will be as\n+well. Controllers are not going to be used in Ember 2.0, so by using\n+`Controller`, you will make it easier to migrate to 2.0.\n+\n+### Alias your model\n+\n+It provides a cleaner code to name your model `user` if it is a user. It\n+is more maintainable, and will fall in line with future routable\n+components\n+\n+```javascript\n+export default Controller.extend({\n+  user: alias('model')\n+});\n+```\n+\n+## Templates\n+\n+### Do not use partials\n+\n+Always use components. Parials share scope with the parent view, use\n+components will provide a consistent scope.\n+\n+### Use block syntax\n+\n+Use block syntax instead of `in` syntax with block helpers\n+\n+```hbs\n+{{! Good }}\n+{{#each posts as |post|}}\n+\n+{{! Bad }}\n+{{#each post in posts}}\n+```\n+\n+### Use components in `{{#each}}` blocks\n+\n+Contents of your each blocks should be a single line, use components\n+when more than one line is needed.\n+\n+## Routes\n+\n+### Perform all async actions required for the page to load in `model` hooks\n+\n+The model hooks are async hooks, and will wait for any promises returned","path":"ember.md","position":156,"original_position":156,"commit_id":"73ca625657a6ba23e443d49421a5ee83948f6709","original_commit_id":"73ca625657a6ba23e443d49421a5ee83948f6709","user":{"login":"danmcclain","id":144138,"avatar_url":"https://avatars.githubusercontent.com/u/144138?v=3","gravatar_id":"","url":"https://api.github.com/users/danmcclain","html_url":"https://github.com/danmcclain","followers_url":"https://api.github.com/users/danmcclain/followers","following_url":"https://api.github.com/users/danmcclain/following{/other_user}","gists_url":"https://api.github.com/users/danmcclain/gists{/gist_id}","starred_url":"https://api.github.com/users/danmcclain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danmcclain/subscriptions","organizations_url":"https://api.github.com/users/danmcclain/orgs","repos_url":"https://api.github.com/users/danmcclain/repos","events_url":"https://api.github.com/users/danmcclain/events{/privacy}","received_events_url":"https://api.github.com/users/danmcclain/received_events","type":"User","site_admin":false},"body":"Note the \"required for the page to load\", I agree with you on your point. If your form has a `<select>` that is bound to a model that will be retrieved async, you should do that in your model, but comments would not be \"required\" for the page to load and should be retrieve along side. Will update with more explanation","created_at":"2015-03-24T19:00:22Z","updated_at":"2015-03-24T19:00:22Z","html_url":"https://github.com/dockyard/styleguides/pull/22#discussion_r27061661","pull_request_url":"https://api.github.com/repos/dockyard/styleguides/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/dockyard/styleguides/pulls/comments/27061661"},"html":{"href":"https://github.com/dockyard/styleguides/pull/22#discussion_r27061661"},"pull_request":{"href":"https://api.github.com/repos/dockyard/styleguides/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/dockyard/styleguides/pulls/22","id":31855866,"html_url":"https://github.com/dockyard/styleguides/pull/22","diff_url":"https://github.com/dockyard/styleguides/pull/22.diff","patch_url":"https://github.com/dockyard/styleguides/pull/22.patch","issue_url":"https://api.github.com/repos/dockyard/styleguides/issues/22","number":22,"state":"open","locked":false,"title":"Ember guide","user":{"login":"danmcclain","id":144138,"avatar_url":"https://avatars.githubusercontent.com/u/144138?v=3","gravatar_id":"","url":"https://api.github.com/users/danmcclain","html_url":"https://github.com/danmcclain","followers_url":"https://api.github.com/users/danmcclain/followers","following_url":"https://api.github.com/users/danmcclain/following{/other_user}","gists_url":"https://api.github.com/users/danmcclain/gists{/gist_id}","starred_url":"https://api.github.com/users/danmcclain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danmcclain/subscriptions","organizations_url":"https://api.github.com/users/danmcclain/orgs","repos_url":"https://api.github.com/users/danmcclain/repos","events_url":"https://api.github.com/users/danmcclain/events{/privacy}","received_events_url":"https://api.github.com/users/danmcclain/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-24T18:25:28Z","updated_at":"2015-03-24T19:00:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e5bdd9955e94cdf2ac5df2d017679c1f69ed93b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dockyard/styleguides/pulls/22/commits","review_comments_url":"https://api.github.com/repos/dockyard/styleguides/pulls/22/comments","review_comment_url":"https://api.github.com/repos/dockyard/styleguides/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dockyard/styleguides/issues/22/comments","statuses_url":"https://api.github.com/repos/dockyard/styleguides/statuses/73ca625657a6ba23e443d49421a5ee83948f6709","head":{"label":"dockyard:ember-guide","ref":"ember-guide","sha":"73ca625657a6ba23e443d49421a5ee83948f6709","user":{"login":"dockyard","id":873981,"avatar_url":"https://avatars.githubusercontent.com/u/873981?v=3","gravatar_id":"","url":"https://api.github.com/users/dockyard","html_url":"https://github.com/dockyard","followers_url":"https://api.github.com/users/dockyard/followers","following_url":"https://api.github.com/users/dockyard/following{/other_user}","gists_url":"https://api.github.com/users/dockyard/gists{/gist_id}","starred_url":"https://api.github.com/users/dockyard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dockyard/subscriptions","organizations_url":"https://api.github.com/users/dockyard/orgs","repos_url":"https://api.github.com/users/dockyard/repos","events_url":"https://api.github.com/users/dockyard/events{/privacy}","received_events_url":"https://api.github.com/users/dockyard/received_events","type":"Organization","site_admin":false},"repo":{"id":29650939,"name":"styleguides","full_name":"dockyard/styleguides","owner":{"login":"dockyard","id":873981,"avatar_url":"https://avatars.githubusercontent.com/u/873981?v=3","gravatar_id":"","url":"https://api.github.com/users/dockyard","html_url":"https://github.com/dockyard","followers_url":"https://api.github.com/users/dockyard/followers","following_url":"https://api.github.com/users/dockyard/following{/other_user}","gists_url":"https://api.github.com/users/dockyard/gists{/gist_id}","starred_url":"https://api.github.com/users/dockyard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dockyard/subscriptions","organizations_url":"https://api.github.com/users/dockyard/orgs","repos_url":"https://api.github.com/users/dockyard/repos","events_url":"https://api.github.com/users/dockyard/events{/privacy}","received_events_url":"https://api.github.com/users/dockyard/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dockyard/styleguides","description":"Styleguides for DockYard","fork":false,"url":"https://api.github.com/repos/dockyard/styleguides","forks_url":"https://api.github.com/repos/dockyard/styleguides/forks","keys_url":"https://api.github.com/repos/dockyard/styleguides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dockyard/styleguides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dockyard/styleguides/teams","hooks_url":"https://api.github.com/repos/dockyard/styleguides/hooks","issue_events_url":"https://api.github.com/repos/dockyard/styleguides/issues/events{/number}","events_url":"https://api.github.com/repos/dockyard/styleguides/events","assignees_url":"https://api.github.com/repos/dockyard/styleguides/assignees{/user}","branches_url":"https://api.github.com/repos/dockyard/styleguides/branches{/branch}","tags_url":"https://api.github.com/repos/dockyard/styleguides/tags","blobs_url":"https://api.github.com/repos/dockyard/styleguides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dockyard/styleguides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dockyard/styleguides/git/refs{/sha}","trees_url":"https://api.github.com/repos/dockyard/styleguides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dockyard/styleguides/statuses/{sha}","languages_url":"https://api.github.com/repos/dockyard/styleguides/languages","stargazers_url":"https://api.github.com/repos/dockyard/styleguides/stargazers","contributors_url":"https://api.github.com/repos/dockyard/styleguides/contributors","subscribers_url":"https://api.github.com/repos/dockyard/styleguides/subscribers","subscription_url":"https://api.github.com/repos/dockyard/styleguides/subscription","commits_url":"https://api.github.com/repos/dockyard/styleguides/commits{/sha}","git_commits_url":"https://api.github.com/repos/dockyard/styleguides/git/commits{/sha}","comments_url":"https://api.github.com/repos/dockyard/styleguides/comments{/number}","issue_comment_url":"https://api.github.com/repos/dockyard/styleguides/issues/comments{/number}","contents_url":"https://api.github.com/repos/dockyard/styleguides/contents/{+path}","compare_url":"https://api.github.com/repos/dockyard/styleguides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dockyard/styleguides/merges","archive_url":"https://api.github.com/repos/dockyard/styleguides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dockyard/styleguides/downloads","issues_url":"https://api.github.com/repos/dockyard/styleguides/issues{/number}","pulls_url":"https://api.github.com/repos/dockyard/styleguides/pulls{/number}","milestones_url":"https://api.github.com/repos/dockyard/styleguides/milestones{/number}","notifications_url":"https://api.github.com/repos/dockyard/styleguides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dockyard/styleguides/labels{/name}","releases_url":"https://api.github.com/repos/dockyard/styleguides/releases{/id}","created_at":"2015-01-22T03:34:12Z","updated_at":"2015-01-23T17:26:02Z","pushed_at":"2015-03-24T18:32:57Z","git_url":"git://github.com/dockyard/styleguides.git","ssh_url":"git@github.com:dockyard/styleguides.git","clone_url":"https://github.com/dockyard/styleguides.git","svn_url":"https://github.com/dockyard/styleguides","homepage":null,"size":854,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":12,"forks":0,"open_issues":12,"watchers":0,"default_branch":"master"}},"base":{"label":"dockyard:master","ref":"master","sha":"6047d408106298f9cdd0e62b926cd7658ba30f87","user":{"login":"dockyard","id":873981,"avatar_url":"https://avatars.githubusercontent.com/u/873981?v=3","gravatar_id":"","url":"https://api.github.com/users/dockyard","html_url":"https://github.com/dockyard","followers_url":"https://api.github.com/users/dockyard/followers","following_url":"https://api.github.com/users/dockyard/following{/other_user}","gists_url":"https://api.github.com/users/dockyard/gists{/gist_id}","starred_url":"https://api.github.com/users/dockyard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dockyard/subscriptions","organizations_url":"https://api.github.com/users/dockyard/orgs","repos_url":"https://api.github.com/users/dockyard/repos","events_url":"https://api.github.com/users/dockyard/events{/privacy}","received_events_url":"https://api.github.com/users/dockyard/received_events","type":"Organization","site_admin":false},"repo":{"id":29650939,"name":"styleguides","full_name":"dockyard/styleguides","owner":{"login":"dockyard","id":873981,"avatar_url":"https://avatars.githubusercontent.com/u/873981?v=3","gravatar_id":"","url":"https://api.github.com/users/dockyard","html_url":"https://github.com/dockyard","followers_url":"https://api.github.com/users/dockyard/followers","following_url":"https://api.github.com/users/dockyard/following{/other_user}","gists_url":"https://api.github.com/users/dockyard/gists{/gist_id}","starred_url":"https://api.github.com/users/dockyard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dockyard/subscriptions","organizations_url":"https://api.github.com/users/dockyard/orgs","repos_url":"https://api.github.com/users/dockyard/repos","events_url":"https://api.github.com/users/dockyard/events{/privacy}","received_events_url":"https://api.github.com/users/dockyard/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dockyard/styleguides","description":"Styleguides for DockYard","fork":false,"url":"https://api.github.com/repos/dockyard/styleguides","forks_url":"https://api.github.com/repos/dockyard/styleguides/forks","keys_url":"https://api.github.com/repos/dockyard/styleguides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dockyard/styleguides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dockyard/styleguides/teams","hooks_url":"https://api.github.com/repos/dockyard/styleguides/hooks","issue_events_url":"https://api.github.com/repos/dockyard/styleguides/issues/events{/number}","events_url":"https://api.github.com/repos/dockyard/styleguides/events","assignees_url":"https://api.github.com/repos/dockyard/styleguides/assignees{/user}","branches_url":"https://api.github.com/repos/dockyard/styleguides/branches{/branch}","tags_url":"https://api.github.com/repos/dockyard/styleguides/tags","blobs_url":"https://api.github.com/repos/dockyard/styleguides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dockyard/styleguides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dockyard/styleguides/git/refs{/sha}","trees_url":"https://api.github.com/repos/dockyard/styleguides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dockyard/styleguides/statuses/{sha}","languages_url":"https://api.github.com/repos/dockyard/styleguides/languages","stargazers_url":"https://api.github.com/repos/dockyard/styleguides/stargazers","contributors_url":"https://api.github.com/repos/dockyard/styleguides/contributors","subscribers_url":"https://api.github.com/repos/dockyard/styleguides/subscribers","subscription_url":"https://api.github.com/repos/dockyard/styleguides/subscription","commits_url":"https://api.github.com/repos/dockyard/styleguides/commits{/sha}","git_commits_url":"https://api.github.com/repos/dockyard/styleguides/git/commits{/sha}","comments_url":"https://api.github.com/repos/dockyard/styleguides/comments{/number}","issue_comment_url":"https://api.github.com/repos/dockyard/styleguides/issues/comments{/number}","contents_url":"https://api.github.com/repos/dockyard/styleguides/contents/{+path}","compare_url":"https://api.github.com/repos/dockyard/styleguides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dockyard/styleguides/merges","archive_url":"https://api.github.com/repos/dockyard/styleguides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dockyard/styleguides/downloads","issues_url":"https://api.github.com/repos/dockyard/styleguides/issues{/number}","pulls_url":"https://api.github.com/repos/dockyard/styleguides/pulls{/number}","milestones_url":"https://api.github.com/repos/dockyard/styleguides/milestones{/number}","notifications_url":"https://api.github.com/repos/dockyard/styleguides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dockyard/styleguides/labels{/name}","releases_url":"https://api.github.com/repos/dockyard/styleguides/releases{/id}","created_at":"2015-01-22T03:34:12Z","updated_at":"2015-01-23T17:26:02Z","pushed_at":"2015-03-24T18:32:57Z","git_url":"git://github.com/dockyard/styleguides.git","ssh_url":"git@github.com:dockyard/styleguides.git","clone_url":"https://github.com/dockyard/styleguides.git","svn_url":"https://github.com/dockyard/styleguides","homepage":null,"size":854,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":12,"forks":0,"open_issues":12,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dockyard/styleguides/pulls/22"},"html":{"href":"https://github.com/dockyard/styleguides/pull/22"},"issue":{"href":"https://api.github.com/repos/dockyard/styleguides/issues/22"},"comments":{"href":"https://api.github.com/repos/dockyard/styleguides/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/dockyard/styleguides/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/dockyard/styleguides/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dockyard/styleguides/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/dockyard/styleguides/statuses/73ca625657a6ba23e443d49421a5ee83948f6709"}}}}