The module `mediawiki.page.ready` makes certain assumptions on behalf of a skin.
It enables "collapsible" elements, sortable tables and progressively enhances search.
Given the new Vector will use a new search implementation in Vue and given Minerva disables this module to workaround design challenges with sortable tables and collapsible elements (T111565 and T233340) this setup should be a skinScript that a skin can override.
This would unblock T233676 as well as integrating new search into Vue.js
= Acceptance criteria
[] It's possible for Vector to replace the module loaded for search
[] It's possible for Minerva to load `mediawiki.page.ready` with sortable tables and collapsible disabled
= Developer notes
After talking with @Catrope mw.config can be used to achieve the desired effect and use MakeGlobalVariablesScript to override those values or following the example of the hook ResourceLoaderJqueryMsgModuleMagicWord. In the latter example we may want to create a generalised hook and deprecate ResourceLoaderJqueryMsgModuleMagicWord to use it.
== Proposed implementation
[x] mediawiki.page.ready includes a configuration JSON config.json that is virtually imported. See module mediawiki.jqueryMsg for an example.
[x] The JSON has a key `search-module` which defaults to `mediawiki.searchSuggest`.
[x] The file resources/src/mediawiki.page.ready/ready.js requires the virtual config (`require( './config.json')` ) and passes the value of search-module to mw.loader replacing the line `mw.loader.load( 'mediawiki.searchSuggest' );`
[x] A hook is executed ResourceLoaderPageReadyConfig (see ResourceLoaderJqueryMsgModuleMagicWord for an example) that allows skins/extensions to update the configuration values.
## Minerva work
Once the above is done, work is needed in preparation for T257265:
[x] The JSON should have a key `collapsible` which defaults to true.
[x] The JSON should have a key `sortable` which defaults to true.
[x] The code `mw.hook( 'wikipage.content' )` should consult these values and only load and execute sortable/collapsible code if the configuration is true
[x] Both variables can be modifed by the new hook ResourceLoaderPageReadyConfig
# Sign off steps
[] Update T257265