Page MenuHomePhabricator

Load the module mediawiki.page.watch.ajax only when there is a watch button on the page
Closed, ResolvedPublic

Description

Currently the module mediawiki.page.watch.ajax is loaded on all pages when the general preconditions are present. On pages without a watch button this module is useless.

For example:

Expected result: Load the module mediawiki.page.watch.ajax only when there is a watch button on the page.

Event Timeline

Fomafix claimed this task.
Fomafix raised the priority of this task from to Low.
Fomafix updated the task description. (Show Details)
Fomafix added a project: MediaWiki-General.
Fomafix subscribed.

Change 238131 had a related patch set uploaded (by Gerrit Patch Uploader):
Load the module mediawiki.page.watch.ajax only when required

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

Change 238131 merged by jenkins-bot:
Load the module mediawiki.page.watch.ajax only when needed

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

Verified on enwiki:

https://en.wikipedia.org/wiki/Special:WhatLinksHere:

mw.loader.getState( 'mediawiki.page.watch.ajax' ) // "registered"

https://en.wikipedia.org/wiki/Special:WhatLinksHere/Foo:

mw.loader.getState( 'mediawiki.page.watch.ajax' ) // "ready"