Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1720] Version string comparison will break for SDK 10.0.0

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2020-08-13T15:36:10.000+0000
Affected Version/sn/a
Fix Version/sCLI Release 8.1.0
Componentsn/a
Labelsalloy, sdk, version
ReporterJoshua Quick
AssigneeEwan Harris
Created2020-02-15T02:52:02.000+0000
Updated2020-08-13T15:36:10.000+0000

Description

*Summary:* There are places in Alloy's code which compares Titanium SDK versions by string. While this works for now, this will eventually break when the Titanium version has been update to 10.0.0. *Example:*
if (Ti.version >= '8.0.0') {
    // Will NOT land here if version is 10.0.0 or higher. (This is the bug.)
}
*Areas To Be Fixed:* https://github.com/appcelerator/alloy/blob/master/Alloy/template/lib/alloy.js
var MW320_CHECK = OS_MOBILEWEB && TI_VERSION >= '3.2.0';
var IDENTITY_TRANSFORM = OS_ANDROID ? (Ti.version >= '8.0.0' ? Ti.UI.createMatrix2D() : Ti.UI.create2DMatrix()) : undefined;
https://github.com/appcelerator/alloy/blob/master/Alloy/builtins/animation.js
const create3DMatrix = Ti.version >= '8.0.0' ? Ti.UI.createMatrix3D : Ti.UI.create3DMatrix;
const create2DMatrix = Ti.version >= '8.0.0' ? Ti.UI.createMatrix2D : Ti.UI.create2DMatrix;
*Solution:* Use semver gte() method instead.

Comments

  1. Ewan Harris 2020-06-30

    PR: https://github.com/appcelerator/alloy/pull/960
  2. Ewan Harris 2020-07-20

    Test steps: Use the [builtins sample](https://github.com/appcelerator/alloy/tree/master/samples/apps/basics/builtins) and make sure the functionality still works, if you're feeling adventurous bump the SDK version to 10.0.0 and create a build via the build scripts, it should still work on that SDK
  3. Samir Mohammed 2020-08-13

    Closing ticket, using CLI version 8.1.0-master.11, Tested using the instructions above. NOTE* once a SDK Branch exists this can be retested.

JSON Source