Coder Social home page Coder Social logo

alloy's People

Contributors

brentonhouse avatar caspahouzer avatar cb1kenobi avatar cheekiatng avatar dbankier avatar dependabot-preview[bot] avatar dependabot[bot] avatar ewanharris avatar feons avatar fokkezb avatar hansemannn avatar hazemkhaled avatar ingo avatar jawa9000 avatar jhaynie avatar k0sukey avatar killix avatar kwhinnery avatar m1ga avatar maccesar avatar mukherjee2 avatar orthlieb avatar pegli avatar semantic-release-bot avatar sgtcoolguy avatar skypanther avatar tonylukasavage avatar topener avatar xavierlacot avatar yomybaby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alloy's Issues

created new project and having some basic errors

AttributeError: 'module' object has no attribute 'check_output'

I created a completely new application
Copied it into a new TiStudio project
Then started to get the error above....

Then I tried to just do a compile and run from the command line and got this error

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: ENOENT, no such file or directory '/Users/aaronksaunders/Library/Application Support/Titanium/mobilesdk/osx'
    at Object.readdirSync (fs.js:390:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/alloy/Alloy/common/titanium.js:50:29)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Module.require (module.js:354:17)
    at require (module.js:370:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/alloy/Alloy/commands/run/index.js:5:13)
    at Module._compile (module.js:441:26)

Where is the configuration file so I can edit it to point to the proper TI SDK directory?

Thanks

exception on exported function

I've got this controller called property and exported a single function

$.foo = function() {
    Ti.API.log('test');
};

and in my index controller

$.myButton.addEventListener('click', function(e){
   $.property.foo();
})

On click event, got the following errors :

2012-07-26 01:41:40 -- [WARN ] Exception in event callback. {
2012-07-26 01:41:40 -- [INFO ] line = 95;
2012-07-26 01:41:40 -- [INFO ] message = "'undefined' is not an object (evaluating '$.property.foo')";
2012-07-26 01:41:40 -- [INFO ] name = TypeError;
2012-07-26 01:41:40 -- [INFO ] sourceId = 243267968;
2012-07-26 01:41:40 -- [INFO ] }

Documentation for builtins

We need to provide jsduck compatible documentation for builtins and then work with doc team to get them integrated (along with generic Alloy doc) with docs.appcelerator.com site.

Use of models causes "undefined" error

Compiling and building/running an Alloy project works fine until any models are included. I used the alloy generate modelName field1:string command. I've tried several times in different Titanium Mobile projects, including the vanilla one from alloy new . with nothing more than a model generation. Other non-Alloy projects work fine in my environment.

OS:
Windows 7 Enterprise SP1, 32-bit
Intel Pentium Dual CPU E2160 @ 1.80Ghz

Titanium Studio:
Build: 2.0.201205311912 jenkins-titanium-rcp-master-204 (origin/master)

Titanium SDK: 2.0.2.GA
Run Configuration: Titanium Mobile Web Previewer
Google Chrome 19.0.1084.56 m

Alloy version: 0.1.2, from npm

Browser displays:
Application Error
Cannot call method 'open' of undefined at /index.html (line 14)

Browser console output:
[INFO] Appcelerator Titanium 2.0.2.GA Mobile Web index.html:13463
(X) Uncaught TypeError: Cannot call method 'open' of undefined

model collection

Hi,

I need extend a backbone collection, its possible ?
If yes, why ?

Thanks

JavaScript vs. CSS for style (.tss) files

Hi -- I think the Alloy project has great promise, and I'm excited to see it.

I'm a little concerned about the choice of JavaScript instead of CSS for style files. (At first I thought it was using JSON, but on closer observation, I realized it is actually JavaScript.)

