[TIMOB-20337] Parity: enabling run-on-main-thread
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-03-29T16:21:21.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 5.4.0 |
Components | Tooling |
Labels | notable, qe-5.4.0 |
Reporter | Chee Kiat Ng |
Assignee | Chee Kiat Ng |
Created | 2016-02-04T07:03:24.000+0000 |
Updated | 2016-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.
Steps to test
1. *appc new* 2. in tiapp.xml, instead of puttingOther Sources -> defines.h
6. in tiapp.xml, setExpected 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 defaultPR here: https://github.com/appcelerator/titanium_mobile/pull/7747
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: *
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.[~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.
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
ok it's verified. It's supposed to be 'bool'.
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 puttingOther Sources -> defines.h
6. in tiapp.xml, use *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 defaultPR merged.
[~bimmel] notable for 5.4.0
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*