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

doc: PouchDB needs to be attached to window in production #213

Closed ptbrowne closed 7 years ago

ptbrowne commented 7 years ago

The production build of Bank was broken because of this.

In prod, since cozy-client-js is injected by the stack, it has not been processed by wepback and the ProvidePlugin. Thus you need to bind PouchDB to window.

ptbrowne commented 7 years ago

Build is failing but I've only touched the doc :/

jinroh commented 7 years ago

214 should fix the failing tests.

ptbrowne commented 7 years ago

For future improvements, do you thinks it is possible to pass PouchDB and pouchdbFind as initialisation parameters to CozyClient ?

I think it would be a good idea to do so 👍, it would be like a simple version of dependency injection. I think it would also be better from a testing point of view.