[ALOY-1570] Alloy: exports.baseController does not work since 1.10.0 (Regression)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-06-22T18:18:55.000+0000 |
Affected Version/s | Alloy 1.10.0 |
Fix Version/s | CLI Release 6.3.0, Alloy 1.10.3 |
Components | Tooling |
Labels | n/a |
Reporter | Sergey Nosenko |
Assignee | Christopher Williams |
Created | 2017-06-20T12:58:39.000+0000 |
Updated | 2017-10-10T19:26:15.000+0000 |
Description
since 1.10.0 exports.baseController = 'name' does not work.
I attached simple project with three controllers
* Base
* BasedOnBase with exports.baseController = 'base' in js
* BasedOnBaseXML with in xml
With Alloy 1.9.11 I got correct result in both cases:
function Controller() {
require("/alloy/controllers/Base").apply(this, Array.prototype.slice.call(arguments));
...
but with Alloy 1.10.x I get correct code only for BasedOnBaseXML
for BasedOnBase I get:
require('/alloy/controllers/' + 'BaseController').apply(this, Array.prototype.slice.call(arguments));
this.__controllerPath = 'BasedOnBase';
this.args = arguments[0] || {};
if (arguments[0]) {
var __parentSymbol = __processArg(arguments[0], '__parentSymbol');
var $model = __processArg(arguments[0], '$model');
var __itemTemplate = __processArg(arguments[0], '__itemTemplate');
}
var $ = this;
var exports = {};
var __defers = {};
$.__views.BasedOnBase = Ti.UI.createView({ id: "BasedOnBase" });
$.__views.BasedOnBase && $.addTopLevelView($.__views.BasedOnBase);
exports.destroy = function () {};
_.extend($, $.__views);
var args = $.args;
exports.baseController = 'Base';
Attachments
File | Date | Size |
---|---|---|
app.zip | 2017-06-20T12:54:38.000+0000 | 7419 |
Likely related to move to babylon/babel. I modified https://github.com/appcelerator/alloy/blob/master/Alloy/commands/compile/ast/controller.js and it seems maybe it's not grabbing the controller name properly now? I think it may be a simple typo: 'export.baseController' vs 'exports.baseController'
https://github.com/appcelerator/alloy/pull/832
If you release 6.20 without this it will be broken. :(
[~darknos] The 'Release 6.3.0' refers to the Appcelerator CLI release version, it is currently at 6.2.2, as opposed to the 6.1.0 of Titanium SDK. If you are not using the Appc CLI, (Titanium CLI+Alloy) this change will be in Alloy 1.10.3
Node Version: 6.10.3 NPM Version: 3.10.10 Mac OS: 10.13 Appc CLI: 6.3.0-master.7 Appc CLI NPM: 4.2.9 Titanium SDK version: 6.2.2 Validated with the environment. I tested with the attached app, and app functioned as expected. No errors were seen.