[
https://issues.apache.org/jira/browse/COUCHDB-1075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028279#comment-13028279
]
Caolan McMahon commented on COUCHDB-1075:
-----------------------------------------
If I understand you correctly, you're suggesting compiled modules are stored as
a property on the string containing their source code in the design document?
That would work fine of course, but I thought having a separate module_cache
made it easier to clear between requests. Now I think we should persist the
cache between requests and if that's the case, storing it on the design doc
probably makes more sense :)
If we accept a more persistent cache, then you're right to point out that we
need to make sure it's cleared when the design doc changes. This wasn't a
consideration when the cache was cleared between requests, so I didn't add a
test for it. I'll update the patch to include one!
Thanks for the feedback
> Circular require's in CommonJS modules
> --------------------------------------
>
> Key: COUCHDB-1075
> URL: https://issues.apache.org/jira/browse/COUCHDB-1075
> Project: CouchDB
> Issue Type: Bug
> Components: JavaScript View Server
> Reporter: Caolan McMahon
> Labels: javascript
> Attachments: circular_requires.patch
>
>
> Having a CommonJS module A which requires B, when B also requires A causes
> the stack to fill up with require calls. A prerequisite for this fix is the
> caching of modules, even if it is only on a per-request basis.
> Patch incoming.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira