Page MenuHomePhabricator

Remove context.js
Closed, ResolvedPublic

Description

context.js doesn't seem very useful and could be replaced with a one-liner:

context.js
/**
 * Mobile mode helper class
 *
 * @class context
 * @singleton
 */
module.exports = {
	/**
	 * Gets current mobile mode
	 * @memberof context
	 * @instance
	 * @return {string|null} Name of mode - either `stable` or `beta`. It is `null` if desktop.
	 */
	getMode: function () {
		return mw.config.get( 'wgMFMode' );
	}
};

Acceptance criteria

  • context.js is removed
  • context.js references are updated to use mw.config.get( 'wgMFMode' ) directly

Event Timeline

Jdlrobson triaged this task as Medium priority.Jul 25 2019, 12:37 AM

Change 539844 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/extensions/MobileFrontend@master] Remove context.js from MobileFrontend

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

Change 539844 abandoned by Ammarpad:
Remove context.js from MobileFrontend

Reason:
Will try it in new commit

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

Change 542434 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/extensions/MobileFrontend@master] Remove context.js from MobileFrontend

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

Change 542434 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Remove context.js from MobileFrontend

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

Jdlrobson claimed this task.
Jdlrobson added subscribers: Ammarpad, Jdlrobson.

Thanks for taking care of this one @Ammarpad !