Of course the syntax of JavaScript (when it contains only data) and CSS is somewhat similar at first glance. But there are some important differences that make JSON a difficult file format to work with here.

  • I would love to be able to make greater leverage of the enormous number of web development tools that are out there when writing Titanium apps. In this case, if the files were real CSS, then I could pass them through Sass.

  • All that extra punctuation, especially the messy commas, which are present on some lines but not others. (Yes, semicolons must be added, but at least they are on every line, not just some lines like the commas, making the code easier to modify):

    /* JavaScript */
    View: {
        prop1: "value",
        prop2: "value"
    },
    Button: {
        prop1: "value",
        prop2: "value"
    }
    

    vs.

    /* CSS: removed some colons, quotation marks, and commas */
    View {
        prop1: value;
        prop2: value;
    }
    Button {
        prop1: value;
        prop2: value;
    }
    

(Like I mentioned above, when I first started writing this up, I thought you were using pure JSON, and that concerned me even more, because then comments wouldn't be possible, and all key names would have to be quoted.)

more of a question than an issue

hi all,

I am working on some project with alloy, and run into this. I am trying to set font style in one of the json file.
"#title":
{
"top": 0,
"font":
{
"fontSize": 50,
"fontFamily": "Trebuchet MS"
}
},

the error return as

/usr/local/lib/node_modules/alloy/Alloy/uglify-js/lib/parse-js.js:271
throw new JS_Parse_Error(message, line, col, pos);
^
Error
at new JS_Parse_Error (/usr/local/lib/node_modules/alloy/Alloy/uglify-js/lib/parse-js.js:263:22)
at js_error (/usr/local/lib/node_modules/alloy/Alloy/uglify-js/lib/parse-js.js:271:15)
at croak (/usr/local/lib/node_modules/alloy/Alloy/uglify-js/lib/parse-js.js:732:17)
at token_error (/usr/local/lib/node_modules/alloy/Alloy/uglify-js/lib/parse-js.js:739:17)
at expect_token (/usr/local/lib/node_modules/alloy/Alloy/uglify-js/lib/parse-js.js:752:17)
at expect (/usr/local/lib/node_modules/alloy/Alloy/uglify-js/lib/parse-js.js:755:40)
at expr_list (/usr/local/lib/node_modules/alloy/Alloy/uglify-js/lib/parse-js.js:1129:56)
at array_ (/usr/local/lib/node_modules/alloy/Alloy/uglify-js/lib/parse-js.js:1142:36)
at /usr/local/lib/node_modules/alloy/Alloy/uglify-js/lib/parse-js.js:1106:51
at maybe_unary (/usr/local/lib/node_modules/alloy/Alloy/uglify-js/lib/parse-js.js:1208:27)

How to load controller dynamically

I searched issues and found #24 say there is an multiple_views example, but I can not find it.

Currently I load a controller and open it with the code below:

$.t.on('click',function(e) { 
    var a = require('alloy/components/history').create();
    $.tab.open(a.getRoot());
});

Another question, I use html code below to implement a TabGroup, and history is another controller, but in history controller, Titanium.UI.currentTab doesn't work, it just be undefined.

<TabGroup>
    <Tab id="tabHistory">
        <View require="history" id="history"></View>
    </Tab>
</TabGroup>

ti.alloy plugin exception on run command

The alloy plugin is looking for the node and alloy binaries under /usr/local/bin but on my machine they are installed under /opt/local/bin which basically throws out a bunch of python exception when run.

2012-07-16 17:34:11 -- [INFO ] Detected compiler plugin: ti.alloy/1.0
2012-07-16 17:34:11 -- [INFO ] alloy app found at /Users/rix/Documents/Titanium_Studio_Workspace/Asset Mobile/app
2012-07-16 17:34:11 -- [ERROR] Error: Traceback (most recent call last):
2012-07-16 17:34:11 -- [DEBUG] File "/Library/Application Support/Titanium/mobilesdk/osx/2.1.0.GA/iphone/builder.py", line 1117, in main
2012-07-16 17:34:11 -- [DEBUG] p.compile(compiler_config)
2012-07-16 17:34:11 -- [DEBUG] File "/Users/rix/Documents/Titanium_Studio_Workspace/Asset > Mobile/plugins/ti.alloy/plugin.py", line 36, in compile
2012-07-16 17:34:11 -- [DEBUG] subprocess.check_call(cmd)
2012-07-16 17:34:11 -- [DEBUG] File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 457, in check_call
2012-07-16 17:34:11 -- [DEBUG] retcode = call(_popenargs, *_kwargs)
2012-07-16 17:34:11 -- [DEBUG] File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 444, in call
2012-07-16 17:34:11 -- [DEBUG] return Popen(_popenargs, *_kwargs).wait()
2012-07-16 17:34:11 -- [DEBUG] File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 595, in init
2012-07-16 17:34:11 -- [DEBUG] errread, errwrite)
2012-07-16 17:34:11 -- [DEBUG] File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1106, in _execute_child
2012-07-16 17:34:11 -- [DEBUG] raise child_exception
2012-07-16 17:34:11 -- [DEBUG] OSError: [Errno 2] No such file or directory

