Page MenuHomePhabricator

Update use of the deprecated "schema.UniversalLanguageSelector" module
Closed, ResolvedPublic

Description

Browser console always has warnings for

This page is using the deprecated ResourceLoader module "schema.UniversalLanguageSelector".
See https://phabricator.wikimedia.org/T205744 for migration info.

I think resolving this might be possible now (?) based on this task being marked as "done" T187207: Spin out a tiny EventLogging RL module for lightweight logging

See also T90184: ULS analytics schema update

Event Timeline

Quiddity created this task.Nov 15 2018, 7:17 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 15 2018, 7:17 PM

The task doesn't say from which version onwards the new method is available, and I am too lazy to dig it out right now. ULS has policy for supporting two stable mediawiki releases from master branch.

Krinkle renamed this task from Update the deprecated ResourceLoader module "schema.UniversalLanguageSelector" to Update use of the deprecated "schema.UniversalLanguageSelector" module.Nov 23 2018, 11:55 PM

@Nikerabbit See T205744 for details.

The recommended approach is using mw.track('event.<schema name'), which has isn't new (added in 2014 / REL1_23). If you switch to that, it will continue to be compatible all way from 1.23 to 1.33 and later.

The explicit approach of of loading ext.eventLogging and schema.* modules and then calling mw.eventLog.logEvent is deprecated as of last month, with a recommendation to use mw.track() if possible. And alternatively, to simply remove the schema.* dependency with other code remaining equal.

The old schema modules still exist as deprecated but empty shells, to be removed in the next release (maybe 1.33?).

For Translate/ULS this means you'd have to either follow MLEB's usual version-detection route to support 1.33 and 1.31 with different logic. Alternatively, if we can simplify it to only calling mw.track(), then it would remain free of version-detection.

While working on T187207 and T205744, I've audited most if not all in-MediaWiki uses of EventLogging at WMF, and believe all can be migrated to mw.track() with little to no effort. I've only kept mw.eventLog.logEvent because we need it internally, and so we might as well keep it public. I believe the main reason this method is still used is because mw.track() was introduced in 2014 – two years after EventLogging became a thing - it wasn't a choice.

Thanks for the clarification. mw.track() looks like a viable alternative.

Krinkle claimed this task.Feb 16 2019, 10:59 PM

Change 491016 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/UniversalLanguageSelector@master] ext.uls.eventlogger: Avoid deprecated schema module on MW 1.33+

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

Krinkle triaged this task as Normal priority.Feb 17 2019, 12:52 AM

Change 491016 merged by jenkins-bot:
[mediawiki/extensions/UniversalLanguageSelector@master] ext.uls.eventlogger: Avoid deprecated schema module on MW 1.33+

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

Krinkle closed this task as Resolved.Feb 18 2019, 2:05 PM
Krinkle removed a project: Patch-For-Review.