Page MenuHomePhabricator

jquery.tipsy will be removed from MediaWiki core.
Open, Needs TriagePublic

Description

NOTE: If you are looking at this task because of a broken gadget that you need to restore ASAP please see T336019#8856590 for mitigation steps. This change will not be rolled back.

Worse case scenario, if one of these gadgets needs to be restored right away, would be to replace calls to mw.loader.using('jquery.tipsy')

jquery.tipsy will be removed from MediaWiki core (T117720)
The removal will impact 342 user scripts.

https://global-search.toolforge.org/?q=%5C.tipsy%5C%28&regex=1&namespaces=&title=.*%5C.js

In most cases, any lines calling .tipsy( can be commented out without any issue.

For those who are keen to retain the existing behaviour, OO.ui.PopupWidget is recommended. https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MultimediaViewer/+/915851 can be used as a working example.

BeforeAfter
image.png (209×377 px, 8 KB)
Screenshot 2023-05-04 at 4.16.00 PM.png (186×278 px, 12 KB)

Event Timeline

Izno changed the subtype of this task from "Bug Report" to "Task".May 5 2023, 1:39 AM

@Jdlrobson Do you have a rough idea of when this will happen?

Added to https://meta.wikimedia.org/wiki/Tech/News/2023/19 – please make sure it looks OK, if you see this in time.

Tech News entry: Would linking also to https://www.mediawiki.org/wiki/Help:Locating_broken_scripts be worth? That could allow tech-interested users to find a first hint why a script isn't working anymore, generally speaking.

It looks like 111 (of the 342) results are from Morebits.js (perhaps all related to Twinkle?). I wonder if that's something that the Global Interface Admins could help resolve, perhaps semi-automatically? I'm not sure if it's as simple as simply copying/importing the latest version from Enwiki's morebits.js (which appears to have removed the Tipsy dependency on 19 July 2020‎).

@Quiddity more than likely. The issue with Twinkle is lots of people are using outdated versions and abandoning ports and it's unclear which ones are still active. I'd hope the impact here would be low and might be a good opportunity to delete those unused outdated versions.

Update regarding timeline: Ideally I'd like to merge this on 18th May and let this roll out on the train the following week (making a deadline of 25th May).

This is a quite tight timeline given the number of affected scripts. What will happen if some code won’t have been cleaned up by the time of the rollout? (Or will someone from WMF fix all code – including Morebits copies and other things – by that?) Will such scripts throw errors when jQuery.tipsy is used? Will they not load at all? Does the behavior depend on whether the dependency is declared statically or dynamically? (There are 74 MediaWiki:Gadgets-definition pages declaring jquery.tipsy as a dependency. I’ve removed a such dependency that wasn’t even actually used by the script, because the Gadgets-definition line imported from enwiki was older than the actual code. If the error is thrown only when jQuery.tipsy is used, the inconsistent code would have been fine.) Will it cause log spam?

Active scripts when calling the tipsy function will throw an error and I will personally fix or disable anything that errors in Wikimedia production at a significant rate (e.g. more than 100 errors in a 24 hour period). Before the deployment.

I will go through the MediaWiki:Gadgets-definition to patch anything referencing it (in particular Twinkle per T336019#8834896) but I'll be a lot happier if those in projects who are best familiar with these gadgets check compatibility themselves.

You can simulate what will happen to your local wiki with the following gadget/ user script.

mw.loader.using('jquery.tipsy').then(function () {
  $.fn.tipsy = undefined;
} );

I'm not predicting much impact as many of the scripts look to be inactive and tipsy is not a critical library. In a worst case scenario a project can add the following code to MediaWiki:Common.js to restore functionality to a critical broken script that uses tipsy:

$.fn.tipsy = function () {}

It does not seem like dewiki will be able to adjust its gadgets with this on that short notice. Maybe it would be possible to delay this a few weeks?

Hi @MGChecker the only gadget impacted on dewiki is https://de.wikipedia.org/w/index.php?title=MediaWiki:Gadget-Vorlagenmeister/core.js and it looks like an easy fix to me. I can do that today if you want me to.

What am I missing?

I am unsure, but local experts are claiming that they will require extensive testing. See WD:NEU.

@MGChecker I assume you mean the comment from @PerfektesChaos (your link points elsewhere). I honestly don't think this requires extensive testing. Tipsy is not critical functionality, and will alert us if it's used anywhere in code. Commenting out the code should be all that's necessary to do here. I'm happy to do the work here before the cut off date to understand this, if you let me know precisely which gadgets are of concern.

I've made all the preparations I can to pre-empt this change.
Seeing no bugs in https://logstash.wikimedia.org/app/dashboards#/view/AXDBY8Qhh3Uj6x1zCF56?_g=h@218e8f9&_a=h@18c5d9f

The following 48 gadgets in the MediaWiki namespace will either stop working or throw errors. I'm not sure how actively these are used so will rely on reports from users and production errors:
https://global-search.toolforge.org/?q=%5C.tipsy%5C%28&regex=1&namespaces=8&title=.*%5C.js
There are opportunities to consolidate the templates here to also organize and consolidate code efforts in forked gadgets or seek alternative better supported solutions.

Worse case scenario, if one of these gadgets needs to be restored ASAP, and you don't have time to do that properly, here is what I suggest:

jquery.tipsy is used by a default gadget on Chinese Wikipedia providing cross-language link support, which has wide usage in the wiki.

@Diskdance to avoid loss of this gadget I've updated https://zh.wikipedia.org/w/index.php?title=MediaWiki:Gadget-internalLinkHelper-redtipsy.js - if this looks like an acceptable solution it can be copied across to the other Chinese projects.
(Although this should be a "temporary" solution - ideally this script should be rewritten without jquery.tipsy)

Change 923358 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/ArticleFeedbackv5@master] Replace jquery.tipsy from core with local copy

https://gerrit.wikimedia.org/r/923358

T337651 is maybe caused by this removal in case anyone here can sort it.

Worse case scenario, if one of these gadgets needs to be restored ASAP, and you don't have time to do that properly, here is what I suggest:

Why was all the licensing and attribution information stripped from these copies of tipsy?

jquery.tipsy is used by a default gadget on Chinese Wikipedia providing cross-language link support, which has wide usage in the wiki.

I forked Reference Tooltips into a new Internal Link Helper for personal usage. It might be of interest to zhwiki. See https://yue.wikipedia.org/wiki/User:h78c67c/internalLinkHelper.js

Change 923358 merged by jenkins-bot:

[mediawiki/extensions/ArticleFeedbackv5@master] Replace jquery.tipsy from core with local copy

https://gerrit.wikimedia.org/r/923358