My machine

OSX: 10.6.8
Python 2.6.1
Titanium 2.1.0.GA

PickerColumn data binding makes reference to undefined function ".getRows()"

Here is a reference to the line in question:

pre: 'var rows=[];\n_.each(' + args.symbol + '.getRows(), function(r) { ' + args.symbol + '.removeRow(r);});\n',

I'm pretty sure this should just be referencing the .rows property.

I believe that until this is fixed, out-of-the-box data binding on PickerColumn is broken.


For others that might find this through searching and still waiting for a fix:

I've been patching this using the module attribute in the XML to intercept PickerColumn creation and add a proxy .getRows() function.

https://titaniumsdk.com/guide/Alloy_Framework/Alloy_Guide/Alloy_Views/Alloy_XML_Markup.html#module-attribute

XML using module attribute:
<Column module="picker_fixer" ...

picker_fixer.js:

export const createPickerColumn = function picker_fixer(args) {

  const picker_column = Ti.UI.createPickerColumn(args);

  picker_column.getRows = function () {

    return this.rows;
  };

  return picker_column;
};

Allow complex data binding on ListView for sections and items

As per ALOY-609, ListSection is the UI component which is in charge of automatically populating a ListView with ListItems via a data bound model or collection. So the dataCollection needs to be set at the component, not at the :

<ListView id="list" defaultItemTemplate="title">
        <Templates>
            <ItemTemplate name="fullItem" height="70">
                <ImageView bindId="image" class="image"/>
                <Label bindId="title" class="title text-and-image"/>
                <Label bindId="subtitle" class="subtitle text-and-image"/>
            </ItemTemplate>
            <ItemTemplate name="titleAndSub" height="70">
                <Label bindId="title" class="title"/>
                <Label bindId="subtitle" class="subtitle"/>
            </ItemTemplate>
            <ItemTemplate name="title" height="50">
                <Label bindId="title" class="title"/>
            </ItemTemplate>
        </Templates>

        <ListSection id="section" dataCollection="info" dataTransform="doTransform">
            <ListItem template="{template}" title:text="{title}" subtitle:text="{subtitle}" image:image="{image}"/>
        </ListSection>
    </ListView>

It would be nice to be able to support complex collections, or multiple collections, in order to be able to create a section/item structure directly from a complex data model. Off the top of my head, there's probably 2 ways this can be achieved.

proposed solution A

Resolving ALOY-614 would allow developers to use dynamically defined dataCollection XML attributes in their views. This would in turn allow you to define a data bound collection as a result of a prior dataCollection. For example:

<ListView id="list" defaultItemTemplate="title" dataCollection="someCollection">
    <Templates>
        <!-- define templates here as usual -->
    </Templates>

    <ListSection id="section" headerTitle="{title}" dataCollection="{nestedCollectionFromSomeCollection}">
        <ListItem template="{template}" title="{title}"/>
    </ListSection>
</ListView>

proposed solution B

Develop a distinct convention for structuring of complex data such that it can all be handled internally by Alloy and the structure is just created automatically. For example, this pseudo-model shows a convention we might create in order for a to understand that it needs to lay out the data in sections first, then items within each section:

{
    viewProp: 'just some property at the ListView level'
    sections: [
        {
            title: 'some title, would be bound to this instance of ListSection'
            items: [
                {
                    title: 'another title, would be bound to this instance of ListItem in the containing ListSection',
                    template: 'someTemplate'
                },
                // ...
            ]
        },
        // ...
    ]
}

