Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-1720

Version string comparison will break for SDK 10.0.0

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: CLI Release 8.1.0
    • Component/s: None
    • Labels:
    • Sprint:
      2020 Sprint 13

      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.

        Attachments

          Activity

            People

            • Assignee:
              eharris Ewan Harris
              Reporter:
              jquick Joshua Quick
              Tester:
              Samir Mohammed
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration