krawaller / kranium

Brains for Titanium
http://www.kraniumjs.com
Other
103 stars 13 forks source link

Should be able to include only parts of Kranium #2

Open netpro2k opened 13 years ago

netpro2k commented 13 years ago

Currently besides Jade and Backbone, all of Kranium must be included. Though some parts of Kranium are required for basic operation, others seem to be just niceties, that may not be required in every application. The user should be able to include parts at will. This issue can serve as a discussion for the best way to do this.


Perhaps the Jake task should only concatenate those parts of Kranium that are absolutely required. Then, kranium init could copy the remaining individual components (db.js, file.js, etc) and could then handle including the appropriate parts in app.js.

The code inserted by kranium init into app.js would become something like:

Ti.include("/kranium/lib/kranium.js");

// ==== Optional additions (uncomment to include) ===
// Ti.include("/kranium/lib/db.js");
// Ti.include("/kranium/lib/androidshims.js");
// Ti.include("/kranium/lib/backbone.js");
// ... and so on ...

Haven't yet figured out a good way to communicate/enforce dependances.... Thoughts?

krawaller commented 13 years ago

Hmm... this is a good point. Maybe we should strive for something along the lines of Dojo or YUI?! Currently Kranium is more like jQuery with a wide scope where you get all or nothing.

Also, it could be interesting to evaluate what performance/memory gains can be achieved by splitting things up. I'll look into it!

netpro2k commented 13 years ago

Yeah, i think there are a few components that area really quite standalone: