gr2m / milestones

A GitHub backed Milestone thingy
http://gr2m.github.io/milestones/
69 stars 14 forks source link

Define list of modules that will be replaced by / need to be redone #35

Closed gr2m closed 10 years ago

gr2m commented 10 years ago

The main thing that will change with the introduction of PouchDB is the merge of local & remote store. In terms of public API, there will only be hoodie.store, no more hoodie.remote.

That means that hoodie.store will get additional methods:

The store events add, update, remove, change already pass option.remote === true if the change comes from remote.

hoodie.open(storeName) will simply be a wrapper for PouchDB that exposes Hoodie's standard store methods, and talks directly to the Server.

Additionally, I'd like to introduce an option or extra method, that will let us replicate custom remotes to its own local database, so that remotes now can be make available offline as well. For example:

var shop = hoodie.open("show", {
  connect: true,
  offline: true
});
// this now works both on- and offline
shop.findAll('book', showAllBooks);

While the merge of hoodie.store and hoodie.remote must be done before migrating to PouchDB, I think the hoodie.open api can stay as is right now. The ability to make custom remote stores work offline is a feature that is frequently asked for, but not critical to 1.0 in my current perspective.

Unless I miss something, all the other modules should stay mostly untouched by the migration to PouchDB. We will keep using our localStorage wrapper for config, as it makes sense to have a synchronous API for this.

I'd love to hear your opinions on this @boennemann @snnd @svnlto @zoepage

gr2m commented 10 years ago

I think the issue body says it all. Feel free to add to add comments