Page MenuHomePhabricator

Remove unused module `jquery.hoverIntent`
Closed, ResolvedPublic

Description

The module jquery.hoverIntent is never loaded or referred to (codesearch). As a result, it is unneeded and should be removed to reduce the module registry size on all page views.

This supersedes T190489: Update jquery.hoverIntent plugin in MediaWiki core

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 807641 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] Remove unused module `jquery.hoverIntent`

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

Change 808956 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] Deprecate `jquery.hoverIntent` resourceloader module

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

There is on-wiki use however, so we should at least allow for some migration and possibly deprecation.

https://global-search.toolforge.org/?q=%5C.hoverIntent&namespaces=2%2C4%2C8&title=%28Gadgets-definition%7C.*%5C.%28js%7Ccss%7Cjson%29%29

Okay, added a patch to deprecate it first

@DannyS712 Thanks. I propose the following:

  • Let's list in this task and audit which gadgets use the module currently. Take note that in some cases, gadgets are using a hoverIntent() functioned defined by themselves (or a local copy of hoverIntent.js on the same wiki). To know which one it is, check the mw.loader.using() call or Gadgets-definition to see if it is loading jquery.hoverIntent or e.g. depending on something like Gadget-hoverIntent.js instead. The latter is fine and will keep working.
  • If we find there is more than 2 gadgets, I suggest we also add an entry to https://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_(users) with a recommendation for how to migrate, and then copy that same message to Tech-News (by using User-notice on this task).
  • Let the deprecation ride the train this week.
  • Keep deprecated for two train branches (including this week's one).
  • Remove after that, including release notes.
Krinkle triaged this task as Medium priority.Jun 28 2022, 4:27 AM
Krinkle edited projects, added Performance-Team (Radar); removed Performance-Team.
Krinkle moved this task from Inbox to Accepted Enhancement on the MediaWiki-ResourceLoader board.
Krinkle moved this task from Limbo to Perf recommendation on the Performance-Team (Radar) board.

Change 808956 merged by jenkins-bot:

[mediawiki/core@master] Deprecate `jquery.hoverIntent` resourceloader module

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

@DannyS712 Thanks. I propose the following:

  • Let's list in this task and audit which gadgets use the module currently. Take note that in some cases, gadgets are using a hoverIntent() functioned defined by themselves (or a local copy of hoverIntent.js on the same wiki). To know which one it is, check the mw.loader.using() call or Gadgets-definition to see if it is loading jquery.hoverIntent or e.g. depending on something like Gadget-hoverIntent.js instead. The latter is fine and will keep working.
  • If we find there is more than 2 gadgets, I suggest we also add an entry to https://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_(users) with a recommendation for how to migrate, and then copy that same message to Tech-News (by using User-notice on this task).

From the global search, I see

ar.wikipediaميدياويكي:Gadget-superfish.jscheck
commons.wikimediaUser:Brandybradham/common.jsload
hu.wikipediaMediaWiki:Gadgets-definitionload
hu.wikipediaMediaWiki:Gadget-superfish.jscheck
it.wikisourceUtente:Alex brollo/common old.jscommented out
pl.wikinewsMediaWiki:Gadget-GallerySlideshow.jsload
ur.wikipediaمیڈیاویکی:Gadget-superfish.jscheck
ur.wikipediaمیڈیاویکی:Gadget-GallerySlideshow.jsload
ur.wikipediaمیڈیاویکی:Gadget-hoverintent.jsdefines custom $.fn.hoverIntent
ar.wikipediaميدياويكي:Gadget-hoverintent.jsdefines custom $.fn.hoverIntent
de.wikipediaBenutzer:Prüm/monobook.jsload
en.wiktionaryUser:So9q/jquery.hoverIntent.min.jsdefine custom $.fn.hoverIntent
hu.wikipediaMediaWiki:Gadget-hoverintent.jsdefine custom $.fn.hoverIntent
commons.wikimediaMediaWiki:Gadget-GallerySlideshow.jsload
commons.wikimediaUser:SunAfterRain/GallerySlideshow.jsload
fi.wikipediaJärjestelmäviesti:Gadget-GallerySlideshow.jsload
de.wikipediaBenutzer:Schnark/js/popups-light.jsload
commons.wikimediaMediaWiki:FileContentsByBot.jsload
en.wikipediaUser:Vivvt/galleryZoomHover.jsload

Where "check" means that a script checks if $.fn.hoverIntent is available and if so tries to use it, but does not load it directly (including gadgets that depend on the module but still check if its available before using it) and "load" means that the module is loaded and used

Given the number of scripts that try to load the module, I think the migration guide and tech news notice are warranted

@Krinkle Hiyo. IIUC, this means it is (almost) ready for inclusion in Tech News? Please could you suggest some wording to use (1–3 short and simple sentences), and tell me when exactly you'd want it included (presumably in the "Future changes" section, in either the imminent edition (frozen tomorrow) or subsequent edition). Thanks!

@Krinkle or @DannyS712 Please see my 2 questions above. -- I need to know what/when to write in Tech News. (Or you can add it directly, within the next ~22 hours, if you want it in Monday's edition). Thanks!

Change 807641 merged by jenkins-bot:

[mediawiki/core@master] Remove unused module `jquery.hoverIntent`

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

@Quiddity This will go out next week. I suggest something like this:

The deprecated jquery.hoverIntent module has been removed. This module could be used by gadgets and user scripts, to create an artifical delay in how JavaScript responds to a hover event. Gadgets should now use jQuery hover() or on() instead. Examples can be found in the migration guide. (T311194)

Or perhaps:

The jquery.hoverIntent can be used to create an artifical delay in how JavaScript responds to a "hover" event. This module has been deprecated and removed. Gadgets and user scripts should now use jQuery hover() or on() instead. Examples can be found in the migration guide. (T311194)

Probably best to fix https://translatewiki.net/wiki/MediaWiki:Gadget-HoverPopTools.js on translatewiki.net ASAP if anyone’s up for it.

Done (kinda). I replaced it with (so far) uglier CSS-only solution.

I'm sorry that I haven't handled this task. I recently returned from a long bout of unexpected inactivity, and while I plan to resume my contributions here on Phabricator its unfair to claim tasks that I might not work on when others may be interested in handling them. I'm removing myself as the assignee in a batch-action, but if someone feels that I really should be the one to handle this task feel free to re-assign me and I'll take a look.