Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7973] Modules: Default to Latest Version of a Module

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-03-14T07:58:53.000+0000
Affected Version/sn/a
Fix Version/sRelease 2.0.0, Sprint 2012-06
ComponentsTooling
Labelsn/a
ReporterDawson Toth
AssigneeMarshall Culpepper
Created2012-03-13T10:32:41.000+0000
Updated2017-03-06T18:20:46.000+0000

Description

Feature

If two versions of a module are available, and a tiapp.xml doesn't specify a version, the latest version should be chosen.

Current Behavior

Right now the tooling sorts modules alphabetically, so the earliest version of a module will be used rather than the most recent.

Test

Unzip the attached modules.zip in to your /Library/Application\ Support/Titanium/ directory, then:
    <modules>
    	<module>ti.cloud</module>
    </modules>
and
require('ti.cloud').hi();
It will alert the version of the module in use. You can also predict which module will be used based on the output of iphone/builder.py: {quote} [DEBUG] Detecting modules in /Volumes/Code/play/modules [DEBUG] Detecting modules in /Library/Application Support/Titanium/modules [DEBUG] Detected module for commonjs: ti.cloud 2.0 @ /Library/Application Support/Titanium/modules/commonjs/ti.cloud/2.0 [DEBUG] Detected module for commonjs: ti.cloud 2.1 @ /Library/Application Support/Titanium/modules/commonjs/ti.cloud/2.1 [DEBUG] Looking for Titanium Module id: ti.cloud, version: , platform: {quote} The order in which the modules are detected are the order in which they will be used if no version is specified.

Pull Request

https://github.com/appcelerator/titanium_mobile/pull/1650

Attachments

FileDateSize
modules.zip2012-03-13T10:32:41.000+0000316742

Comments

  1. Neeraj Gupta 2012-03-13

    We need this PR for ACS module.
  2. Chris Barber 2012-03-13

    Mobile web supports this. :)
  3. Dawson Toth 2012-03-14

    Yeah, I saw that when I was doing the PR. Great foresight, Chris!
  4. Lee Morris 2017-03-06

    Closing ticket due to time passed.

JSON Source