Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1549] Remove autoloading of index controller from Alloy.js

GitHub Issuen/a
TypeImprovement
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sAlloy 2.0.0
Componentsn/a
Labelsalloy.js, app.js, createController, index
ReporterCreative
AssigneeUnknown
Created2017-02-07T13:09:56.000+0000
Updated2020-01-31T12:13:59.000+0000

Description

During compilation, Alloy apparently appends a line named "Alloy.createController('index');" to the alloy.js file. We should remove any magic like this and make it visible/editable by the user. Use cases: - Run a different controller than index.js - Run unit tests before loading anything else - Run no controller at all but run a different setup (like keeping the splash screen on and doing stuff which does not require user interaction)

Comments

  1. Creative 2017-02-07

    https://github.com/appcelerator/alloy/pull/815
  2. Sharif AbuDarda 2017-02-08

    Thanks for creating the ticket and the PR. Our engineers will consider it. Moving to TIMOB.
  3. Brenton House 2020-01-30

    I currently use "main" to define the primary entry point for the application (similar to what Node.js does in package.json) . https://docs.npmjs.com/files/package.json#main We can either use the existing "main" property in package.json or use a "main" property in config.json.
  4. Ewan Harris 2020-01-31

    That's a pretty nice solution [~bhouse], maybe rather than completely changing this and moving it to the alloy.js file. We could look at allowing it to be configured using something like the following: 1. Prefer main in config.json 2. Fallback to main in package.json 3. If nothing else exists we maintain the Alloy.createController('index'); I'd imagine we should still consider this a breaking change though just incase folks are using main in package.json/config.json already

JSON Source