The MediaWiki 1.17 engine has been released. My extension replacing jQuery is still functional in it. But in the future (for MediaWiki 1.18) there will be a more elegant solution. 

    On June 22, 2011, the Wikimedia Foundation released the next stable version of the MediaWiki engine - version 1.17. You can easily find relevant news in English on the mediawiki-announce newsletter , which is hyperlinked to a detailed list of changes and upgrade instructions.

    One of the main (and even key) news of this version was the emergence and implementation of a unique ResourceLoader engine , the purpose of which is the automatic assembly of “resources” (javascript and CSS conglomerates, from which one common CSS file and one common javascript file are collected), taking into account their mutual dependencies (for example, jQuery UI depends on jQuery) and with subsequent minification. Two resources containing MediaWiki utility scripts and jQuery 1.4.2 library ,connect automatically anyway.

    Those of you who want to use the newer version of jQuery can still use my method and extension, which I talked about 12 days ago in the same blog. Oddly enough, I didn’t have to change a single letter in its PHP code to ensure operability in MediaWiki 1.17 - this is a good luck, despite the fact that (due to the complexity of the ResourceLoader) the previous opportunity to easily “bite” a call to the jQuery library built into MediaWiki, completely disappeared. So now my extension “wins” just because it inserts a call to the new jQuery a little earlier than the ResourceLoader starts loading the old one. Library apparentlyjQuery 1.4.2 is smart enough not to replace the new version itself. However, it is sad that now (unlike 1.16), my extension does not allow downloading one version of jQuery (my own) instead of another (built-in engine): in 1.17 they are loaded together, which is uneconomical.

    I’ll immediately warn you that as you adapt to ResourceLoader, some MediaWiki extensions and components will probably learn (and some have already learned) to rely on that (old) version of jQuery that is built into the MediaWiki engine - and with a noticeable jQuery update, many of them will certainly fall off. In particular, the next version (MediaWiki 1.18) will be delivered (according to the jQuery page on its wiki) with a not-so-updated jQuery library (version 1.4.4 instead of version 1.4.2 comingin MediaWiki 1.7) - and all because UploadWizard died when trying to update jQuery to version 1.5.2, being incompatible with the new behavior of the $ .ajax () function , so jQuery inevitably rolled back to 1.4.4 . Keep this incident in mind if you would like to include an overly new version of this popular javascript library on the MediaWiki: jQuery.js page.

    To all this we need to add (and add) that fans of using the updated jQuery library in MediaWiki 1.18 will not need my extension. In this future version of MediaWiki, fortunately, a new ResourceLoaderGetStartupModules anchor point has been added to which you can attach a PHP script,elegantly replacing jQuery from inside a ResourceLoader. Last night and tonight, the developer Timo Tijhof (the one who, by the pseudonym Krinkle hung the “inspected” flag on the diff about ResourceLoaderGetStartupModules ) kindly agreed at my request to compose an extension that enables this feature - so in the future its extension “ Local jQuery ” can be (and it’s necessary, it’s necessary!) it will certainly be used instead of mine, used right after switching to MediaWiki 1.18, since it saves on the amount of code by invoking one version of jQuery instead of another (and not one after the other, as I had to do in 1.17).

    Finally, a little about sad things. $ WgParser-> disableCache ()

    method, which worked fine in MediaWiki 1.16, causes MediaWiki 1.17 to crash PHP to the “Fatal Error: Call to a member function setCacheTime () on a non-object” state in the /includes/parser/Parser.php module (which indicates some misunderstanding logic of this method in the new version). In particular, the EmbedVideo extension suffered from this, which was invented by Jim R. Wilson in 2007 and which was then dubbed for a long time and upgraded by me and Alexander Mashin. Now it is used in  Tradition , Wikireality, and the  Cyclopedia . The method was simply commented out - after all, media players can be allowed to cache, but it's scary to think about which crutches the authors of those extensions will have to come up with in which the absence of caching of the final page is fundamentally necessary.

    Also popular now: