Closed tresf closed 8 years ago
So I believe the async:false
warning to be generated by jQuery, not the web browser. This is slightly better, since we can force a certain version of jQuery for now, but that slows down scalability.
What techniques can we use to survive the removal of async:false
?
Reading through the jquery ticket that lead to deprecation on async: false
, I do not think we have to worry.
The deprecation only applies to a specific use case of ajax calls (use with deferred/promises), and remains valid with the use of callback functions (ie success: function() {...}
).
There is also mention in the ticket that if async: false
is removed from ajax, that an alternative method of synchronous calls will be provided.
Could we shim in a setTimout 0
in there somewhere to take it off of the main thread?
We can, but I don't know if that will reintroduce the race condition in the signing, since it will make the signRequest()
function return immediately again.
Yeah, good point...
I assume we'll have room to improve the API in 2.0 and we can discuss this. So from what I read, jQuery requires async: false
for its own API, right?
Yes, if you are expecting to get a javascript promise back, then it has to be an asynchronous call. There would have been too much overhead to have allowed them to make synchronous calls.
I'm going to close this, because 2.0 uses promises around the security calls now, removing this concern.
I gave this answer somewhere else https://stackoverflow.com/questions/48322574/asyncfalse-deprecated-whats-the-simple-way-forward/53637807#53637807
I gave this answer somewhere else https://stackoverflow.com/questions/48322574/asyncfalse-deprecated-whats-the-simple-way-forward/53637807#53637807
demopix pls
Previous versions of this plugin did everything on the main thread. This was a design side effect of mimicking LiveConnect calls. Newer versions have moved asynchronous calls to leverage newer JavaScript techniques. (Promise, await). These newer techniques have been adopted by all major browsers as well as JavaScript frameworks.
Since
signRequest()
requiresasync:false
, we need to use it to prevent race conditions, however Chrome displays a deprecation warning.@bberenz do we have the ability to workaround this to prevent breaking down the road or is this a ticking time bomb?