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:
.sync()
.pull()
.push(/* objectsArray */)
.connect()
.disconnect()
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
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 morehoodie.remote
.That means that
hoodie.store
will get additional methods:.sync()
.pull()
.push(/* objectsArray */)
.connect()
.disconnect()
The store events
add
,update
,remove
,change
already passoption.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:
While the merge of
hoodie.store
andhoodie.remote
must be done before migrating toPouchDB
, I think thehoodie.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