This project tracks the migration of Wikibase services to the MediaWiki service container.
Problem 1
Many classes which use Wikibase services (e.g. entity lookup, value formatters) need bespoke factory methods that rely on global state to inject those services (taken from the Wikibase{Repo,Client}::getDefaultInstance()).
Problem 2
WikibaseRepo and WikibaseClient have lots of boilerplate code to save and reuse certain service instances; many other services are not reused, and instead we create multiple copies of them for no good reason.
Who/what is suffering from the Problems?
- Wikibase seems to be the only extension with this nonstandard service pattern
- WikibaseLexeme and WikibaseQualityConstraints suffer from having to use these services from Wikibase, but don’t have such a singleton class themselves
- Something similar is probably true for MediaInfo
- Example of service usage being improved in WBQC
- In terms of people, mainly Wikibase developers working with the PHP backend are suffering
- MediaInfo Developers (WMF) might also be unhappy about having to use a non-standard way to access the Wikibase Services
Proposed solution
Move all Wikibase services to the MediaWiki service container (MediaWikiServices).
Prior work