There seems to be some confusion about how ResourceLoader works, which 
has been leading people to make commits like r73196 and report bugs like 
#25362. I would like to offer some clarification.

ResourceLoader, if you aren't already aware, is a new system in 
MediaWiki 1.17 which allows developers to bundle collections of 
*resources* (like JavaScript and CSS files, or localized messages) into 
*modules*. Modules may represent any number of scripts, styles and 
messages, which are read from the file system, the database, or 
generated by software.

When a request is made for one or more modules, each resource is 
packaged together and sent back to the client as a response. The way in 
which these requests and responses are performed depends on whether 
debug is on or off.

When debug mode is off:

    * Modules are requested in batches
    * Resources are combined into modules
    * Modules are combined into a response
    * The response is minified

When debug mode is on:

    * Modules are requested individually
    * Resources are combined into modules

I think it's debatable whether debug=true mode goes far enough, since it 
still combines resources into modules, and I am open to contributions 
that can make debug=true mode even more debugging friendly by delivering 
the resources to the client as unchanged as possible. I also think it's 
debatable if debug=false mode goes far enough, since things like Google 
Closure Compiler have been proven to even further reduce the size of 
JavaScript resources, so I am also open to contributions which can make 
debug=false even more production friendly by improving front-end 
performance.

The commits and bugs that I'm contending here are ones which are aiming 
to dilute the optimized nature of debug=false mode, when debug=true mode 
is really what they should be using or improving. These kinds of changes 
and suggestions result in software that is neither optimized for 
debugging or for production, making the front-end performance of the 
site in production slower without making it any easier to debug than it 
would have been by using debug=true.

If you are a developer, working on your localhost, you probably want to 
code with...

$wgResourceLoaderDebug = true;

.. and then test that things work in debug=false mode before committing 
your code. This will result in more requests but less processing, which 
will be much faster when developing on localhost.

I hope this helps clarify this situation.

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

Reply via email to