Page MenuHomePhabricator

Ship `mediawiki.action.edit.watchlistExpiry.js` code with mediawiki.action.edit bundle
Closed, ResolvedPublic

Description

When the expiring watchlist feature initially launched, a new module bundle entry point was created just for these few lines of code:

mediawiki.action.edit.watchlistExpiry
watchThisWidget = OO.ui.infuse( watchThisNode );
expiryWidget = OO.ui.infuse( expiryNode );

expiryWidget.setDisabled( !watchThisWidget.isSelected() );

watchThisWidget.on( 'change', function ( enabled ) {
	expiryWidget.setDisabled( !enabled );
} );

This seems a bit excessive and counter the recommended practices and guidelines for performance; which aims for bundles to ship all code relevant to that particular user experience unless bundle splitting is beneficial for performance (e.g. more startup payload, more frequent roundtrips, and more often late-loading code, in exchange for more gradunlar payloads upfront).

Since these few lines of code are written for and needed by EditPage, which has its various internal features bundled in mediawiki.action.edit, we should try to ship these there as well.

Event Timeline

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

Change 663910 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] mediawiki.action.edit: Set desktop/mobile target

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

Change 663911 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] mediawiki.action.edit: Fold watchlistExpiry.js into this module

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

Change 663912 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] mediawiki.action.edit: Avoid jQuery objects in watchlistExpiry.js

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

Change 663910 merged by jenkins-bot:
[mediawiki/core@master] mediawiki.action.edit: Set desktop/mobile target

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

Change 663911 merged by jenkins-bot:
[mediawiki/core@master] mediawiki.action.edit: Fold watchlistExpiry.js into this module

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

Change 663912 merged by jenkins-bot:
[mediawiki/core@master] mediawiki.action.edit: Avoid jQuery objects in watchlistExpiry.js

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

@Krinkle thank you for flagging and taking care of this.

Krinkle claimed this task.
Krinkle triaged this task as Medium priority.