Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25536

TiAPI: Deprecate Ti global namespace, move to require/import based API's

    Details

    • Type: Improvement
    • Status: Open
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Android, iOS, Windows
    • Labels:

      Description

      Motivation
      As we are moving forward to support more ES6 sugar in Titanium, the legacy namespace-based API's have served well but need to be replaced by a more modern approach.

      Challenges
      We have to think about both the core and native modules and validate whether this actually needs to be a breaking change for modules, as most of the work will be done in the require-handling and kroll-invocation.

      Example

      Before:

      const window = Ti.UI.createWindow({
        title: 'So legacy ...'
      });
      

      After:

      import { Window } from 'titanium-core';
      // OR: import { Window } from 'titanium-ui';
       
      var window = new Window({
        title: 'Beautiful new API!'
      });
      

      Roadmap
      If possible, we could introduce a require/import based approach for one of the next feature-versions, deprecate in the next major (8.0.0) and remove in the following major (9.0.0).

      EDIT: Gary Mathews did Ti.ES6 earlier this year, which uses a similar approach, but requires a lot of "metabase"-like files in order to work.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                hknoechel Hans Knöchel
              • Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Backbone Issue Sync

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

                    Git Integration