and the above pseudo-model would be leveraged in XML as such to create a section for each entry in the sections array, and an item for each entry in that section's items array.

<ListView id="list" defaultItemTemplate="title" dataCollection="thePseudoModel">
    <Templates>
        <!-- define templates here as usual -->
    </Templates>

    <ListSection id="section" headerTitle="{title}">
        <ListItem template="{template}" title="{title}"/>
    </ListSection>
</ListView>
  • option B will be modeled closely after the ListView Titanium API itself, being obviously a much smaller, cleaner subset as Alloy will already be taking care of styling, eventing, and templating for you.
  • My initial thought is option B as it makes for cleaner markup and to me just seems like the appropriate solution. Alloy to this point has been pretty flexible in terms of letting developers manipulate it to achieve goals. This seems like one particular situation where some defined convention would make things a lot easier for everyone. Pushing the "ugliness" to the model makes more sense than pushing it into the markup.
  • I'm not seeing it, but I am making anything unnecessarily difficult for developers if I go with option B? It makes some assumptions based on the data model, but I don't see anything in it that inherently limits functionality.
  • option A would be quicker, but IMO, that's about the only thing it has going for it. I would prefer not to nest multiple collections and would instead prefer to make intelligent use of one. It will make for cleaner, more performant generated code and will require less Backbone-to-Alloy wiring.

Ensure we support various combinations of XML

We will need to probably build out a system by which we can do various combinations of XML from View markup.

For example, in Ti, we have certain parent/child relationships to certain objects which need to be mapped so that its more helpful in XML.

Example is a map. Ideally, you would do something like:

<map>
  <annotation></annotation>
</map>

As a way to statically build a map with a single annotation.

Also, in the tableview, you have a similar scenario but with additional nesting possibilities:

<tableview>
  <tableviewrow>
    <imageview url="foo.png" />
  </tableviewrow>
</tableview>

Also, as in the map above, we need to also be smart about Ti builtins to make sure we auto-prefix the ns (Ti.Map vs. Ti.UI) in these cases.

onReady ?

I wanted to test this code snippet, but it is not working.

function onReady(args) {

   $.index.open();
}

module.exports = Alloy.getController('BaseController').extend({
    onReady: onReady
});

Now, is not possible to extend the BaseController, right ?

Using a Widget in multiple views causes a compile time error

I have an application where i created a custom cross platform navigation bar as a widget. Once i use this widget on more than 1 view, the compiler spits out:

2012-06-18 09:25:08 -- [ERROR] <View> from 'app/widgets/navbar/views/widget.xml' attempted to use the id 'navbarview' which has already been defined in the view 'app/widgets/navbar/views/widget.xml'

I am attaching snippets of my view xml files:
index.xml:

<?xml version='1.0'?>
<App>
    <View require="home" id="home"/>
    <View require="blog" id="blog"/>
    <View require="blogdetails" id="blogdetails"/>
</App>

blog.xml:

<?xml version='1.0'?>
<Window class='container'>    
    <TableView id="table" />
    <Widget require="com.sisc.navbar" id="blognavbar" />
</Window>

blogdetails.xml:

<?xml version='1.0'?>
<Window class='container'>
    <WebView id='wview' /> 
    <Widget require="com.sisc.navbar" id="blogdetailsnavbar" />
</Window>

I attached the widget to 2 views directly, and in my index.xml I include both views in the construct. Similarly, if i remove the reference to blogdetails in index.xml, and instead include a reference to blogdetails in blog.xml, i get the same error. If the same widget on 2 different views (different IDs), are some how in the same xml view container, the compiler blows up. Is the same as a commonJS require of that view's controller code?

simple_model Runtime Error

On iPhone attempting to run the simple_model test app results in an Application Error:

invalid method
(createTableViewRowTemplate
) passed to UIModule
(unknown file)

Reduce compiled TSS file size

I'm readdressing this issue that was originally brought up in Michael's JIRA Ticket .

Problem:
Currently, an app.tss file is compiled into every /android/alloy/styles/ and /iphone/alloy/styles style, needlessly increasing file sizes and causing redundancy.

Example:
For instance, if you have a very large app.tss file (1MB) and five controllers with no styles defined, you'll end up with five separate 1MB files (totaling 5MB) instead of one 1MB file and five empty files (totaling 1MB).

Idea:
Controllers already use the require function to include Alloy or other controllers. Why not create an /Resources/android/alloy/styles/app.js file and include that file in the other compiled style files while merging it with their styles?

Michael also posted the following comment on the matter:
“Michael Gangolf 2020-11-20 I've already tried to edit https://github.com/appcelerator/alloy/blob/1b9fd4685f0a6abebe1620b021c1d360523f9e8b/Alloy/commands/compile/index.js#L673 and I'm able to write a appTss.js file. I just have trouble including it in the other style files. Tried it with require but it doesn't seem to work here”

Now, here are my thoughts on this:
I'm not very familiar with Alloy's/Titanium's compilation process, but if index.js is indeed the primary styles file that includes a module.exports, why don't all other style files simply require it? This could substantially reduce redundant code.

Additionally, if a particular style file has its unique set of classes, these classes could potentially be merged together. Is this a feasible approach?

Is there anyway to create custom view via JavaScript?

It seems like the views in Alloy are all created with XML. What if I want to create a custom container that have a complex layout and require dimension calculations?

Is there anyway to create a view with JavaScript? Or is this what the widgets are intended for?

Master Detail Example and Top Level Alloy Container?

Not really clear what is going on there? Still trying to find and example of multiple controllers... or some way to map what you are implementing here to how one would expect MVC to work.

if i have an index/application controller and then multiple views with associated controllers, how does the index controller access the methods in the other controllers? How does one controller communicate with the other? Is it this magical "Alloy" top level container that I have to include all of my views in? Is there some "require" that I need to do somewhere?

This is what I believe is a pretty basic concept that I am either just over complicating or I cannot find documentation on how to implement it. As I said before, I understand this is very early on, but I am trying to provide some feedback here.

Sync or Store?

Hi,

I discover Alloy for a week now. And I begin to better know the inner workings (great job of Alloy's team).
This issue is the fact that the sync sql has many gaps, and am currently working to fix this.

My question is: would not it be better to make a system more modular interfacing BackboneJS / Alloy sync?

Some things like:
alloysync.js (wrapper model <-> backbonejs)
sqlStore.js (layer for sql)
propertieStore.js (layer for propertie)

I think that architecture could allow more things, example : multiple store for a model.
What do you think?

Build on Android - physicalSizeCategory not found

When I create a new Alloy Project either via the terminal or with Titanium Studio 2.1.2 & the Alloy plugin, and attempt to run the project on Android I get an error with the ti.physicalsizecategory module.

The actual runtime error occurs on line 50 of the compiled alloy.js file (inside a try catch block I might add):

exports.isTablet = function() {
    try {
        var psc = require("ti.physicalSizeCategory");
        return psc.physicalSizeCategory === "large" || psc.physicalSizeCategory === "xlarge";
    } catch (e) {
        return Ti.API.warn("Could not find ti.physicalSizeCategory module, using fallback for Alloy.isTablet"), isTabletFallback();
    }
    return isTabletFallback();

Specifically the line:

var psc = require("ti.physicalSizeCategory");

In the variables window, the psc variable is undefined (obviously as it never finishes this assignment). The Stack trace shows no helpful information.

I get the two following lines in the FastDev Process console:
[INFO] [2012-08-23 16:25:26,023] ti.physicalSizeCategory.js exists: false
[INFO] [2012-08-23 16:25:26,034] ti.physicalSizeCategory.js exists: false

I am new to Titanium development, so there might be something I am missing here, and have Googled this issue to try to find out what is going on but cannot seem to find anything out there.

I am pulling my hair out here - I don't understand where I can change this - or remove the module, I don't really need it to do the testing I want to do to determine if I should continue with Alloy or try something else.

Any help would be appreciated.

Error trying to run "sudo npm install -g ."

When I run "sudo npm install -g ."

I get the following error...

/usr/lib/node_modules/npm/lib/utils/config-defs.js:5
  , stdio = process.binding("stdio")
                    ^
Error: No such module
    at Object.<anonymous> (/usr/lib/node_modules/npm/lib/utils/config-defs.js:5:21)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/usr/lib/node_modules/npm/lib/utils/ini.js:43:18)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)

