cht-core icon indicating copy to clipboard operation
cht-core copied to clipboard

Use commonjs modules for common couchdb functions and constants

Open garethbowen opened this issue 9 years ago • 9 comments

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

garethbowen avatar Jun 09 '16 11:06 garethbowen

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

garethbowen avatar Oct 26 '16 23:10 garethbowen

hi frand @abbyad, please triage before the end of this sprint. :parrot_conga::parrot_conga::parrot_conga:

nice-snek avatar Apr 18 '17 15:04 nice-snek

@garethbowen, what do you think about this one? Close?

abbyad avatar Apr 24 '17 22:04 abbyad

@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.

garethbowen avatar Apr 25 '17 08:04 garethbowen

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

mandric avatar Jun 06 '17 18:06 mandric

Also I have started putting couchdb compatible code in here: https://github.com/medic/medic-api-utils

mandric avatar Jun 07 '17 02:06 mandric

Hi @abbyad,

This ticket has not been touched in 90 days. Is it still relevant?

(See triaging old issues for more detail)

medic-bot avatar Feb 21 '18 11:02 medic-bot

I'll again defer to @garethbowen on this one

abbyad avatar Feb 22 '18 21:02 abbyad

Yeah, we should still do it.

garethbowen avatar Feb 22 '18 21:02 garethbowen