Use commonjs modules for common couchdb functions and constants
We can import commonjs modules into view map functions (and maybe other places) to improve code reuse. Get the working and refactor couchdb code to use the functions. A good candidate for extraction is the place types array in lib/views.js
Seems to work for couchdb. Unfortunately pouchdb doesn't natively support require but we could use the solution here: https://github.com/pouchdb/mapreduce/issues/220
hi frand @abbyad, please triage before the end of this sprint. :parrot_conga::parrot_conga::parrot_conga:
@garethbowen, what do you think about this one? Close?
@abbyad Nah I think schedule it - at least we can fix it for the medic ddoc which is only ever used in couchdb land so the pouchdb hack isn't needed.
Kind of a separate issue but also ddocs/ should be refactored to use commonjs at some point. i.e https://github.com/eHealthAfrica/couchdb-best-practices#commonjs-modules-aka-node-modules
Also I have started putting couchdb compatible code in here: https://github.com/medic/medic-api-utils
Hi @abbyad,
This ticket has not been touched in 90 days. Is it still relevant?
(See triaging old issues for more detail)
I'll again defer to @garethbowen on this one
Yeah, we should still do it.