[ALOY-1488] Alloy Hyperloop in Alloy XML views
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Won't Do |
Resolution Date | 2016-04-05T13:40:52.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | XML |
Labels | hyperloop |
Reporter | Hans Knöchel |
Assignee | Bruce Wayne |
Created | 2016-04-03T17:46:22.000+0000 |
Updated | 2016-04-05T13:40:52.000+0000 |
Description
I know it's a pretty big thing, but we should at least file it now to discuss it. This ticket is about the idea to support Hyperloop-based Views with Alloy. Example:
var view = new UIView();
view.setBackgroundColor(UIColor.redColor());
view.setFrame(CGRectMake(20,20,300,300));
would become:
<Alloy>
<UIView class="myView" />
</Alloy>
".myView": {
backgroundColor: UIColor.redColor,
frame: CGRectMake(20,20,300,300)
}
/cc [~fokkezb]
I'm not sure if I'd be a fan of this. How would Alloy know if a tag is for Titanium or HL? I'd like to remove some of the magic from Alloy for 2.0, not add more. I think best practice for HL should be to build (cross-platform) factory libraries that in Alloy you'd then simply use via the existing
module
attribute.You can already create custom tags in Alloy that link to Hyperloop code. I am MUCH more in favor of that approach vs what is mentioned below. [~fokkezb]'s comments are accurate. See my gist on how to do this. https://gist.github.com/grantges/1c5df7f7b0eada2c4610
Closing this issue, since it's already possible with the suggested Alloy tags. We need some documentation around it, but that's fine. Thanks [~bgrantges@appcelerator.com]!