Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20337] Parity: enabling run-on-main-thread

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-03-29T16:21:21.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsTooling
Labelsnotable, qe-5.4.0
ReporterChee Kiat Ng
AssigneeChee Kiat Ng
Created2016-02-04T07:03:24.000+0000
Updated2016-07-19T23:52:52.000+0000

Description

Both iOS and Android enables run-on-main-thread in tiapp.xml However, the properties are placed in different locations. We should modify iOS to be in parity with the current implementation for Android (moving it out of the section. See related ticket.

Comments

  1. Chee Kiat Ng 2016-02-17

    Steps to test

    1. *appc new* 2. in tiapp.xml, instead of putting under section, put it at the same level and set it to *false* 3. *appc run -p ios* 4. inside build folder, open the Xcode project 5. Look in Other Sources -> defines.h 6. in tiapp.xml, set property to *true* 7. Repeat 3-5 8. in tiapp.xml, remove property 9. Repeat 3-5

    Expected Result

    5. You will see *#define TI_USE_KROLL_THREAD* implying it is not running under main thread 7. You will *not* see *#define TI_USE_KROLL_THREAD* implying it is running under main thread 9. You will see *#define TI_USE_KROLL_THREAD* implying it is not running under main thread by default
  2. Chee Kiat Ng 2016-02-17

    PR here: https://github.com/appcelerator/titanium_mobile/pull/7747
  3. Chee Kiat Ng 2016-03-23

    While working on hyper loop, i realised that i made the mistake. There's still no parity between android and ios. on android, this is how you enable main thread: *true* whereas the one I implemented on iOS, it is *true* So before I change this again, [~cbarber], [~cwilliams] any objections for me to finalise on *true* for both platforms?
  4. Chris Barber 2016-03-23

    As I've said before, we really should have an alternative way to specify settings in the tiapp.xml that are not bundled with the app. I proposed adding a new <setting> tag. However, I think this doesn't go far enough. We need to introduce something similar to build configurations in Xcode so that you can twiddle properties/settings per deploy type (dev/test/prod) which is similar to Xcode's debug/release. I proposed build profiles, but that solution may need to be refreshed. In short, it doesn't really matter what you choose to do today because it's going to change in the future.
  5. Christopher Williams 2016-03-23

    [~cng] I think the property tag is fine for parity sake. As far as what [~cb1kenobi] is talking about, I think that's related to build-time only settings, whereas for this particular property, Android *needs* it at runtime inside the app to change it's behavior regarding where to run the kroll thread.
  6. Chee Kiat Ng 2016-03-24

    I realised that when assigning a property type, it has to be 'bool' and not 'boolean' according to http://docs.appcelerator.com/platform/latest/#!/guide/tiapp.xml_and_timodule.xml_Reference-section-29004921_tiapp.xmlandtimodule.xmlReference-app_properties PR here that addresses this parity using 'bool', but [~cwilliams] can you check to see on Android if we should be using 'bool' or 'boolean'? https://github.com/appcelerator/titanium_mobile/pull/7878
  7. Chee Kiat Ng 2016-03-28

    ok it's verified. It's supposed to be 'bool'.
  8. Chee Kiat Ng 2016-03-28

    PR ready to be reviewed: https://github.com/appcelerator/titanium_mobile/pull/7878

    Steps to test

    1. *appc new* 2. in tiapp.xml, instead of putting under section, use *false* at root 3. *appc run -p ios* 4. inside build folder, open the Xcode project 5. Look in Other Sources -> defines.h 6. in tiapp.xml, use *true* 7. Repeat 3-5 8. in tiapp.xml, remove *true* 9. Repeat 3-5

    Expected Result

    5. You will see *#define TI_USE_KROLL_THREAD* implying it is not running under main thread 7. You will *not* see *#define TI_USE_KROLL_THREAD* implying it is running under main thread 9. You will see *#define TI_USE_KROLL_THREAD* implying it is not running under main thread by default
  9. Feon Sua Xin Miao 2016-03-29

    PR merged.
  10. Chee Kiat Ng 2016-03-31

    [~bimmel] notable for 5.4.0
  11. Josh Longton 2016-07-19

    Verified as fixed. Tested on: 
Mac OSX El Capitan 10.11.6 Studio: 4.7.0.201607130543 
Ti SDK: 5.4.0.v20160713141635 
Xcode 7.3.1 
Appc NPM: 4.2.7 Appc CLI: 5.4.0-33 Node v4.4.4 *
Closing Ticket*

JSON Source