Page MenuHomePhabricator

Drop deprecated methods in mediawiki.util
Closed, ResolvedPublic

Description

  • wikiGetlink
  • updateTooltipAccessKeys
  • jsMessage
  • escapeId
  • init

Event Timeline

Jdforrester-WMF created this task.

Change 430949 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] mediawiki.util: Drop escapeId(), deprecated since 1.30 and unused

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

Change 430950 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] mediawiki.util: Drop updateTooltipAccessKeys(), deprecated since 1.24

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

Change 430951 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] mediawiki.util: Drop jsMessage(), deprecated since 1.20 and mostly unused

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

Change 430949 merged by jenkins-bot:
[mediawiki/core@master] mediawiki.util: Drop escapeId(), deprecated since 1.30 and unused

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

Change 430950 merged by jenkins-bot:
[mediawiki/core@master] mediawiki.util: Drop updateTooltipAccessKeys(), deprecated since 1.24

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

Vvjjkkii renamed this task from Drop deprecated methods in mediawiki.util to 6kdaaaaaaa.Jul 1 2018, 1:12 AM
Vvjjkkii changed the task status from Stalled to Open.
Vvjjkkii raised the priority of this task from Low to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
CommunityTechBot renamed this task from 6kdaaaaaaa to Drop deprecated methods in mediawiki.util.Jul 2 2018, 6:51 AM
CommunityTechBot changed the task status from Open to Stalled.
CommunityTechBot lowered the priority of this task from High to Low.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: gerritbot, Aklapper.

Per https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/430951/, next steps are:

  • Ensure mw:RL/MGU includes an adequate migration guide for mw.util.jsMessage. In particular it needs to explain that it isn't a simple rename of an existing method. There are two things to look out for. First, the method is in a different module now, which means consuming code must depend on "mediawiki.notify". Second, "implicit raw HTML" was deprecated. Depending on the value of the message parameter, the caller may need to add one function call:
    • If passing a jQuery object or Element object, nothing needs to change.
    • If passing a string value that is intended to be plain text, nothing needs to change.
    • If passing a string intended to be raw HTML, the caller must explicitly call $.parseHTML() first.
  • Add a short message to Tech-News with a link to the RL/MGU guide.
  • Then, go ahead and merge https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/430951/.

I'll self-assign this task now for the first bullet point.

Krinkle changed the task status from Stalled to Open.Sep 25 2018, 7:38 PM
Krinkle added a project: Performance-Team.

@Johan Here's the copy I got:

The mw.util.jsMessage() function deprecated in 2012 will be removed next week. To know if you use an affected script or gadget, look for the warning Use of "mw.util.jsMessage" is deprecated in the JavaScript console (how?). If you are a gadget maintainer, check if your JavaScript code contains mw.util.jsMessage. There is a migration guide available which explains how to use mw.notify instead. (T193901)

Feel free to modify/improve as you see fit. In particular, I'm unsure whether we need the help-link for accessing the console (because it's not localised, and not something we linked before). But, I thought maybe it's good to add on occasion, even without localisation initially. (And a translator could always change the link to a local page, if they have one.)

@Krinkle I assume "next week" will be true on Monday, when this is distributed, and not today, i.e. the same week as when it's sent out?

@Krinkle I assume "next week" will be true on Monday, when this is distributed, and not today, i.e. the same week as when it's sent out?

Yep, that's right. The change is expected to land in the "master" branch during next week (any time after the weeks's branch cut point on Tuesday), to roll out as part of the next branch to be cut after that (e.g. Week 49 / 1.33-wmf.5).

In fact, it'll actually be a week later even (Week 50 / 1.33-wmf.6), because there won't be a train branch in Week 49 (RelEng offsite, per roadmap and calendar).

@Johan: A quick grep states that [mw|mediawiki].util.jsMessage is used in 99 gadgets (see P7840) on WMF sites. Some might be popular (Twinkle).
Has it been considered to give an explicit heads-up on corresponding Village Pumps explicitly mentioning names of affected gadgets on that very wiki (with link to migration guide, plus mention that further user scripts might also be affected, plus maybe mention that it's not a bad idea to follow Tech News if this message was news to them)? Or is that technically too difficult, considered too spammy, not enough resources, ...?

(Ideally, folks should care about deprecation warnings and read Tech News. In practice, I'm not looking forward to the help calls from potentially frustrated members of numerous communities who did not care/read, when once upon a time random gadgets were copied over, with lack of tech maintenance knowledge nowadays.)

@Aklapper That would probably be worth doing, yes. I'll take a look on Monday.

@Aklapper Interesting to see Twinkle in the search results. The statistics for the deprecated method indicate it is rarely used (https://grafana.wikimedia.org/dashboard/db/mw-js-deprecate), which makes it surprising to see a match for Twinkle (a popular gadget).

Looking more closely, I figured out how Twinkle uses it with such low rate. While Twinkle is indeed a popular gadget, and even the latest version on en.wikipedia.org still references this method, Twinkle only uses jsMessage when the gadget itself has technical problems (to show the user an error message). If left unaddressed on one or more wikis, the impact would be that if the gadget is broken, the error would only be visible in the JavaScript console (instead of via a bubble on the page).

I believe in the course of user interaction, this would never be reached (which explains how it can be that jsMessage has, globally at WMF, less than 10 hits in Grafana per 24 hour period; compared to ~ 3,000 for importScriptURI and ~ 35,000 for wg-globals).

OK, if the number of hits in Grafana is less than 10 per 24 hours globally I won't make a big announcement everywhere, but I've still written on a number of talk pages relating to affected gadgets on different wikis and on technical Village Pumps of affected wikis that have those.

Change 430951 merged by jenkins-bot:
[mediawiki/core@master] mediawiki.util: Drop jsMessage(), deprecated since 1.20 and mostly unused

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

Krinkle updated the task description. (Show Details)