Page MenuHomePhabricator

SpecialSearch warns regarding deprecated module "mediawiki.ui"
Closed, ResolvedPublic

Description

When logged into fawiki and looking at Special:Search I see this warning in the browser console:

This page is using the deprecated ResourceLoader module "mediawiki.ui".
Please use OOUI instead.

Unfortunately, clicking on the line number next to it does not take me to where this module is used, but to where the warning above is generated.

This doesn't happen on article pages. I made sure this account does not have any Gadgets or user scripts enabled. It is a brand new account.

Searching for mediawiki.ui in the MediaWiki namespace on fawiki returns no results. I am unable to find the root cause of the problem.

Event Timeline

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

@Krinkle I repeated your actions from T258199 and here are the answers to the same questions:

This happens both with Firefox and with Chrome. Screenshot of warning for https://fa.wikipedia.org/wiki/Special:Search?debug=true

image.png (32×947 px, 3 KB)

And what I get to when I click on the ...:530 link:

image.png (94×1 px, 10 KB)

Krinkle renamed this task from Warning regarding deprecated module "mediawiki.ui" on fawiki to SpecialSearch warns regarding deprecated module "mediawiki.ui".Jul 16 2020, 5:55 PM

This is one is queued by SpecialSearch.php.

@matmarex given your success with the other task, can I ask you to kindly take a look at this one too?

I totally misunderstood @Krinkle's comment until you repeated it!

The only actual use cases of mediawiki.ui that I can find, as it relates to Special:Search, are these two:

  • In resources/src/mediawiki.special.search.interwikiwidget.styles.less which references mediawiki.ui\variables.less. The only variable it actually uses is @colorGray15 (here) for the background color of the interwiki search results (that is the sister project results, see the screenshot below).
  • Vector (legacy skin) also references the variables.less file in resources/skins.vector.styles/SearchBox.less but I would argue that eliminating Vector's dependency on mediawiki.ui should be addressed in a separate task, because Vector may use it in other places too.

Going back to the first item, the interwiki one, what I don't know is how to do away with the dependency. The script is not loading mediawiki.ui for the sake of JS; it is only loading it for the sake of CSS. The grey background makes sense from a UI perspective so I don't think we should just eliminate it.


image.png (762×888 px, 235 KB)

@Huji The @import statement for mediawiki.ui/variables is not the cause of these deprecation warnings. That file is not deprecated, and is not part of the mediawiki.ui module.

I realize this is confusing, but that is how it is.

What is deprecated is not the mediawiki.ui import directory, but the mediawiki.ui module, as defined in Resources.php, and as loaded by the following PHP code:

SpecialSearch.php
		$out->addModuleStyles( [
			 'mediawiki.ui', 'mediawiki.ui.button',
			'mediawiki.ui.input', 
		] );

Re-using mediawiki.ui/variables internally within another module is fine. What we have deprecated is not the Less utilities for building styles, but rather the concrete class names and styles produced by the mediawiki.ui modules. In other words, the styles produced by src/mediawiki.ui/*. The importable Less utilities from /mediawiki.less/mediawiki.ui` are still stable and fine to use.

@Krinkle the explanation was helpful. But I am still unsure as to what is the correct solution for making the warning go away.

MPhamWMF subscribed.

Closing out low/est priority tasks over 6 months old with no activity within last 6 months in order to clean out the backlog of tickets we will not be addressing in the near term. Please feel free to reopen if you think a ticket is important, but bare in mind that given current priorities and resourcing, it is unlikely for the Search team to pick up these tasks for the indefinite future. We hope that the requested changes have either been addressed by or made irrelevant by work the team has done or is doing -- e.g. upgrading Elasticsearch to a newer version will solve various ES-related problems -- or will be subsumed by future work in a more generalized way.

This is actually important.

Hi !
I just want to add that if you open the Console on Main Page of the French Wikinews, you still get this error/warning :

VM41:1 This page is using the deprecated ResourceLoader module "mediawiki.ui".
Please use OOUI instead.

Is the problem patched ?

Change 963163 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Drop unused mediawiki ui styles

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

Change 963163 merged by jenkins-bot:

[mediawiki/core@master] SpecialSearch: Drop unused mediawiki ui styles

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

Volker_E claimed this task.