<div dir="ltr">Johan:<div><br></div><div>I don't have expertise in Seaside versioning, so I can't imagine how a minor change would impact third party systems.</div><div>Having said that I find your proposal appropiate.</div>
<div><br></div><div>One thing that doesn't translate properly is the "always" callback.<br></div><div><br></div><div>#onComplete: -> always -> #ensure:/#always: ?</div><div>#onSuccess -> done -> onDone:</div>
<div>#onError -> fail -> onFail:</div><div><br></div><div>I would do:</div><div><br></div><div>JQAjaxSetup>>onError: aJSObject</div><div><br></div><div>self greaseDeprecatedApi: '...' details: '...'.</div>
<div>self onFail: aJSObject</div><div><br></div><div><br></div><div>Another, more complex, path is to model the JS Promise (JSPromise?), which can be useful for future uses and libraries (<a href="http://promisesaplus.com/">http://promisesaplus.com/</a>).</div>
<div><br></div><div><br></div><div>Regards!</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div>
Esteban A. Maringolo</div>
<br><br><div class="gmail_quote">2014-07-28 17:09 GMT-03:00 Johan Brichau <span dir="ltr"><<a href="mailto:johan@inceptive.be" target="_blank">johan@inceptive.be</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Reading through the documentation, it seems we could easily make this jQuery deprecation transparant for Seaside users:<br>
<br>
- onComplete option -> always callback<br>
- onSuccess option -> done callback<br>
- onError option -> fail callback<br>
<br>
Since the return value of the existing methods on JQAjaxSetup was self already (i.e. the JQAjaxSetup subinstance), making this a transparant change is possible by converting it to add a corresponding function call decoration on the jQAjaxSetup instance, which returns self as well and allows to chain the messages in exactly the same way as they were done before.<br>
<br>
So the implementation of onComplete would be<br>
<br>
JQAjaxSetup>>onComplete: aJSObject<br>
self call: 'always' with: ajSObject asFunction<br>
<br>
Although this is a good thing for continuity, it's probably a bad idea to keep the old method names and rather make everyone use onFail:, onDone: and onAlways: instead (not sure about the last one though...).<br>
<br>
Thoughts?<br>
<span class="HOEnZb"><font color="#888888"><br>
Johan<br>
</font></span><div class="im HOEnZb"><br>
On 18 Jul 2014, at 17:46, Esteban A. Maringolo <<a href="mailto:emaringolo@gmail.com">emaringolo@gmail.com</a>> wrote:<br>
<br>
</div><div class="HOEnZb"><div class="h5">> I was needing to handle an "error" callback for an xhr post, and found<br>
> there is no #onError: handler in JQPost. Went to jQuery website I<br>
> noticed most of the success/fail/complete methods in JQAjax hierarchy<br>
> are deprecated.<br>
><br>
> Deprecation Notice<br>
> The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback<br>
> methods introduced in jQuery 1.5 aredeprecated as of jQuery 1.8. To<br>
> prepare your code for their eventual removal, use jqXHR.done(),<br>
> jqXHR.fail(), and jqXHR.always() instead.<br>
><br>
> Is anybody updating JQuery wrapper for that? Or is there already a way<br>
> to deal with the new "promise" style way of chaining callbacks?.<br>
><br>
> What I'm doing now is something like:<br>
> ((html jQuery post callback: [] value: ()) call: 'done' with: ("js<br>
> function")) call: 'fail' with: ("fail function")<br>
><br>
> Regards!<br>
><br>
><br>
> Esteban A. Maringolo<br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> seaside-dev mailing list<br>
> <a href="mailto:seaside-dev@lists.squeakfoundation.org">seaside-dev@lists.squeakfoundation.org</a><br>
> <a href="http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev</a><br>
<br>
_______________________________________________<br>
seaside-dev mailing list<br>
<a href="mailto:seaside-dev@lists.squeakfoundation.org">seaside-dev@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev</a><br>
</div></div></blockquote></div><br></div>