ResourceLoader
- Since MediaWiki 1.26, gadgets are now required to use ResourceLoader - see ResourceLoader/Migration guide (users) for more details.
| Group: | Features |
| Start: | 2010-06 |
| Team: | Timo Tijhof, Roan Kattouw, Trevor Parscal |
ResourceLoader is the delivery system in MediaWiki for the optimized loading and managing of modules. Modules consist of JavaScript, CSS and interface messages. ResourceLoader was first released in MediaWiki 1.17. Its purpose is to improve MediaWiki's front-end performance and the experience by making use of strong caching while still allowing near-instant deployment of new code that all clients start using within 5 minutes.
Contents
About ResourceLoader[edit]
- → See ResourceLoader/Features for a complete walk through of ResourceLoader
On Wikimedia wikis, every page view includes hundreds of kilobytes of JavaScript. In many cases, some or all of this code goes unused due to lack of browser support or because users do not make use of the features on the page. In these cases, bandwidth, and loading time spent on downloading, parsing and executing JavaScript code is wasted. This is especially true when users visit MediaWiki sites using older browsers like Internet Explorer 6, where almost all features are unsupported, and parsing and executing JavaScript is extremely slow.
ResourceLoader solves this problem by loading resources on-demand and only for browsers that can run them. Although there is much more to it, the overall flow for client-side performance can be summarized by these 3 points:
- Minifying and concatenating
→ which reduces the code's size and parsing/download time
Both JavaScript files, CSS files and interface messages are loaded in a single special formatted "ResourceLoader Implement" server response. - Batch loading
→ which reduces the number of requests made
The server response for module loading supports loading multiple modules so that a single response contains multiple ResourceLoader Implements, which in itself contain the minified and concatenated result of multiple javascript/css files. - Data URI embedding
→ which further reduces the number of requests, response time and bandwidth
Optionally images referenced in stylesheets can be embedded as data URIs. Together with the gzipping of the server response, those embedded images, together, function as a "super sprite".
Documentation[edit]
Manuals[edit]
- Features – Complete overview of ResourceLoader features.
- Developing with ResourceLoader – notes on configuring your development environment and on switching ResourceLoader between development and production modes.
- Migration guide for extension developers – a guide to making extensions to work with ResourceLoader.
- Migration guide (users)
- Core modules – an overview of all core modules, supported with documentation and examples.
- Legacy JavaScript – index of legacy JavaScript functions that predate ResourceLoader modules.
- Vocabulary – the terminology used in ResourceLoader (such as Loader, Module, Requirement, etc.)
Presentations[edit]
These presentations detail the purpose and results of ResourceLoader.
Tutorials[edit]
These presentations go more in-depth towards developers already familiar with MediaWiki development.
Planning[edit]
Past[edit]
- Requirements – requirements gathered during the creation of ResourceLoader.
- Version 1 Specification – the design document for the creation of ResourceLoader.
- Version 2 Specification – the design document for the 2011/2012 extension of ResourceLoader to support cross-wiki module loading.
Future[edit]
- phab:tag/mediawiki-resourceloader
- Tasks - Random uncategorized todo list
- /status
Mobile[edit]
The current implementation of the MediaWiki mobile view as provided by Extension:MobileFrontend has many caveats. For tips to using ResourceLoader to the best of its ability, please see Writing a mobile friendly ResourceLoader module.
| ResourceLoader | |
|---|---|
| Documentation | Features · Vocabulary · Migration guide (users) · Migration guide (developers) · Developing with ResourceLoader · Core modules · Mobile support |
| Project information | Status updates · Version 1 Design Specification · Version 2 Design Specification · Requirements |
| Other | JavaScript Deprecations |
- WMF Projects 2010q2
- WMF Projects 2010q3
- WMF Projects 2010q4
- WMF Projects 2011q1
- WMF Projects 2011q2
- WMF Projects 2011q3
- WMF Projects 2011q4
- WMF Projects 2012q1
- WMF Projects 2012q2
- WMF Projects 2012q3
- WMF Projects 2012q4
- WMF Projects 2013q1
- WMF Projects 2013q2
- WMF Projects 2013q3
- WMF Projects 2013q4
- WMF Projects 2014q1
- WMF Projects 2014q2
- WMF Projects 2014q3
- WMF Projects 2014q4
- WMF Projects 2015q1
- WMF Projects 2015q2
- WMF Projects 2015q3
- WMF Projects 2015q4
- WMF Projects 2016q1
- WMF Projects 2016q2
- WMF Projects 2016q3
- WMF Projects 2016q4
- WMF Projects 2017q1
- WMF Projects 2017q2
- Frontend
- ResourceLoader