enyo / opentip

Opentip is an open source javascript tooltip based on the protoype framework.
http://www.opentip.org
1.25k stars 401 forks source link

decouple frameworks from deployment in adapters #100

Open flying-sheep opened 10 years ago

flying-sheep commented 10 years ago

the concept of adapters in this project is flawed. instead of divorcing deployment and framework support, each adapter does both.

but i don’t want to see adapter-jquery-component.coffee, adapter-jquery-browserify.coffee, adapter-jquery-scripttag.coffee, adapter-ember-component.coffee, adapter-ember-browserify.coffee, adapter-ember-scripttag.coffee, adapter-native-component.coffee, adapter-native-browserify.coffee, adapter-native-scripttag.coffee

i want to see one deployment-agnostic adapter for every framework, and an internal build tool that is able to create packages for all deployment methods. or one package that supports multiple.


so let’s say each foo-adapter.coffee contains just the class, mandatorily called “Adapter”. and our Gruntfile is responsible for creating component-, browserify-, and script-tag packages by wrapping those Adapter classes into some boilerplate while packaging.

then we just have to do npm install opentip and can do require(opentip) (native), require(opentip/jquery) or require(opentip/ember) in our browserify project (analoguously in component), or we can download the script-tag .zip and include <script src="js/opentip/opentip.js"></script><script src="js/opentip/jquery.js"></script>.