TLDR: Extensions can now listen to events emitted by MediaWiki
<https://www.mediawiki.org/wiki/Manual:Domain_events>.

Over the course of the fiscal year the MediaWiki Interfaces team has
introduced a system of Domain Events into MediaWiki. Domain Events provide
a new way for extensions and core components to be notified about changes
in other parts of the system, offering a more expressive and sustainable
alternative to hooks that were previously used for this purpose. The need
for this new capability was identified by a survey of hook usage we
conducted in the first quarter.

The work on the domain events system was conducted in close collaboration
with Data Platform Engineering with substantial support from the Growth
team and the Language team. These collaborations have proven immensely
valuable by allowing us to iterate on the design early on and fostered
knowledge sharing across the teams.

Our efforts have resulted in a simple yet powerful system that has already
proven effective in avoiding coupling between core components and reducing
the need for boiler plate code in extensions. The domain events framework
itself is part of the MediaWiki 1.44 release, but the event classes
themselves are still experimental. A set of events representing changes to
pages is scheduled to become part of MediaWiki’s stable interface in 1.45.

In the future, domain events will hopefully help to integrate MediaWiki
into an event-based architecture that enables data-backed features:
generalizing the mechanism for broadcasting events via Kafka that is
currently implemented in EventBus would make it much easier to inform other
processes about state changes in MediaWiki. But there is even more
potential in providing a simple mechanism for MediaWiki to receive events
from other services.

If you want to know more about the architecture of the event dispatcher,
the modeling of page changes as events, or about what we hope to do with
domain events in the future, have a look at the report published on
mediawiki.org
<https://www.mediawiki.org/wiki/Manual:Domain_events/Report_FY24-25>. If
you want to dive right in, best follow the examples on the manual page
<https://www.mediawiki.org/wiki/Manual:Domain_events>.
I'm very happy and proud of what we have achieved. I hope you like it too!
_______________________________________________
Wikitech-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/

Reply via email to