Looking to the future of mediaWiki the base set of javascipt will 
continue to grow as the client side applications grow in complexity to 
address improved usability issues and new features. To this end it will 
become more necessary to A) have a better system for sending out client 
side javascript. and B) standardize around a JavaScript helper library.

A) The improved delivery mechanism is a two part issue: Code 
maintainability and client side performance. 1) To maintain and 
modularize code as the complexity of javsaciprt libraries grows, it 
makes a lot of sense to split JavaScript class & objects into respective 
files folders etc. Likewise we dont' want additional requests for 
language code delivery. By using a server side delivery system we can do 
clean dynamic addition of sets of javascript files to the page in a 
single request "just in time" as the user interacts with a given set of 
interface components.  If we don't update our javascript delivery 
mechanisms this will result in _lots_ of little javascipt requests and 
less maintainable/flexible javascript code.

2) Furthermore with complex javascript libraries we want to add verbose 
comments, documentation, and debugging statements to the code without 
resulting in reduced client side performace in delays due to file size 
increases. Minimized javascript can strip all that unnecessary bits.

I propose we implement or adopt something like: 
http://code.google.com/p/minify/
This will mean sets of javascript files can be grabbed in a single 
request, minimized, grouped, cached, and gziped (if the clients supports 
it). This should work fine with our reverse proxy setup resulting in a 
net decrease in cluster load by dealing with smaller files for the 
majority of the time. A user preference could request un-compressed 
individual files and or a url parameter like ?jsdebug=true could enable 
non-compressed output for debugging.

A library such as minify can also minimize and group all the style 
sheets and minimize html output if we wanted. Although the gains are not 
anywhere as dramatic or as necessary for the html/css space.

If we can get some community consensus about this direction that would 
be good. I will start looking at integrating the above mentioned 
library, run some tests etc.

B) We should also address the convergence on a javascript library for 
HTML document traversing, event handling, interface improvements, 
maintainability, flexibility etc. All the sequencer, metavid stuff uses 
jQuery. jQuery is GPL/MIT licensed javascript library emerging as the 
"winner" in script libraires with very wide adoption (google, apple.com, 
digg.com, mozilla.com etc) and very small footprint. Refactoring 
existing mediaWiki javsacript code as jQuery javascript would result in 
much fewer cross browser hacks in mediaWiki javasctipt and generally 
shorter, more maintainable code. So seems like a good direction to me ;)

peace,
--michael

_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to