Hello.
I familiarized myself with Couch's support for CommonJS Modules [1] [2] [3].
It seems strange to me that the only storage level for modules is the
design document. Suppose I frequently apply some logic across all kinds
of documents (or even across databases).
→ Does that mean I will have to deploy/duplicate my little library
across all the design documents / databases needing it?!
With such a limitation, my team is considering eyebrow-raising
strategies like enhancing our deployment tool to duplicate library js
code across all {database * design docs}s at deploy time, which sounds
like a terrible idea. Is what I'm asking for an anti-pattern suggesting
we're Doing It The Wrong Way® ? Am I (and this StackOverflow post with
the exact same question [4]) missing something? Links to examples /
howtos / additional documentation very welcome.
Thanks for your help :)
[1] http://docs.couchdb.org/en/1.6.1/query-server/javascript.html#commonjs
[2] http://wiki.apache.org/couchdb/CommonJS_Modules
[3] http://wiki.apache.org/couchdb/JavascriptPatternViewCommonJs
[4]
http://stackoverflow.com/questions/8300546/couchdb-share-functions-across-views-across-design-documents-across-database
--
Ronan