Titanium JIRA Archive
Alloy (ALOY)

[ALOY-400] Move Alloy properties (like globals, Collections, Models, CFG) into alloy.js instead of app.js

GitHub Issuen/a
TypeStory
PriorityHigh
StatusResolved
ResolutionFixed
Resolution Date2012-11-29T18:30:45.000+0000
Affected Version/sn/a
Fix Version/sAlloy 0.3.3, 2012 Sprint 24
ComponentsRuntime
Labelsn/a
ReporterTony Lukasavage
AssigneeUnknown
Created2012-11-28T23:32:04.000+0000
Updated2018-03-07T22:26:00.000+0000

Description

It makes more sense to organize standard properties for the Alloy namespace object within the runtime Alloy.js file, rather than initializing them in the app.js itself. For example, the app.js template:
/**
 * Alloy for Titanium by Appcelerator
 * This is generated code, DO NOT MODIFY - changes will be lost!
 * Copyright (c) 2012 by Appcelerator, Inc.
 */
var Alloy = require('alloy'),
	_ = require('alloy/underscore')._;

Alloy.Collections = {};
Alloy.globals = {};
Alloy.CFG = require('alloy/CFG');
<%= alloyJs %>
Alloy.createController('index');
Ideally, it will look like this, with all code that was removed placed in the actual runtime Resources/alloy.js library:
/**
 * Alloy for Titanium by Appcelerator
 * This is generated code, DO NOT MODIFY - changes will be lost!
 * Copyright (c) 2012 by Appcelerator, Inc.
 */
var Alloy = require('alloy'),
	_ = require('alloy/underscore')._;

<%= alloyJs %>
Alloy.createController('index');

Comments

  1. Tony Lukasavage 2012-11-29

    All discussed changes have been made, organizing Alloy namespace relevant items in the alloy.js runtime file. In addition, updates have been made to the inline documentation which tells us how these namespaces and object works. They include samples and any deprecation notes.

JSON Source