Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24059] Android: Update ti.cloud require to new require standards

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-10-28T05:46:01.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 6.0.0
ComponentsAndroid
Labelsqe-6.0.0
ReporterLokesh Choudhary
AssigneeChristopher Williams
Created2016-10-21T00:21:15.000+0000
Updated2016-11-01T17:28:58.000+0000

Description

Steps to reproduce:

1. In an android app make sure you have ti.cloud module required. 2. Build for android device/emulator.

Actual results:

1. The app builds fine but we see lot of these debug logs:
[DEBUG] :  Module: require called with un-prefixed module id, should be a core or CommonJS module. Falling back to old Ti behavior and assuming it's an absolute file
[DEBUG] :  Module: require called with un-prefixed module id, should be a core or CommonJS module. Falling back to old Ti behavior and assuming it's an absolute file
[DEBUG] :  Module: require called with un-prefixed module id, should be a core or CommonJS module. Falling back to old Ti behavior and assuming it's an absolute file
[DEBUG] :  Module: require called with un-prefixed module id, should be a core or CommonJS module. Falling back to old Ti behavior and assuming it's an absolute file
[DEBUG] :  Module: require called with un-prefixed module id, should be a core or CommonJS module. Falling back to old Ti behavior and assuming it's an absolute file

Expected results:

1. These should not be debug logs like these. 2. Need to update ti.cloud require to new require standards.

Comments

  1. Chee Kiat Ng 2016-10-21

    This ticket may have to be re-described, since we decided to just disable the debug logs above.
  2. Hans Knöchel 2016-10-21

    I am wondering something else here: The log does not include the actual effected path. That was changed in [this commit](https://github.com/appcelerator/titanium_mobile/commit/73b905782cffaf4fe70d8a71cdf778403c0882da) and [this line](https://github.com/appcelerator/titanium_mobile/commit/73b905782cffaf4fe70d8a71cdf778403c0882da#diff-f43b9c568b23f950dc102d13a961daaeR1191), so I'm wondering if you may have an outdated 6.0.0 you are testing with. But the issue is still valid, it would just help to see the actual paths that are effected. Thx! *EDIT*: And please provide a sample code that reproduces the issue, thx! *EDIT2*: Dump me, you talked about Android. We may still want to update Android as well (filed TIMOB-24061) :-)
  3. Christopher Williams 2016-10-26

    [~hansknoechel] Kita and I discussed this in the flow, but basically we can't really update the require paths used in this module because of the way our module system works. Since the new valid require paths aren't backwards compatible, if we update ti.cloud and a user has an app on 5.5.0.GA or lower, it'd automatically use the newest ti.cloud by default which would include the new non-backwards compatible requires. So until 5.x is end of life, we can't really update requires used by global pre-packaged modules (yuck!). So, I think your suggestion of just commenting out this warning message about legacy require syntax wins the day, and we'll just have to add some docs/notes about the new require syntax and side effects of using old/new on various SDK versions.
  4. Chee Kiat Ng 2016-10-28

    PRs merged
  5. Lokesh Choudhary 2016-11-01

    Verified the fix. Closing. Appc Studio : 4.8.0.201610171310 SDK Version : 6.0.0.v20161031201605 Mac OS Version : 10.11.6 Xcode Version : Xcode 8.1 Build version 8B62 Appc CLI AND Appc NPM : {"NPM":"4.2.8-9","CLI":"6.0.0-67"} Ti CLI : 5.0.10 Alloy : 1.9.4 Node : v4.6.0

JSON Source