Wikibooks:Reading room/Technical Assistance
| Discussions | Assistance | Requests | Announcements |
|---|---|---|---|
| General | Proposals | Projects | Featured books | General | Technical | Administrative | Deletion | Undeletion | Import | Upload | Permissions | Bulletin Board |
Welcome to the Technical Assistance reading room. Get assistance on questions related to MediaWiki markup, CSS, JavaScript, and such as they relate to Wikibooks. This is not a general-purpose technical support room.
To submit a bug notice or feature request for the MediaWiki software, visit Phabricator.
To get more information about the MediaWiki software, or to download your own copy, visit MediaWiki
There are also two IRC channels for technical help: #mediawikiconnect for issues about the software, and #mediawiki-coreconnect for WMF server or configuration issues.
Archive MediaWiki:Common.js/jQueryAsync.js
- This follows-up from the April 2025 thread.
Hi,
As part of the Unified mobile routing rollout on Wikibooks yesterday, I'm auditing wikis for potential technical issues. The eachAsync is ready log message on page views drew my attention. This is part of a setTimeout-loop, waiting for an importScript, as ad-hoc dependency manager between it and the two callers (MediaWiki:Common.js/Toolbox.js and MediaWiki:Gadget-Special characters.js).
Both scripts adopted $.eachAsync in 2014 to speed things up (diff 1, diff 2). The code currently inside these async loops is small and fast by modern standards, so this actually makes things slower rather than faster, due to the overhead of so many timer allocations, function calls, and dedidated event loop tasks.
For Toolbox.js, I've turned the code back into a simple for-loop (edit).
Regarding Gadget-Special_characters.js, this gadget broke 9 years ago. The buttons don't do anything when clicked, because it relied on inline <a onclick=".." attributes, which MediaWiki has not used since this software change in 2016. Special:GadgetUsage says it has 0 active users at the moment, which is not surprising, then. I've upgraded MediaWiki:Edittools and MediaWiki:Gadget-Special characters.js (edit) to follow the latest documentation at mw:Extension:CharInsert#Scripting. The look the same as before, except they work now. So perhaps those of you who turned this off, may want to give this gadget another go.
With all that, I've archived jQueryAsync.js (edit). Note that if something similar is needed in the future, there are other approaches I would recommend instead:
mw.hook().fire()at the end of the destination script, instead of in Common.js. This way you don't need a setTimeout loop.mw.loader.getScript()with the full action=raw URL. This gives you a native callback for when the script has finished loading.- Define a hidden/default gadget in MediaWiki:Gadgets-definition. There you can bundle multiple pages together in a reliable way (e.g. jQueryAsync.js, and then Toolbar.js), and can be dependended on by other gadgets, such as Gadget-Special characters.js, in either the gadget definition or via
mw.loader.using(['ext.gadget.mygadget']).then(…);. Gadgets also enjoy greater performance in the browser by being strongly compressed and cached offline instead of requiring a server call for each file.
These are small and non-essential changes. Feel free to revert or ping me here if you need anything. Krinkle (discuss • contribs) 20:23, 24 September 2025 (UTC)
- Thank you! —Kittycataclysm (discuss • contribs) 14:44, 25 September 2025 (UTC)
- Krinkle, please see phab:T405862; I've filed a bug report that block log entries on mobile are difficult to read in this project. Codename Noreste (discuss • contribs) 21:19, 28 September 2025 (UTC)
- @Krinkle: Sorry about that bodge (I was the one who set up the jQueryAsync thing). Thanks for fixing the gadget! JJPMaster (she/they) 23:52, 22 October 2025 (UTC)
Template:Policy
Requesting temporary unprotection to add a closing DIV tag. ShakespeareFan00 (discuss • contribs) 11:17, 26 October 2025 (UTC)
- I already added that closing tag for you.. Codename Noreste (discuss • contribs) 14:54, 26 October 2025 (UTC)