From user-return-14488-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Jan 14 22:08:28 2011 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 14930 invoked from network); 14 Jan 2011 22:08:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Jan 2011 22:08:27 -0000 Received: (qmail 86229 invoked by uid 500); 14 Jan 2011 22:08:25 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 86190 invoked by uid 500); 14 Jan 2011 22:08:25 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 86182 invoked by uid 99); 14 Jan 2011 22:08:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jan 2011 22:08:25 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.160.180 as permitted sender) Received: from [209.85.160.180] (HELO mail-gy0-f180.google.com) (209.85.160.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jan 2011 22:08:17 +0000 Received: by gya6 with SMTP id 6so1517641gya.11 for ; Fri, 14 Jan 2011 14:07:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=fGAGZHgc4a9yr9Jt1rBI+38RrdGu07fPFUJC0ORdEJY=; b=WsmVfmBXeKwF2Ki/FyC0THOZ1HiWzVkrjfDcAVX/DHXDA1jDJQ74ADIVbPX5gWlPoy j7jIh6dTD3cc1nQiiCCM17dNXQTFNXbw+OmlYgh2Chr4lbtMTw3RIWzF9+8DAnS29qlt dTNG/ar79L5B8Icztnlk2a4DxTkRhb4BBvWts= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=lx08H7R7WlbFWc+4/vEPtFwz0bJIWzgyHStCTInchA2D6TwI/z/D8OldaEVq2+1eJw muroNwIOCbeuDkJsYuNDICqUBlQxKE+BnZtz25EX30lxMK9PckRLtwt3kx/Dqxf/aZB+ Z76OvAx675eK4lliwT+jaERJrPf/NtS6eS2ew= Received: by 10.150.177.10 with SMTP id z10mr1806343ybe.312.1295042876583; Fri, 14 Jan 2011 14:07:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.147.181.18 with HTTP; Fri, 14 Jan 2011 14:07:16 -0800 (PST) In-Reply-To: References: From: Paul Davis Date: Fri, 14 Jan 2011 17:07:16 -0500 Message-ID: Subject: Re: require() from within views To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Jan 14, 2011 at 4:54 PM, Thomas Rampelberg w= rote: > Decided to give trunk a try so that I could play with require() from > within views today and I've ran into a couple issues. > > - It appears that views are sandboxed to a very small section of the > design doc (views/lib/*). Why is this? This is so that we can calculate a signature for each view to know when we have to rebuild a view from scratch due to a change in view code. > - For a reason that I've not been able to figure out, module.exports > doesn't work for functions. eg: > That sounds like a bug on the face of it. Can you work up a simple example design doc that exhibits the behaviour? > =A0 =A0exports.foo =3D "asdf" > > Produces {"foo": "asdf" } but: > > =A0 =A0exports.foo =3D function() {} > > Produces { } > > Any ideas? >