[ 
https://issues.apache.org/jira/browse/COUCHDB-658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12835411#action_12835411
 ] 

Chris Anderson commented on COUCHDB-658:
----------------------------------------

Cool!

Glad to see it working.

Is there a way to make it work without keeping everything in the modules 
subtree?

Eg I might want to require("vendor/crypto/sha") or maybe even require the 
validation function in a update handler to give users more nicely formatted 
error messages.

I guess this is gonna pretty much require that people are requiring commonjs 
modules not arbitrary javascript, so feel free to tell me to shut up. :)

But I still might want to publish some commonjs modules as part of a vendor 
with other JS (like browser code) so maybe it makes sense to have the require 
namespace be the full ddoc, and if someone says require("views/foo/map") they 
can suffer the error that comes from trying to import a raw function as a 
commonjs module.

> Add CommonJS style modules to the view server
> ---------------------------------------------
>
>                 Key: COUCHDB-658
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-658
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>         Environment: CouchDB
>            Reporter: mikeal
>         Attachments: require.patch
>
>
> I have a patch that adds CommonJS module support to all ddoc aware view 
> server functions (everything except map/reduce/rereduce).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to