Titanium.UI.currentTab/currentWindow is null ?

Hi,

I use this code, like in kitchen Kit :

//-- controller/index.js

var tabGroup = Titanium.UI.createTabGroup();

//Create tab for root
$.contactsListWin.getRoot().navBarHidden='true';
$.contactsListWin.getRoot().tabBarHidden='true';
var MenuTab = Titanium.UI.createTab({  
    title:'',
    window:$.contactsListWin.getRoot(),
});

tabGroup.addTab(MenuTab);  

//tabGroup.setActiveTab(1);
// open tab group with a transition animation
tabGroup.open({
    transition: Titanium.UI.iPhone && Titanium.UI.iPhone.AnimationStyle.FLIP_FROM_LEFT
});

and in my controller/showcontact.js

$.t.addEventListener('click', function(e)
{
    console.log('click'); //return click
       console.log(Titanium.UI.currentTab); //return NULL
      console.log(Titanium.UI.currentWindow); //return NULL

});

my contactsListWin.xml :

<Window class='container' id='contactsListWin'>
        <Label id="t">Middle</Label>
</Window>

Titanium.UI.currentTab & Titanium.UI.currentWindow return null, and i don't understand why...

Improvement of <Require> tags within <TabGroup>

If I want to keep the logic of a single tab in it's own controller/view combo, and have a main view like this:

<Alloy>
   <TabGroup>
      <Tab>
         <Require src="MyTab" />
      </Tab>
   </TabGroup>
</Alloy>

and MyTab's view looks like this:

<Alloy>
   <Window title="My tab">
      ...
   </Window>
</Alloy>

Since the tab doesn't have an explicit Window specified within the main view, an implicit one will be created (as per the documentation). However, this will result in a title-less window that will lose it's title in the UI if we switch tabs. I'd suggest that if the required (sub-)view has a Window as it's root element (such as the example above), that one should be use instead of an implicit one..

Android Runtime Error

When trying to run an android app, built using the Alloy framework, a runtime error is displayed during the splash/boot screen.

