Page MenuHomePhabricator

Write a step-by-step tutorial on how to use ResourceLoader in a (new) extension
Closed, ResolvedPublic

Description

We have lot of documentation starting from https://www.mediawiki.org/wiki/ResourceLoader

One thing which is lacking, would be a step by step tutorial to build an extension from scratch that will just load a css and a js.


Version: unspecified
Severity: enhancement

Details

Reference
bz37803

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:27 AM
bzimport set Reference to bz37803.

This is a documentation bug blocking bug 1.

Maybe Danielle Benoit could help?

I'm not sure it is really lacking.

These two are both pretty well documented. ResourceLoader takes a lot of maintenance and set-up steps out of the developers hands.

Especially for a new extension all it is is this:

  1. Registering in wgResourceModules
  2. Loading with OutputPage::addModules

Both of which are described on on mediawiki.org. Just now I've rephrased some of that and moved it here: [[mw:ResourceLoader/Developing_with_ResourceLoader]] (#Registering and #Loading_module respectively).

The other things (debugging features, special CSS anotations etc.) are optional, and were already documented under /Features and Developing_with_ResourceLoader.

We definitely have a lot of documentation about RL. What this bug is about is really writing an introduction to the resource loader for newcomers / newbies. We have recurring requests on MediaWiki-General about how to add a JavaScript file to an extension, I usually end up pointing people to the WikiLove extension as an example. A tutorial would let them start up their extension more easily.

See also bug 37805 which is about writing an example extension in mediawiki/extensions/examples