Page MenuHomePhabricator

This page is using the deprecated ResourceLoader module "es5-shim" on Special:CX(Stats)
Closed, ResolvedPublic

Description

On master, e.g. https://en.wikipedia.beta.wmflabs.org/wiki/Special:ContentTranslationStats I see this message in the debug console:

This page is using the deprecated ResourceLoader module "es5-shim".
Use of the "es5-shim" module is deprecated since MediaWiki 1.29.0

It cannot come from the ContentTranslation extensions. It is unlikely that it comes from ULS either. So I don't know where it comes from. The message does not appear in debug mode. This might be caused by the fact that we override the skin for CX special pages. Need help to figure out the real cause.

Event Timeline

@Nikerabbit I can't reproduce it when I view that page.

The message means that one or more modules loaded on this page has a direct or indirect dependency on es5-shim which is a no-op in MediaWiki 1.29.0. This is similar to how json was deprecated in the previous release cycle.

If you see it again, could you report the return value of running the below code snippet?

findAll('es5-shim');

/**
 * @source https://meta.wikimedia.org/wiki/User:Krinkle/global.js
 */
function findAll(needle) {
	var depth = 0;
	var seen = [];
	var ret = [];
	var prev;
	var results;
	function find(needle) {
		return mw.loader.getModuleNames().filter(function (moduleName) {
			var obj = mw.loader.moduleRegistry[moduleName];
			return moduleName !== needle && obj.state == 'ready' && (
				obj.dependencies.indexOf(needle) !== -1 ||
				( obj.script && obj.script.toString().indexOf(needle) !== -1 ));
		});
	}
	while (depth < 3) {
		depth++;
		if (!prev) {
			results = find(needle);
			ret.push(results);
			seen.push.apply(seen, results);
		} else {
			results = [];
			prev.slice().forEach(function (result) {
				var subResults = find(result).filter(function (item) {
					return seen.indexOf(item) === -1;
				});
				results.push.apply(results, subResults);
				seen.push.apply(seen, subResults);
			});
			ret.push(results);
		}
		prev = results;
	}
	return ret;
};

Okay, I was wrong. It is ULS ext.uls.compactlinks after all. Makes me wonder if we could avoid loading it on pages which certainly don't have language links.

@Nikerabbit Loading less code is always nice, but for now can we just remove es5-shim from its dependencies list? It is a no-op now, and having the warning in prod isn't nice :)

@Krinkle It doesn't fit with MLEB's release policy. Ideally we should wait until 1.30 is released, but at lest until 1.29 is released. Alternatively, make the inclusion of the shim conditional.

The main problem is that MLEB's "release policy" doesn't fit with Wikimedia's. I'd say the onus is on the team to fix their policy.

@Krinkle It doesn't fit with MLEB's release policy. Ideally we should wait until 1.30 is released, but at lest until 1.29 is released. Alternatively, make the inclusion of the shim conditional.

MLEB's policy is to support the lasts two stable releases. Wikimedia's policy for MediaWiki core is no different (per https://www.mediawiki.org/wiki/Version_lifecycle). If anything, MLEB's is easier! (Given WMF also supports an additional legacy LTS every third year, up until yesterday, this was 1.23)

MLEB is currently provided as a single downloadable bundle, instead of offering separate downloads for both target releases. Thus, essentially trading the cost of creating releases and back-porting commits, in favour of technical debt as result of conditional code that, sometimes, is inevitably less pretty.

I don't think one is necessarily better than the other. Both are respectable solutions to the problem of back-compat, both come with a cost. The current approach is fine by me.

However, with the current policy, I expect that conditional commits are desired, wanted, and preferred by maintainers of these extensions. Not a compromise we have to make every time. So, let's do this?

Change 351196 had a related patch set uploaded (by Krinkle; owner: Jforrester):
[mediawiki/extensions/UniversalLanguageSelector@master] extension.json: Remove no-op dependency on deprecated es5-shim module

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

Krinkle triaged this task as Medium priority.May 2 2017, 5:50 AM

Change 351196 merged by jenkins-bot:
[mediawiki/extensions/UniversalLanguageSelector@master] extension.json: Remove no-op dependency on deprecated es5-shim module

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