ender-js/Ender — Issue #93: Allow libraries to provide generic (functional) dependencies, rather than fixed libs
Author: keithamus
Created: 2011-11-04 10:53:12+00:00
State: open

An ender library should be able to specify what functions they call from Ender as "loose" dependencies. It should also be able to specify a list of what methods it provides, this way the user can choose between multiple libraries that support the same things, rather than libraries dictating specific companion libraries that they have hard dependencies on.

Scenario
------------

Hypothetically lets say all of the libs available for Ender are Qwery, Bean and a lib called "MyOwnBindingsLib". Inside Qwery's package.json it has lists that is supports the `selectorEngine` functionality. Bean says it supports `bind` and `trigger`. MyOwnBindingsLib says it supports `bind` and `trigger`.

I make a new library called Sploosh which uses Ender, and in my lib I use the selectorEngine in Ender, as well as `bind` and `trigger` functions to bind events. I specify in the package.json that my functional dependencies are `selectorEngine`, `bind` and `trigger`.

When someone installs Sploosh, they get a list of choices based on the functional dependencies that Sploosh needs.
Ender suggests a list of dependant libs, saying Qwery will be installed because it is the only package that supports `selectorEngine`. Ender then says I must pick one of the following dependencies: Bean or MyOwnBindingsLib, because both support the same functionality, so I can one or the other at my own discretion. I choose MyOwnBindingsLib because it works better for Mobile phones. Someone else might choose Bean though, because they dont have that requirement.