Page MenuHomePhabricator

jquery.tipsy will be removed from MediaWiki core.
Closed, ResolvedPublic

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

I want to comment on two very disturbing things the way this task was done:

  1. The task identified that “removal will impact 342 user scripts” but failed to identify that removal will impact systemwide functionality on at least two wikis.
  2. The Tech News writer was misled into thinking we can “read more” about switching to OO.ui.PopupWidget but all the provided links offer no explanation.

This suggests no one in development has even thought of the possibility that these jquery components that they’re planning to remove could affect system scripts — not just “user scripts” — and had done no research on actual impact. Something needs to change.

PS: This is coming from someone who’s usually anti-Javascript. No one in development seems to have thought this was a big change, but as a user, even I find this change disruptive.

@Al12si I am not 100% sure what you mean by "system script" but please see T336019#8856590 for mitigation steps per the note in the task for any code that is maintained on a wiki. https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ArticleFeedbackv5/+/923358/ provides an example of how you would patch an existing extension or skin to fix this issue. If that information isn't sufficient you have a specific project or on-wiki scripts that's impacted feel free to ping me there, and I'll help you fix it.

This code has been triggering deprecation warnings in the developer console since 2017. I am sorry this message didn't reach you and would be happy to hear of ways we could better improve communication around how future changes are made.

@Jdlrobson: I am the one writing the Cantonese translation of Tech News since some 6 months ago. I translated the Tech News about tipsy’s removal; as a user, the change still shocked me (I didn’t write the system script in question, someone from another, bigger wiki wrote it) and when I reread the Tech News item even I could not understand how to switch over.

No one looks at the development console. Even when I’m writing Javascript I only check it when something goes wrong. If disruptive changes are planned warnings need to more disruptive so that people will actually see them.

No one looks at the development console.

I think this is a problem. As a developer I regularly check these at least once a week and pay attention to anything I see there. Gadget maintainers should be proactively worrying about these, but I think the problem we have is that many gadgets do not have maintainers.

If disruptive changes are planned warnings need to more disruptive so that people will actually see them.

@Al12si what would you recommend? My thinking is that errors are a pretty disruptive way to make sure people see them.

Cantonese Wikipedia should be fixed with these 2 changes. Thanks for flagging:

It’s not. Typography is fixed (which is a much welcome improvement. Thanks), but functionality is not. I don’t understand the script/gadget in question to know what’s happening, and no error is showing in the console.

PS: It took me several days to connect tipsy’s removal with the issue (which I understand is also happening on zhwiki, which wrote the script in question); as a user all we notice is “something is broken, it’s probably me”, I only suggested the breakage might have to do with tipsy’s removal when another user asked me if I broke it.

It’s not. Typography is fixed (which is a much welcome improvement. Thanks), but functionality is not. I don’t understand the script/gadget in question to know what’s happening, and no error is showing in the console.

Sorry to hear that. I'm happy to help you here, but I need a lot more information. Please can you at minimum give me the following:

@Jdlrobson: My understandingg is @H78c67c has already written a replacement and the admins will eventually sort things out and replace the broken gadget. So speaking long-term, tipsy’s removal should not be an issue on yuewiki. What I’m concerned about is the general failure to realize tipsy is used on zhwiki, yuewiki and commons in ways that cannot be meaningfully called “user”.

But in the meantime the info you asked for are:

  • Name of the gadget: Not sure (it’s a sitewide system thing, it’s not something you enable yourself) but it’s triggered by templates like {{link-en}} which would eventually resolve to Module:ilh.
  • Screenshot: Nothing to show really, typography is now fixed and I don’t have a way to reproduce the old behaviour and I didn’t take a screenshot before the breakage. Before tipsy was removed the gadget would pop up a box on hover which would say something to the effect of “Can’t find article XXX. You can read article YYY on ZZZwiki.” but only if the article linked via {{link-en}} and similar templates is not present at yuewiki.
  • Sample page: [[:yue:畢業論文]], in the navbox at 藝術方法學. Before your attempted fix it would show “藝術方法學(英文:Art methodology)” (note 1) where “Art methodology” would be a link to enwiki. If you hover over the link now you would just see the usual “藝術方法學 (無呢版)” tooltip (i.e., “no such article”), as opposed to something like “Article 藝術方法學 does not exist on this wiki, you can refer to Art methodology in the English Wikipedia”.
  • Gadgets I’ve enabled: gadget-ReferenceTooltips, gadget-refToolbar, gadget-UTCLiveClock, gadget-internalLinkHelper-altcolor
  • My username there: Al12si (same as my username here)
  • My skin: Timeless (because Vector is borderline unreadable with my setup; Vector 2022 is completely unreadable)
  • Browser: Brave

Note 1: This is still what’s seen on a text browser, so HTML-wise this is the real output. I never realized the real output was like this since I’ve been using my text browser a lot less often than I used to.

Screenshot: Nothing to show really, typography is now fixed and I don’t have a way to reproduce the old behaviour and I didn’t take a screenshot before the breakage. Before tipsy was removed the gadget would pop up a box on hover which would say something to the effect of “Can’t find article XXX. You can read article YYY on ZZZwiki.” but only if the article linked via {{link-en}} and similar templates is not present at yuewiki.

Okay, thanks for this information. I've made the following change which should restore use of this gadget for you (for now): https://zh-yue.wikipedia.org/w/index.php?title=MediaWiki%3AGadget-internalLinkHelper-redtipsy.js&diff=1994589&oldid=1984349. This is only a temporary fix, so to avoid this happening again I encourage Cantonese Wikipedia to identify a new maintainer for this gadget who can monitor issues and Tech News to avoid this important gadget breaking again.

What I’m concerned about is the general failure to realize tipsy is used on zhwiki, yuewiki and commons in ways that cannot be meaningfully called “user”.

It was fixed on zhwiki as we were notified the gadget was still important (see T336019#8858802) and I noted that these would break in T336019#8856590. Unfortunately usage of those gadgets was not significantly high enough to notify us that the gadgets were still being widely used so we rely on bug reports like yours here ! (so thank you for notifying us!)

The Cantonese Wikipedia community is responsible for their gadgets, so really the problem here is the lack of maintainers on the wiki for these gadgets. While I'm sympathetic to this problem, we don't have a good solution to prevent all gadgets from breaking. We don't have enough people to manually fix all the gadgets on all our projects, so all we can do is mitigate this by communicating these changes as done here, and providing support like I am right now.

I understand this might not be satisfying, but I invite you to participate in the recommendations we are drafting at https://www.mediawiki.org/wiki/Recommendations_for_gadget_developers_on_Wikimedia_wikis#Communication_with_Wikimedia_developers to find better and mutually understood communication methods to prevent this sort of thing happening in future.

I hope you have a good weekend!

Any reason this task is still open?

Jdlrobson claimed this task.