cozy / cozy-client-js

Javascript library to write Cozy applications
https://docs.cozy.io/en/cozy-client-js/README/
MIT License
11 stars 12 forks source link

chore: add pouch as a dependency #222

Closed y-lohse closed 7 years ago

y-lohse commented 7 years ago

When it comes to offline support, we are in the process of changing how we handle things. Until recently, only cozy-drive mobile was using the offline part of cozy-client-js. Now, cozy-bank uses it too, cozy-drive uses it in it's web version as well, and the trend is likely to continue.

The offline module requires pouchdb. So far, we provided it through a webpack plugin (see #88), but this a) not practical when many apps need it and b) doesn't work when the stack serves cozy-client-js(we don't get the chance to provide anything).

This PR adds pouchdb as a regular dependency. The distributed file size almost doubles, from 120kb to ~300kb (both minified). It sucks, but I think this makes the most sense.