Re: Changes to iOS PluginResult sending

2012-10-10 Thread Andrew Grieve
I was able to reproduce this on my simulator every time. For some reason, switching from using blocks+dispatch_async to performSelectorOnMainThread fixes it. I've checked in this change, but we should definitely keep an eye out for any other cases of this. On Sat, Oct 6, 2012 at 3:43 PM, Becky G

Re: Changes to iOS PluginResult sending

2012-10-06 Thread Becky Gibson
It may not have been this explicit change - perhaps others that affect the exec mechanism. Two places in the manual mobile-spec show the issue. In contacts an alert is displayed with the success or failure of saving a contact. In the Notifications if you test the Cordova Confirm, after you dis

Re: Changes to iOS PluginResult sending

2012-10-05 Thread Andrew Grieve
I'm not sure why this would have changed. The PluginResult::success method had a setTimeout in it, which I removed, but pretty much none of the core plugins used that method anyways. They all used writeJavascript:callback, which didn't use a setTimeout. The one spot in the code where I did see a c

Re: Changes to iOS PluginResult sending

2012-10-05 Thread Becky Gibson
I am seeing instances where a JavaScript alert within a function callback will hang the app. We have seen this issue before and the solution is to wrap the alert in a setTimeout, for example, setTimeout(function() { alert('error with ' + error.code); }); This problem now seems much more prevale

Re: Changes to iOS PluginResult sending

2012-10-05 Thread Michal Mocny
For those who didn't click the bug link to read the full benchmarks, I'll summarize: If exec() is called from the context of a plugin result callback: perf improved *3x* [IFRAME_NAV] *6x* [XHR_NO_PAYLOAD] If exec() is called not from the context of a plugin result callback: perf improved *66%* [IF

Re: Changes to iOS PluginResult sending

2012-10-04 Thread Filip Maj
Sweet that sounds good On 10/4/12 2:20 PM, "Shazron" wrote: >+1 > >On Thu, Oct 4, 2012 at 2:18 PM, Brian LeRoux wrote: >> nice! looks great andrew >> >> On Thu, Oct 4, 2012 at 10:48 PM, Andrew Grieve >>wrote: >>> TLDR: Added a new method for plugins to use to send plugin results to >>>JS. >>>

Re: Changes to iOS PluginResult sending

2012-10-04 Thread Shazron
+1 On Thu, Oct 4, 2012 at 2:18 PM, Brian LeRoux wrote: > nice! looks great andrew > > On Thu, Oct 4, 2012 at 10:48 PM, Andrew Grieve wrote: >> TLDR: Added a new method for plugins to use to send plugin results to JS. >> >> I've done some work to try and optimize the exec() bridge on iOS: >> http

Re: Changes to iOS PluginResult sending

2012-10-04 Thread Brian LeRoux
nice! looks great andrew On Thu, Oct 4, 2012 at 10:48 PM, Andrew Grieve wrote: > TLDR: Added a new method for plugins to use to send plugin results to JS. > > I've done some work to try and optimize the exec() bridge on iOS: > https://issues.apache.org/jira/browse/CB-1579 > > The main goal of the

Changes to iOS PluginResult sending

2012-10-04 Thread Andrew Grieve
TLDR: Added a new method for plugins to use to send plugin results to JS. I've done some work to try and optimize the exec() bridge on iOS: https://issues.apache.org/jira/browse/CB-1579 The main goal of the change: whenever stringByEvaluatingJavascriptString is used to call a JS callback, poll fo