Yeh. All that makes sense.

I think we should provide an option to remove exports from scope (default
to no though, as any transitive ones will be a pain).

List of exports make sense. Means we will also be able to build compound
modules out of things that require transitives (thinking you could publish
a single config that exposed backbone, jquery and underscore). Makes it as
simple as publishing a config to depend on to handle those degenerate cases.
On 20/06/2013 1:49 PM, "Marli Oshlack" <notifications@github.com> wrote:

> In module/src/modulator/library.js:
>
> > @@ -0,0 +1,57 @@
> > +module.modulator.library = def(
> > +  [
> > +    ephox.bolt.kernel.fp.functions,
> > +    ephox.bolt.kernel.util.globals,
> > +    ephox.bolt.module.util.path
> > +  ],
> > +
> > +  function (fn, globals, path) {
> > +    var create = function (loader, pather, namespace, ref, initialization) {
> > +
> > +      var definition = function () {
> > +        if (initialization.define)
> > +          return initialization.define;
> > +        if (initialization.exports)
> > +          return function () { return globals.resolve(initialization.exports); };
>
> So, do you think we should proactively pull the exports out of the global
> scope here? Or is it expected that if you don't want to litter the global
> scope from third-party libraries, that you pass a define() function in that
> cleans up the script's droppings?
>
> I understand this might break chained dependency loading if we did. To get
> around that we could keep a record of exports that need to be cleaned up
> and do it in one go after the system is initialised.
>
> That might be getting a bit complicated though.
>
> Also, do you think you should be able to pass a list of exports in as an
> option as well? It could resolve the whole list and then add them all to an
> object. I know some third-party libs that export multiple globals and this
> could nicely handle that case I think.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/boltjs/bolt/pull/1/files#r4789382>
> .
>