We may be able to migrate away from wgWBClientSettings entirely, and move to MediaWiki’s standard Config interface instead.
|· · ·|
|Resolved||Ladsgroup||T256228 Convert WikibaseClient to use extension registration|
|Resolved||Lucas_Werkmeister_WMDE||T256252 Migrate wgWBClientDataTypes + wgWBClientSettings loading out of Client PHP entry point|
|Resolved||Lucas_Werkmeister_WMDE||T256756 Remove $wgWBRepoDataTypes and $wgWBClientDataTypes global variables|
|· · ·|
At least $wgWBClientDataTypes is, as far as I can tell, not used externally – other extensions that add data types use the WikibaseClientDataTypes hook for that instead of manipulating the global directly, which is very nice. (Though I imagine we could also use attributes instead, if we wanted to.)
Edit: and the same seems to be true for $wgWBRepoDataTypes, so I would try to get rid of both of those globals at once – otherwise there’s some documentation like “$wgWBRepoDataTypes resp. $wgWBClientDataTypes” which we’d have to awkwardly rephrase because the two settings would work differently.
Decided to create a separate subtask for $wgWBClientDataTypes so it’s clearer that I’m not picking up the $wgWBClientSettings part (yet) – that’s still free for anyone else to pick up.
Edit: and apparently new subtasks don’t show up in the task activity (between the comments) anymore? anyways it’s T256756: Remove $wgWBRepoDataTypes and $wgWBClientDataTypes global variables
Change 608663 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] WIP: Don’t load $wgWBClientSettings in WikibaseClient.php
I quite like the appraoch. I wish we could rebuild the configs with config registry, it would have been awesome: https://www.mediawiki.org/wiki/Manual:Configuration_for_developers
But it's lot of work, specially since the Config object is immutable and our objects (SettingsArray) is not (which is not good, I don't want the configuration change dynamically at middle of code run).
Yeah, I don’t think using the config registry is feasible for this sprint. The most significant missing feature is probably lazy initialization of values – in Wikibase, a lot of the settings are callbacks that compute the setting on-demand, which isn’t supported by MediaWiki’s Config system as far as I’m aware.