Github user benkeen commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/207#discussion_r22628757
--- Diff: app/addons/documents/shared-resources.js ---
@@ -0,0 +1,317 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may
not
+// use this file except in compliance with the License. You may obtain a
copy of
+// the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations
under
+// the License.
+
+define([
+ 'app',
+ 'api',
+ 'cloudant.pagingcollection'
+], function (app, FauxtonAPI, PagingCollection) {
+
+ var Documents = FauxtonAPI.addon();
--- End diff --
Hey @garrensmith, rats this is more complicated than I first thought. So
what I wanted was for the shared resources to be the *subset* of resources in
an addon intended to be used by external code. I figured if the addon was
defined elsewhere and the shared resources merged into it, the return value
from `shared-resources.js` would include other non-shared stuff - which is
exactly what I hoped to avoid.
But now that I think about it, no matter how the code is arranged, since
the object is passed around by reference, no matter where the addon is first
defined, the returned object from `shared-resources.js` will contain the whole
shebang. Yegads.
How about this: move the addon definition elsewhere like you suggested, and
just live with the fact that the actual returned object from shared-resources
contains everything. I think there's still a big win to be had explicitly
grouping code by what's intended to be shared or not.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---