Exploring the Latest Features in MediaWiki 1.41
What’s new in MediaWiki 1.41?
Fresh out of the forge, MediaWiki 1.41 lands with a handful of tweaks that feel less like a wholesale overhaul and more like a series of thoughtful polish‑ups. If you’ve been tinkering with a wiki for years, you’ll notice the changes right away – the kind of subtle shifts that make you wonder how you ever lived without them.
User‑Facing Improvements
First up, the everyday editor gets a cleaner interface. The “Users and Rights” hub now groups all permission‑related shortcuts under a single banner. No more hunting through four different menus just to grant a user the sysop role.
- Tabs for JSON page editing replace the old space‑based indentation. The switch means you can paste a blob of JSON straight from an API response without worrying about mis‑aligned whitespace.
- Local system messages now respect a more logical loading priority. In plain English: language overrides that previously felt like a lottery now load predictably, so your custom
MediaWiki:sidebarappears where you expect. - A new “Account Management” section on the personal toolbar bundles profile tweaks, email settings and two‑factor options in one neat column. Even the most reluctant user can find the “change password” link without a treasure map.
Those who love the classic “View source” button will notice a tiny delay gone – the button now fires asynchronously, so page rendering isn’t held hostage while the source snippet loads.
Sysadmin‑Centric Features
From the server room viewpoint, 1.41 brings a few gems that keep the wiki humming along.
- Cache‑aware messaging. System messages now respect the
$wgMessageCacheExpirysetting more faithfully, reducing the need for manual cache busts after a bulk edit ofMediaWiki:pages. - Improved ExtensionRegistry handling. Extensions can now declare optional dependencies that spring into action only if the required library is present. The registry logs a friendly warning instead of throwing a fatal error, saving admins from late‑night panic.
- Database schema checks. The
maintenance/checkSchema.phpscript runs a quick sanity check on tables that have been altered by custom extensions. It prints a concise report – think of it as a health check for your DB.
And for those who love fiddling with LocalSettings.php, there’s a new helper function:
wfLoadExtension( 'MyCoolExtension' );
$wgMyCoolExtensionEnableFeatureX = true; // toggle X on the fly
The variable now respects $wgEnableSidebarCache, meaning you can turn off the sidebar’s caching without diving into the core.
Developer‑Level Additions
Developers will feel the most noticeable shift in the API layer and the testing toolkit.
- JSON output now defaults to using tabs instead of spaces. It’s a small aesthetic change but it aligns MediaWiki’s JSON with the broader JavaScript ecosystem, which often prefers tabs for minified data.
- The new
ActionApihook (BeforeApiWrite) lets extensions inject custom fields just before the response is serialized. In practice, you could add a “wiki‑version” flag to everyqueryresponse without patching core. - PHPUnit now ships with a fresh
MediaWikiTestCasesubclass that pre‑loads a mock language object. Writing language‑aware tests used to be a chore; now the boilerplate disappears.
Here’s a quick snippet showing how an extension might append data via BeforeApiWrite:
public static function onBeforeApiWrite( $result, $module ) {
if ( $module instanceof ApiQueryInfo ) {
$result->setLegacyParam( 'wiki_version', MW_VERSION );
}
return true;
}
Notice the use of setLegacyParam – it intentionally keeps backward compatibility while still exposing the new field.
External Library Updates
MediaWiki 1.41 bundles newer versions of several third‑party libraries, which brings a handful of performance enhancements and stricter type checking.
Another gem: Parsoid now ships with a lighter JSON parser that eliminates an extra round‑trip when rendering VisualEditor content. The result? Faster loads on mobile, especially on low‑bandwidth connections.
How These Changes Play Out in Real‑World Wiki Ops
Imagine you run a community‑driven encyclopedia about vintage motorcycles. A contributor wants to add a diagram of a 1965 Harley‑Davidson frame. In older releases, they'd have to upload the SVG, then manually adjust a .css file to make it display nicely. With 1.41, the SVG loads directly in the parser, and the new saner priority for system messages ensures your custom MediaWiki:skin tweaks show up instantly.
Meanwhile, the site admin, who’s also the resident “dev‑ops” wizard, can roll out a quick maintenance/refreshLinks.php run and watch the cache‑aware message system update the navigation bar without a full purge. It’s the sort of workflow that feels like the wiki finally remembers that you have a life outside of the server room.
Potential Gotchas
Nothing’s perfect, and every upgrade throws a few curveballs.
- Extensions that hard‑code JSON spaces may produce diff‑style warnings after the tab switch. A quick search‑and‑replace in the extension’s output routine usually clears it up.
- The new
BeforeApiWritehook is called late in the request cycle; trying to modify request‑level parameters (likelimit) won’t work. Keep your changes read‑only for the response payload. - Some older skins still reference deprecated global variables that have been retired in 1.41. A brief audit of
skin/*.phpfiles is advisable before pushing the upgrade to production.
Wrapping Up the 1.41 Experience
All told, MediaWiki 1.41 feels less like a brand‑new model and more like a well‑worn toolbox that’s just had the handles sanded down. The user‑facing tidbits make daily editing smoother, the sysadmin features keep the engine humming, and the developer hooks open doors for creative extensions without breaking the existing ecosystem.
If you’re already perched on a 1.40 LTS, the migration path is fairly straightforward – most of the heavy lifting is done by the update.php script. A couple of quick sanity checks (extension compatibility, custom skin variables) and you should be sailing.
In the end, the upgrade reads like a quiet conversation between the core team and the myriad of wiki operators across the globe: “We’ve heard you, we’ve tweaked a few knobs, now go on and make your next article sparkle.”