Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#3099 closed enhancement (fixed)

AJAX Responsiveness

Reported by: mdawaffe's profile mdawaffe Owned by:
Milestone: 2.1 Priority: normal
Severity: normal Version: 2.1
Component: Administration Keywords: ajax listman prototype
Focuses: Cc:

Description

http://comox.textdrive.com/pipermail/wp-hackers/2006-August/007873.html

Cool things

  1. Switch to prototype.
  2. New WPAjax class. Some API, but mostly some simple error checking and cookie passing.
  3. New listman class. Keep old listman class for now (mostly as a comparison).
  4. Recolor list by swapping class names. The sexy fades take too long. We should look into it again later.
  5. When adding or updating content, wait for the server to respond (same as before).
  6. When deleting, approving, etc., update display immediately. When response comes, check it for errors and put back the old content if we need to.
  7. As many AJAX instances going as you want.

Things to worry about

  1. Since we update the display before the data is even fully sent, the user may browse away before the action catches. Solution not yet implemented. Will likely do something like tinyMCE does ("Don't go away, I'm still updating things!").
  2. Double posting the same request.
  3. Version is set to rand() in script loader to avoid caching. Obviously, this will change when it's been beaten down some more.

Attachments (5)

3099.diff (18.4 KB) - added by mdawaffe 16 years ago.
1
3099b.diff (25.3 KB) - added by mdawaffe 16 years ago.
3099c.diff (26.3 KB) - added by mdawaffe 16 years ago.
3099d.diff (26.3 KB) - added by mdawaffe 16 years ago.
3099e.diff (1.5 KB) - added by mdawaffe 16 years ago.
script-loader versions

Download all attachments as: .zip

Change History (12)

@mdawaffe
16 years ago

1

#1 @matt
16 years ago

Yummy!

#2 @ryan
16 years ago

Giving it a test drive. Good so far.

@mdawaffe
16 years ago

#3 @mdawaffe
16 years ago

3099b.diff

  1. New WP_Ajax_Response class outputting the following format: http://codex.wordpress.org/User:MDAWaffe/admin_ajax
  2. Can pass WP_Errors through XML to client.
  3. Fix onXXXXXX handlers.

Still need to worry about the same old things:

  1. Since we update the display before the data is even fully sent, the user may browse away before the action catches. Solution not yet implemented. Will likely do something like tinyMCE does ("Don't go away, I'm still updating things!").
  2. Double posting the same request.
  3. Version is set to rand() in script loader to avoid caching. Obviously, this will change when it's been beaten down some more.

#4 @ryan
16 years ago

Looking good in my tests.

@mdawaffe
16 years ago

#5 @mdawaffe
16 years ago

3099c.diff

  1. When adding, clear froms right away. Restore as necessary.
  2. If user tries to navigate away from page before data is sent, warn with a confirmation dialog. Does not work in Opera (others?) since requires .onbeforeunload. Could write annoying loop with .onunload, but that seems hideous. Thoughts? Throbbers or GMail-like "Loading..." could be implemented as well.
  3. Double posting shouldn't be a problem now that we clear the form right away, but the feedback for this isn't great. Try it out.

Before Committing:

  1. Update version info in script-loader.
  2. svn mv wp-admin/list-manipulation-js.php wp-includes/js/list-manipulation-js.php, delete contents of that file, and overwrite with patch.

@mdawaffe
16 years ago

#6 @mdawaffe
16 years ago

3099d.diff

  1. Needs testing in "slow" environments. Delete something and then try to navigate away from page before it's all done.
  2. Needs testing in IE (and Opera... and everything else). Especially try doing an AJAX call and seeing if subsequent actions on the same object still go through AJAX or if it does a traditional request. Moderate/Unmod the same comment several times. Update the same custom field twice in a row. Add cats in Manage Cats and then delete them.
  3. Play around on the write post screen. Does doing ony other AJAX stuff conflict with autosave?
  4. Try double submitting.

#7 @ryan
16 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [4187]) AJAX responsiveness improvements from mdawaffe. fixes #3099

@mdawaffe
16 years ago

script-loader versions

Note: See TracTickets for help on using tickets.