Page MenuHomePhabricator

Remove magic module loading of "mediawiki.messagePoster"
Open, Needs TriagePublic

Description

This extension support for this core feature currently depends on the explicit creation of a module dedicated to a single subclass. This should be avoided in favour of either having an explicit registry (where an extension may point to a larger module that provides it), or by removing it in favour of requiring the caller to have loaded it already.

Given this is only used in one extension, I'm recommending the latter

Event Timeline

Krinkle created this task.Oct 12 2019, 2:32 AM
Restricted Application added a project: Growth-Team. · View Herald TranscriptOct 12 2019, 2:32 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 542646 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] mediawiki.messagePoster: Allow upfront registering without separate module

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

Change 542647 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] mediawiki.messagePoster: Add WikitextMessagePoster to its bundle

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

Hm.. So Flow doesn't actually make use of mediawiki.messagePoster.flow-board. Rather it's defining the handler for other code. I guess this is more similar to VE plugins and would be better solved not only by bundling the core ones, but the extension one as well.

Change 542655 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] mediawiki.messagePoster: Introduce 'MessagePosterModule' extension attribute

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

Change 542656 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Flow@master] Use new 'MessagePosterModule' attribute instead of separate module

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

Change 542657 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] mediawiki.messagePoster: Remove support for lazy-loading message posters

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

A similar pattern is used for 'mediawiki.ForeignApi', you might want to have a look at it too.

Change 542646 merged by jenkins-bot:
[mediawiki/core@master] mediawiki.messagePoster: Allow upfront registering without separate module

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

Change 542647 merged by jenkins-bot:
[mediawiki/core@master] mediawiki.messagePoster: Add WikitextMessagePoster to its bundle

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

Change 542655 merged by jenkins-bot:
[mediawiki/core@master] mediawiki.messagePoster: Introduce 'MessagePosterModule' extension attribute

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

Change 542656 merged by jenkins-bot:
[mediawiki/extensions/Flow@master] Use new 'MessagePosterModule' attribute instead of separate module

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

Change 542657 merged by jenkins-bot:
[mediawiki/core@master] mediawiki.messagePoster: Remove support for lazy-loading message posters

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