Runtime Error
Location: [3,1] alloy/components/index.js
Message: Uncaught RefferenceError: $ is not defined
Source: $.CFG = {}, exports.create = function {

Widgets need to be able to bundle assets and libraries

Right now at compile time, a widget's view and controller are used to create a component commonjs module that gets put into Resources/alloy/widgets/WIDGETID/components. That component commonjs module can be used to create self-contained instances of the widget in alloy-driven apps.

We also need to add Resources/alloy/widgets/WIDGETID/assets and Resources/alloy/widgets/WIDGETID/lib directories to allow these types of resources to be accessible at runtime as well.

Potential issues

  • How do we handle paths to these assets? If they are going to be moved to a widget-specific directory, which should be done to avoid collisions, how will we handle file, image, etc... paths inside the widget code and styles?

Alloy update option

If you have an existing project, there is no way to update the Alloy runtime/framework without:

backing up the app folder
running alloy new .
restore app folder

Are you considering a update option:

alloy update .

Roadmap ?

Hey guys,

Is there a schedule and/or roadmap available?
This will better contribue, no ?

Alloy 0.2.15 not copying widget files

I upgraded from 0.2.13 to 0.2.15 and now Alloy no longer copies my widget files, so the Resources/Alloy/widgets folder remains empty and obviously the app can't load any widget files..

I've tried to generate a new widget in case any syntax had changed, but still have the same issue.

<Labels platform=""/> assigns wrong variable

<Alloy>
    <Window>
        <TabbedBar id="viewSelector">
            <Labels platform="android">
                <Label>List</Label>
                <Label>Map</Label>
            </Labels>
            <Labels platform="ios">
                <Label>List</Label>
                <Label>Map</Label>
            </Labels>
        </TabbedBar>
    </Window>
</Alloy>

produces

...
	if (true) {
		var __alloyId1 = [];
		var __alloyId4 = {
			title: "List"
		};
		__alloyId1.push(__alloyId4);
		var __alloyId5 = {
			title: "Map"
		};
		__alloyId1.push(__alloyId5);
	}
	$.__views["viewSelector"] = Ti.UI.createTabbedBar({
		labels: __alloyId7,
		id: "viewSelector"
	});
...

The array is called __alloyId1 but it is assigning __alloyId17 at the end (which might be the iOS number).

Might be in this file: https://github.com/tidev/alloy/blob/5e9e25e58ce0fac3e8c12e7583297a5f64d27101/Alloy/commands/compile/parsers/Alloy.Abstract._ItemContainer.js

Compiler Directives Not Working

I installed the latest version of Alloy, and the compiler directives stopped working: ENV_DEV, OS_IOS, OS_ANDROID...

[INFO] iPhone simulated device: iphone
[INFO] Detected compiler plugin: ti.alloy/1.0
[INFO] alloy app found at /Users/ayoadesugba/Documents/Titanium/TestAlloy/app
[INFO] Launching application in Simulator
[INFO] Launched application in Simulator (4.27 seconds)
[INFO] Application started
[INFO] TestAlloy/1.0 (2.0.2.GA.2ff31a3)
[ERROR] Script Error = Can't find variable: ENV_DEV (unknown file).

Move README.md contents to Wiki?

Hi,

nice to see this project! As the README.md got very long and for the sake of easier contribution, wouldn't it be better to move a large part of the README.md into the Github Wiki of this project?

Collection.fetch() doesn't yield any results..

I'm wondering if I'm doing something stupid, but I simply can't get any results from invoking fetch() on a collection. Saving models works fine, and I've opened the alloy.sql file in a DB editor and can see that my table contains records. Tracing through the code, and can see that the SQL commands are invoked right in sql.js getting the appropriate results (saved into model.models). But once the call traces back through alloy.js, the result is always an empty collection.

Looking into the backbone.js fetch() function, I can see that the success callback is never called (line 758 in backbone.js):

options.success = function(resp, status, xhr) {
        collection[options.add ? 'add' : 'reset'](collection.parse(resp, xhr), options);
        if (success) success(collection, resp);
};

I'm not sure how the alloy DB implementation and backbone is supposed to be tied together, so I'm not sure where to start fixing things..

What do you guys thing - is something broken here, or am I just doing something wrong?

Bug in fix for ALOY-217

I.e. the parsing of the content of tabs in the XML-views that was introduced in Alloy 0.2.19 (and still exist in 0.2.24). I've created an example gist for the issue:

https://gist.github.com/3691647

Compiling this yields the following error:

/usr/local/lib/node_modules/alloy/Alloy/commands/compile/compilerUtils.js:254
            console.warn('Skipping element ' + node.nodeName + ' in "' + filename + '",

Actually we have two errors here:

Firstly, there's an error in the produced warning, as the the variable filename is missing (which will give errors on both line 254 AND 240 in compilerUtils.js).

Secondly, which is the main issue at hand here, it basically can't process the Require'd widget in the sub-view (MyTab.xml), and the compile command tries to locate the file <path_to_project>/app/views/com.appcelerator.searchForBooks.xml - which is constructed in the variable fullpath on line 245 in compilerUtils.js. If the Require in MyTab.xml is requiring a normal view, this works just fine; it just can't handle the widget... There needs to be a check here of what type of Require is expected, and adjust the fullpath appropriately if it's a widget..

alloy with no arguments, and help, should be more helpful

There's currently no help displayed if the alloy command is run with no arguments. If alloy is run with no arguments, a list of commands should be shown. --help or similar should have the same effect. Running alloy <command> help or similar should display detailed usage information about the command. I think Tony's working this already but want to make sure to prioritize.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.