Bug Tracker

Changes between Version 5 and Version 6 of Ticket #9398


Ignore:
Timestamp:
May 23, 2011, 8:23:39 PM (8 years ago)
Author:
jaubourg
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9398 – Description

    v5 v6  
    11This proposal is a two parter:
    2 1) introduce progress callbacks on Deferreds (just as suggested in the Promise/A proposal). It's kind of a first step before being able to support xhr2 upload and is a much needed addition when dealing with asynchronous tasks that take a non-trivial amount of time to complete and would profit from progression notifications,
    3 2) while working on adding progress callbacks I realized that, while different, the logic for the progress callbacks list wasn't that far away from the one of the other two callbacks lists (the only real difference being that the progress callbacks can be called several times, while done and fail ones are only fired once). This brought me to scrap $._Deferred and go for a much more generic $.Callbacks. The advantage is that I can now implement done, fail and progress callbacks with the same base object. It also gives us an opportunity to factor our different callbacks lists throughout jQuery (meaning more robustness and a diminished code size). It can also be made public so that users can start creating callbacks lists easily.
     21. introduce progress callbacks on Deferreds (just as suggested in the Promise/A proposal). It's kind of a first step before being able to support xhr2 upload and is a much needed addition when dealing with asynchronous tasks that take a non-trivial amount of time to complete and would profit from progression notifications,
     32. while working on adding progress callbacks I realized that, while different, the logic for the progress callbacks list wasn't that far away from the one of the other two callbacks lists (the only real difference being that the progress callbacks can be called several times, while done and fail ones are only fired once). This brought me to scrap $._Deferred and go for a much more generic $.Callbacks. The advantage is that I can now implement done, fail and progress callbacks with the same base object. It also gives us an opportunity to factor our different callbacks lists throughout jQuery (meaning more robustness and a diminished code size). It can also be made public so that users can start creating callbacks lists easily.
    44
    55All my experiments are located in the 1.7/callbacks branch. Still a work in progress, of course. Progress callbacks are in (though buggy atm because I screwed the memory logic of repeatable Callbacks but I'm working on it), $.when supports progress callbacks already. All instances of $._Deferred have been replaced by $.Callbacks objects.