pouchdb-community / ember-pouch

PouchDB/CouchDB adapter for Ember Data
Apache License 2.0
281 stars 76 forks source link

Is there is reson to use full pouchdb in dependency ? #241

Open zorn-v opened 5 years ago

zorn-v commented 5 years ago

Why not use only pouchdb-browser ? In that case there will be no need to compile leveldown which is not needed at all for ember.

jlami commented 5 years ago

That does seem alluring, but I'm not sure if it is technically correct. Ember should also be able to work in node, for example with fastboot. I'm not sure if ember-pouch works with fastboot, but using pouchdb-browser would surely prevent this.

We could make the user choose through peer or optional dependencies. But that would make an out of the box installation harder.

zorn-v commented 5 years ago

Ember should also be able to work in node, for example with fastboot.

How ember-data work with fastboot ? Isn't it for client side only ?


Oh, I see there is addon for it https://github.com/cardstack/ember-data-fastboot Not so popular BTW, and I dont know is it support pouchdb or not.

And we get not popular method for caching ember-data models VERSUS problems with compiling leveldown (on windows for example).

jlami commented 5 years ago

Yes, it might be better to let people who really want fastboot to have to do more work. But I'm not sure if using pouchdb-browser would make that impossible, or just a little bit harder.

We would have to look into whether pouchdb-browser comes with the required distribution files we use to load pouchdb-find before we can really switch tough.

zorn-v commented 5 years ago

https://pouchdb.com/custom.html

Seems pouchdb-find does not included in pouchdb-browser. But I think not big problem

jlami commented 5 years ago

It does require us to either use pouchdb-browser as a direct dependency or go the peerDependency route. Peer dependencies are technically more correct, but harder to get right for normal users.

Maybe we can use afterInstall from ember-cli to setup the default browser config, and let bootstrap users change this default configuration to suite their own needs. It makes it a bit harder to manage the installed versions though.

zorn-v commented 5 years ago

but harder to get right for normal users.

Just one more line in readme/changelog If follow semver this should be done in major release