[ALOY-610] TiAPI: Read Alloy markup files natively
DescriptionThe concept of markup files CAN be good, but I feel that writing markup files just to convert them at compile to JS might make development faster or easier, but does not really provide extra perks. Loading the XML natively would provide load time speed improvements well beyond anything that can be done via JS as it eliminates the bridge. Here is what I am proposing in JS (Alloy markup should be known by all here, so no need to explain it):
// Returns the root view var window = Ti.UI.load('/ui/index.xml'); // get a child view by ID window.find('subview');
- Tony Lukasavage 2014-01-20
I don't see how this solution provides any performance enhancement. It appears to me to push compile time effort into the runtime, which would in effect make the app slower. What exactly is going on in the proposed
Ti.UI.load()function that would actually make this faster?
window.find()by its very nature would be slower than simply referencing elements directly by id, and if that's what it's doing under the hood, I don't see why we would create a new API to do what Alloy does already. I'm going to close this one for now, but I'll re-open if some of the above points can be made to show a clear and distinct advantage over the current Alloy setup.