Ember.js + Persistence.js example #164

Closed
wants to merge 6 commits into
from

Projects

None yet

3 participants

@trustmaster

This is a mere fork of Ember.js todomvc architecture example using Persistence.js as a persistence layer. It uses WebSQL store on WebKit browsers and Opera and localStorage store on other browsers supporting it.

Owner

Review:

  • This is currently using an older version of an application template, but we could still bring this into our /labs folder if you can update the target of your PR
  • I noticed that editing todos doesn't appear to work correctly. I can click on an item to change its completed state (and this correctly updates via Persistance) but editing doesn't seem supported at the moment. I believe the latest ember app with require.js in #116 could probably lend some of its code to this to fix that

Would you be up for fixing at least the two above so we can bring this into the labs folder?

Thanks!

It seems to take its roots from #63. I'm not sure I'll be quick enough to keep it in sync with @stas' plans of introducing Ember.js routing. But I'll definitely update this example to the current template and add item editing using emberjs_require as a reference.

Owner

Thanks!

I've updated the template. I've rebased it on emberjs_require example to "enforce some good practices".

Owner

@trustmaster Thanks, I'll review it this weekend ;)

Owner

@trustmaster Routing landed in the emberjs_require in master. Can you rebase upon that?

OK, I'll give it a try. This may take a while because Persistence/WebSQL is asynchronous, so controllers are a bit different.

Having read the recent thread in #201 I've come to a conclusion that we should drop this one as well.

My motivation for this example was a lack of examples of using Ember.js with other data persistence libraries. In particular, I wanted something that had localStorage support that could be switched rather seamlessly to a remote RESTful storage. Persistence.js seemed a bit dated but had multiple adapters, so I picked it and made this example to educate myself and others who might be searching for a similar solution.

I've implemented both localStorage and WebSQL support in this example so that it works on all modern browsers. But I found that switching a storage adapter isn't that seamless and is a bit buggy because certain things start to work differently when you switch the driver. So I have to agree that Persistence.js should be deprecated.

At the same time, I've been watching emberjs-data as a more natural alternative for Persistence in Ember.js applications. It isn't production ready yet and it doesn't have localStorage driver. But when it is there, it might be a better candidate for showcasing persistence practices in Ember.js apps.

@trustmaster trustmaster closed this Jul 4, 2012
Owner

Ya, we decided to do that. However, we will link to your implementation from our wiki.

Thanks for the explanation.

Feel free to open an issue for discussing ember-data when you feel it's ready :)

Owner

+1. Would love an ember data implementation at some point. Thanks for being
understanding about the persistence decision!
On Jul 4, 2012 1:53 PM, "Sindre Sorhus" <
reply@reply.github.com>
wrote:

Ya, we decided to do that. However, we will link to your implementation
from our wiki.

Thanks for the explanation.

Feel free to open an issue for discussing ember-data when you feel it's
ready :)


Reply to this email directly or view it on GitHub:
#164 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment