Last active
August 2, 2025 18:41
-
Star
(229)
You must be signed in to star a gist -
Fork
(7)
You must be signed in to fork a gist
-
-
Save samselikoff/1d7300ce59d216fdaf97 to your computer and use it in GitHub Desktop.
Revisions
-
samselikoff revised this gist
May 29, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ *This post is also on [my blog](http://www.samselikoff.com/blog/preparing-for-ember-2.0/), since Gist doesn't support @ notifications.* --- -
samselikoff revised this gist
May 29, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ *This gist is also on [my blog](http://www.samselikoff.com/blog/preparing-for-ember-2.0/), since gist doesn't support @ notifications.* --- -
samselikoff revised this gist
May 29, 2015 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ *This gist now lives on [my blog](http://www.samselikoff.com/blog/preparing-for-ember-2.0/), since gist doesn't support @ notifications.* --- Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible: -
samselikoff revised this gist
May 29, 2015 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ *This gist now lives on [my blog](http://www.samselikoff.com/blog/preparing-for-ember-2.0/), since gist doesn't support @ notifications* Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible: - Use Ember CLI -
samselikoff revised this gist
May 29, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -38,7 +38,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Stay away from two-way bindings and mutability - Don't use `each` or `with` in the context-switching form. That is, use {{#each users as |user|}} {{user.firstName}} {{/each}} instead of -
samselikoff revised this gist
Apr 16, 2015 . 1 changed file with 13 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,34 +3,31 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Use Ember CLI - In general, replace views + controllers with components - Only use controllers at the top-level for receiving data from the route, and use `Ember.Controller` instead of `Ember.ArrayController` or `Ember.ObjectController` - Fetch data in your route, and set it as normal properties on your top-level controller. Export an `Ember.Controller`, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller. ```js //controllers/index.js import Ember from 'ember'; export default Ember.Controller; //routes/index.js model: function() { return Ember.RSVP.hash({ users: this.store.find('user') }); }, setupController: function(controller, models) { controller.setProperties(models); } ``` Now you can just refer to the keys in your route's template: ```hbs //templates/index.js <h1>Users</h1> {{user-list users=users}} ``` This controller/template pair will eventually become a routable component. @@ -46,9 +43,10 @@ Components are taking center stage in Ember 2.0. Here are some things you can do instead of {{#each users}} {{firstName}} {{/each}} - Use pods - Use `this.route` instead of `this.resource` in `Router.map`. Couple this with pods and you'll quickly understand why you don't want to use `resource` anymore - your directory structure in `pods` will now mirror the view hierarchy of your UI. **Better apps** -
samselikoff revised this gist
Dec 1, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible: - Use Ember CLI - In general, replace views + controllers with components - Only use controllers at the top-level for receiving data from the route, and use `Ember.Controller` instead of `Ember.ArrayController` or `Ember.ObjectController` - Fetch data in your route, and set it on `attrs` on your top-level controller: @@ -26,7 +27,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do then use `attrs.[model]` in your route's template: ```hbs //templates/index.js <h1>Users</h1> {{user-list users=attrs.users}} @@ -35,7 +36,6 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - In your templates, stay away from things like `ItemController`s and calls to `render()`. Use components instead. - Don't use views - Write your app in the "data down, actions up" paradigm - Not currently enforced, but you can still structure your app this way - Stay away from two-way bindings and mutability -
samselikoff revised this gist
Dec 1, 2014 . 1 changed file with 33 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,39 @@ Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible: - In general, replace views + controllers with components - Only use controllers at the top-level for receiving data from the route, and use `Ember.Controller` instead of `Ember.ArrayController` or `Ember.ObjectController` - Fetch data in your route, and set it on `attrs` on your top-level controller: ```js //controllers/index.js import Ember from 'ember'; export default Ember.Controller.extend({ attrs: {} // don't write any more code for this controller }); //routes/index.js model: function() { return this.store.find('user'); }, setupController: function(controller, model) { controller.set('attrs.users', model); } ``` then use `attrs.[model]` in your route's template: ```js //templates/index.js <h1>Users</h1> {{user-list users=attrs.users}} ``` This controller/template pair will eventually become a routable component. - In your templates, stay away from things like `ItemController`s and calls to `render()`. Use components instead. - Don't use views - Use Ember CLI - Write your app in the "data down, actions up" paradigm -
samselikoff revised this gist
Nov 17, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,6 +17,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do {{#each users}} {{firstName}} {{/each}} - Use `this.route` instead of `this.resource` in `Router.map` - Use pods **Better apps** -
samselikoff revised this gist
Nov 17, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Don't use views - Use Ember CLI - Write your app in the "data down, actions up" paradigm - Not currently enforced, but you can still structure your app this way - Stay away from two-way bindings and mutability - Don't use `each` or `with` in the context-switching form. That is, use -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,4 +22,4 @@ Components are taking center stage in Ember 2.0. Here are some things you can do Follow these tips, and your apps will be ready for Ember 2.0. You'll also learn a lot about writing apps that are better structured and easier to understand! Deprecations will be coming to help you move towards these newer practices. The goal is, if your app runs on the final version of 1.x with no deprecations, it should be able to run in 2.0. -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,9 +12,9 @@ Components are taking center stage in Ember 2.0. Here are some things you can do {{#each user in users}} {{user.firstName}} {{/each}} instead of {{#each users}} {{firstName}} {{/each}} - Use `this.route` instead of `this.resource` in `Router.map` -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Stay away from two-way bindings and mutability - Don't use `each` or `with` in the context-switching form. That is, use {{#each user in users}} {{user.firstName}} {{/each}} instead of -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Stay away from two-way bindings and mutability - Don't use `each` or `with` in the context-switching form. That is, use {{#each user in users}} {{user.firstName}} {{/each}} instead of -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,8 +9,8 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Not enforced, but you can still structure your app this way - Stay away from two-way bindings and mutability - Don't use `each` or `with` in the context-switching form. That is, use {{#each user in users}} {{user.firstName}} {{/each}} instead of -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,9 +8,8 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Write your app in the "data down, actions up" paradigm - Not enforced, but you can still structure your app this way - Stay away from two-way bindings and mutability - Don't use `each` or `with` in the context-switching form. That is, use - {{#each user in users}} {{user.firstName}} {{/each}} instead of -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do instead of {{#each users}} {{firstName}} {{/each}} - Use `this.route` instead of `this.resource` in `Router.map` -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do instead of {{#each users}} {{firstName}} {{/each}} - Use `this.route` instead of `this.resource` in `Router.map` -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do instead of {{#each users}} {{firstName}} {{/each}} - Use `this.route` instead of `this.resource` in `Router.map` -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do instead of {{#each users}} {{firstName}} {{/each}} - Use `this.route` instead of `this.resource` in `Router.map` -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do {{#each user in users}} {{user.firstName}} {{/each}} instead of {{#each users}} {{firstName}} {{/each}} - Use `this.route` instead of `this.resource` in `Router.map` -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,9 @@ Components are taking center stage in Ember 2.0. Here are some things you can do {{#each user in users}} {{user.firstName}} {{/each}} instead of {{#each users}} {{firstName}} {{/each}} - Use `this.route` instead of `this.resource` in `Router.map` **Better apps** -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Don't use `each` or `with` in the context-switching form - e.g. use {{#each user in users}} {{user.firstName}} {{/each}} instead of {{#each users}} {{firstName}} {{/each}} -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Don't use `each` or `with` in the context-switching form - e.g. use {{#each user in users}} {{user.firstName}} {{/each}} instead of {{#each users}} {{firstName}} {{/each}} -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Don't use `each` or `with` in the context-switching form - e.g. use {{#each user in users}} {{user.firstName}} {{/each}} instead of {{#each users}} {{firstName}} {{/each}} -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Don't use `each` or `with` in the context-switching form - e.g. use {{#each user in users}} {{user.firstName}} {{/each}} instead of {{#each users}} {{firstName}} {{/each}} -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Don't use `each` or `with` in the context-switching form - e.g. use {{#each user in users}} {{user.firstName}} {{/each}} instead of {{#each users}} {{firstName}} {{/each}} -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,9 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Stay away from two-way bindings and mutability - Don't use `each` or `with` in the context-switching form - e.g. use {{#each user in users}} {{user.firstName}} {{/each}} instead of {{#each users}} {{firstName}} {{/each}} - Use `this.route` instead of `this.resource` in `Router.map` -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Stay away from two-way bindings and mutability - Don't use `each` or `with` in the context-switching form - e.g. use {{#each user in users}} {{user.firstName}} {{/each}} instead of {{#each users}} {{firstName}} {{/each}} - Use `this.route` instead of `this.resource` in `Router.map` -
samselikoff revised this gist
Nov 16, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,8 +9,8 @@ Components are taking center stage in Ember 2.0. Here are some things you can do - Not enforced, but you can still structure your app this way - Stay away from two-way bindings and mutability - Don't use `each` or `with` in the context-switching form - e.g. use {{#each user in users}} {{user.firstName}} {{/each}} instead of {{#each users}} {{firstName}} {{/each}} - Use `this.route` instead of `this.resource` in `Router.map`
NewerOlder