couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rhett Sutphin <rh...@detailedbalance.net>
Subject Re: spidermonkey load function
Date Wed, 12 Aug 2009 19:57:00 GMT
Hi Norman,

On Aug 12, 2009, at 2:08 PM, Norman Barker wrote:

> I have been looking at the SpiderMonkey shell and the custom couchdb
> javascript driver and see that the couchdb driver does not allow the
> load(filename) function which is allowed in the shell, is this
> intentional?

It is.  CouchDB uses the content of the view definition to determine  
when the view has changed and therefore needs to be rebuilt.  If view  
definitions could have dependencies on external files, it would mean  
that the definition would have to be parsed to determine the  
dependencies so they could be checked too.

> I am looking to add functions to main.js without having to paste them
> into one file and load() would have been a way around this.  The
> alternative is to implement a pre-processor to create one file before
> deployment which I will use for now.

CouchApp includes a preprocessor which handles this situation.  You  
might consider it (if you haven't) before rolling your own.

Rhett

Mime
View raw message