If you go to https://en.wikipedia.org/wiki/Book (for example) and inspect mw.config.values, you'll notice JS variables specific to Minerva and/or mobile in the console. These should not be exported outside the mobile domain AND/OR Minerva (unless you are using Minerva+Mobile domin).
Precursors / blockers
- It needs to be possible for onResourceLoaderGetConfigVars to access the current skin. https://gerrit.wikimedia.org/r/465667 should be merged.
Acceptance criteria / QA steps
- wgMinerva config variables show up on Minerva desktop (https://en.wikipedia.org?useskin=minerva)
- wgMinerva config variables show up on Minerva mobile
- wgMinerva config variables DO NOT show up on desktop Vector
- wgMF config variables DO NOT show up on desktop Vector
- wgMF config variables show up on mobile Vector (https://en.m.wikipedia.org?useskin=vector)
- wgMF config variables show up on mobile Timeless (https://en.m.wikipedia.org?useskin=vector)
- wgMF config variables show up on mobile Minerva (https://en.m.wikipedia.org?useskin=vector)
- Drop wgMFDescription from Minerva (unused)
Developer notes
Minerva
After navigating to Vector (desktop) and running the following, I see:
Object.keys(mw.config.values).filter((key)=>key.indexOf('Minerva' ) > -1) (3) ["wgMinervaABSamplingRate", "wgMinervaErrorLogSamplingRate", "wgMinervaReadOnly"]
Minerva variables should be limited to the Minerva skin.
Currently, all 3 of these variables are added via onResourceLoaderGetConfigVars hook. This doesn't appear to have access to the current skin. Per definition
"Called right before ResourceLoaderStartUpModule::getConfig returns, to set static (not request-specific) configuration variables. Can not depend on current page, current user or current request; see below."
MobileFrontend
Object.keys(mw.config.values).filter((key)=>key.indexOf('MF' ) > -1) (17) ["wgMFMobileFormatterHeadings", "wgMFSearchAPIParams", "wgMFQueryPropModules", "wgMFSearchGenerator", "wgMFNearbyEndpoint", "wgMFThumbnailSizes", "wgMFEditorOptions", "wgMFLicense", "wgMFSchemaEditSampleRate", "wgMFExperiments", "wgMFEnableJSConsoleRecruitment", "wgMFPhotoUploadEndpoint", "wgMFDeviceWidthTablet", "wgMFCollapseSectionsByDefault", "wgMFExpandAllSectionsUserOption", "wgMFEnableFontChanger", "wgMFDisplayWikibaseDescriptions"]
There are many more config variables in MobileFrontend. Many of them are are designed to only operate in mobile target mode (mobile domain) however some of them due to Minerva being a desktop and mobile skin need to be loaded on both (but limited to Minerva)
Modules added via onResourceLoaderGetConfigVars need to be restricted to where MobileContext->isMobileMode is true.
QA checklist
- Confirm Special:Nearby is still working
- Confirm Special:Uploads is still functioning
Sign off steps
- Confirm no Minerva variables on http://localhost:8888/w/index.php/Spain?useskin=vector&useformat=mobile
Object.keys( mw.config.values ).filter((key)=> key.indexOf( 'wgMinerva' ) > -1 ).length === 0
- Confirm no Minerva and no MobileFrontend variables on http://localhost:8888/w/index.php/Spain?useskin=vector&useformat=desktop
Object.keys( mw.config.values ).filter((key)=> key.indexOf( 'wgMF' ) > -1 || key.indexOf( 'wgMinerva' ) > -1 ).length === 0