-
-
Notifications
You must be signed in to change notification settings - Fork 83
Description
ResourceLoader::makeConfigSetScript was deprecated in MediaWiki 1.44 and will soon be removed in master for MediaWiki 1.45-alpha.
It seems SemanticMediaWiki is using static functions to accept various bits of frontend related to modules and config variables, which a MediaWiki extension would normally add directly to ParserOutput or OutputPage. The appropiate ParserOutput or OutputPage object should already be available to the code calling these static functions, e.g. if the source is a parser function or extension tag while wikitext is being parsed and cached, it will have access to the Parser and its ParserOutput object. Or otherwise, if the source is a skin hook or other runtime addition executed personally on each pageview, it will have access to a RequestContext context and its OutputPage object.
As a first step, it might make sense to improve the existing SMWOutputs mechanism to add native support support for config vars, like it already does for modules via ::requireResource and ::requireStyle. Then, the SRFUtils and ResourceFormatter classes can call a new SMWOutputs::setJsConfigVar(array) method, instead of SMWOutputs::requireHeadItem(…, RL::makeInlineScript(RL::makeConfigSetScript(array))). The code that consumes the SMWOutputs recepticle, such as in SMWOutputs::commitToParser, can use ParserOutput->setJsConfigVar() to pass the data along, and let MediaWiki core add this to the head script without needing to produce your own inline scripts.