Building Emberredit (screencast)


#1

One of my more popular blog entries is on using Ember.js without Ember Data. Recently I’ve been going through my old entries and making sure they don’t have any glaring mistakes, and I realized this would be a good opportunity to convert my emberreddit project to ember-cli.


This screencast shows how you can build an Ember.js application without using Ember Data. It starts off simple and then shows how to build advanced stuff like an identity map yourself.

It assumes some knowledge of Ember. The guides and docs for Ember.js are available at: http://emberjs.com/guides/

To install NodeJS go to: http://nodejs.org/

The excellent ember-cli is available at: http://iamstef.net/ember-cli/

And finally the code created in this screencast can be found here: https://github.com/eviltrout/emberreddit

Thanks to Stefan Penner, Jo Liss and the Ember Core team for making this amazing framework and tools. Also thanks to Erik Bryn for showing me a few tips about the model hook!


I had a lot of fun making the screencast so I will likely do more in the future. Drop me a line and let me know what future screencasts you’d like to see.


This is a companion discussion topic for the original entry at http://eviltrout.com/2014/05/29/emberreddit-screencast.html

#2

Great video. I wonder about the caching at the end of the video. Will updates from the Reddit API still be reflected when navigating to a subreddit?


#3

Good question! In this case the data will not be fetched again ever, which is probably not what you want for this kind of application. You might want to refresh it if it has been x seconds since last requested.

I would still use the identity map approach though to make sure that repeated requests to find receive a reference to the same object. I might add an afterModel hook that checks the last time the data was retrieved and refreshes it if it is old.


#4

Very nice screencast. You make things very easy to understand and I like the way you explain why things work the way they do. I also like the new screencast you made. Have you considered creating a full course or doing something like egghead.io?

My only issue is that ember-cli doesn’t seem to work well with windows. As soon as I make a change to the app, the server throws a bunch of errors having to do with the tmp directory.


#5

First off, I want to thank you for the very clear, well put together video. Awesome job!

Too, could you go into a little more detail, perhaps here or in a (near) future screencast about working with setupController or whatever means you’d recommend for when a user goes back in the browser or shares a link with someone else. I’m learning Ember and when I reload an ultimate instance (let’s say, www.myurl.com/blog/123), it doesn’t seem to repoll for the data or check into the cache.

I know this is because the model doesn’t know what to build up from, but how do I execute you that properly in my app?

Thanks again for your great explanations!


#6

These screencasts are amazingly helpful for staying up to date with the many changes and improvements the Ember Team continues to crank out. Please, if you can, keep them coming. Many thanks!


#7

This was a great screencast. Props! I would love to use this technique for reading data into my apps. Can this technique be extended to allow for all CRUD operations? I would be interested in seeing how you tackle relationships as well. Keep up the good work!


#8

Great screencast Robin!

I tried to update the project to ember-cli 0.044. After proper update, there is this error:

Path or pattern “passed.png” did not match any files

Seems like ember-cli problem though:

Did you manage to make it work on 0.044?

Thank you for your great screencasts!


#9

I just upgraded it to 0.0.44 and it worked fine, so I wonder if the upgrade had a bad merge or something? I also made it simpler by installing bootstrap via an addon.