[wp-hackers] AJAX / JS libraries

Ryan Scheuermann ryan at concept64.com
Sun Apr 23 13:32:53 GMT 2006


Hey all,

With all the new AJAXy goodness and various Javascript tools and scripts 
going into WP Admin 2.1, I feel as though adding a JS toolkit as a basis 
for these JS calls might benefit plugin writers and also 
consolidate/replace a lot of the JS scripts floating around.

I just read ringmaster's comments on Ticket #2654:

    If you're looking to implement something with Ajax, here's an idea:

    Ditch tw-sack (No error handling/debugging? Can't handle equals
    signs as passed values with the standard functions?) and build a
    WP-pluggable ajax library. Move all of the floating PHP functions
    that respond to the various ajax requests into a single file that
    dispatches those requests to plugin hooks. Include some way to hook
    client-side events to server-side code on-demand so that things like
    this can be customized by plugins.

No offense to whomever wrote all this wonderful AJAX and list management 
code, but I fear the maintainability and extensibility of all this is 
going to become a problem in future releases.  And if more AJAX is 
planned for the future, I do think having a strong toolkit to build off 
would be beneficial.  The phrase "don't reinvent the wheel" keeps coming 
to mind.  Let the toolkit worry about handling cross-browser 
compatibility, etc...

I don't know, maybe this has been discussed before or maybe the decision 
was just made by those implementing it...  but for the sake of creating 
an extensible and maintainable product that is now AJAX and JS friendly, 
I think it should be considered.

Personally, I recommend Prototype.  http://prototype.conio.net/  It's 
being used by the Widgets plugin and all the major applications running 
Ruby on Rails (see any 37 Signals product), and I don't think it's 
support is going to go away anytime soon.  And if you've ever seen 
anything written using it, the JS code is beautiful and simple and it 
works.  And adding Scriptaculous effects or tools becomes even easier.

Maybe file size is a concern?  Prototype serves at 12KB with gzip 
compression and caches.

I'm not trying to start some major political debate, I'm just curious 
what everyone's thoughts are on this matter.  If it's been discussed 
before, link me, please.  :-)

Sincerely,

Ryan Scheuermann

-- 
----
Concept 64, Inc. | Phone: 610.349.0703 | Web: www.concept64.com



More information about the wp-hackers mailing list