Page MenuHomePhabricator

Limit mobile.startup's mw.config variables to only pages that use mobile.startup ResourceLoader module
Closed, ResolvedPublic5 Estimated Story Points

Description

Spawned out of T186062
The problem: Many config variables are shipped from MobileFrontend unnecessarily to desktop Vector. They are needed by Minerva operating in both desktop and mobile mode.

These are:
*wgMFMobileFormatterHeadings

  • wgMFSearchAPIParams
  • wgMFQueryPropModules
  • wgMFSearchGenerator
  • wgMFThumbnailSizes
  • wgMFEditorOptions
  • wgMFUsePreferredEditor
  • wgMFLicense
  • wgMFSchemaSearchSampleRate
  • wgMFExperiments
  • wgMFEnableJSConsoleRecruitment
  • wgMFDeviceWidthTablet
  • wgMFCollapseSectionsByDefault
  • wgMFContentProviderScriptPath
  • wgMFIsPageContentModelEditable
  • wgMFEnableFontChanger
  • wgMFDisplayWikibaseDescriptions

Developer notes

  • wgMFIsPageContentModelEditable is used by mobile.init so only should be loaded on mobile pages. Moving this inside a $context->shouldDisplayMobileView()
  • wgMFEnableFontChanger is only used by SpecialMobileOptions so should be moved there
  • The rest, with the exception of wgMFDisplayWikibaseDescriptions can be easily be moved to ResourceLoader as that requires knowledge of the current user. Will defer to Timo if there is a solution for this specific config variable.

Acceptance criteria

With the exception of '''wgMFDisplayWikibaseDescriptions'''

Sign off steps

With the exception of '''wgMFDisplayWikibaseDescriptions''' confirm no MobileFrontend variables on http://localhost:8888/w/index.php/Spain?useskin=vector&useformat=desktop

Object.keys(mw.config.values).filter((key)=>key.indexOf('MF' ) > -1)

Event Timeline

Change 492369 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Don't ship MF prefixed variables to Vector desktop

https://gerrit.wikimedia.org/r/492369

Jdlrobson renamed this task from Limit mobile.startup variables to pages using mobile.startup ResourceLoader module to Limit mobile.startup's mw.config variables to only pages that use mobile.startup ResourceLoader module.Feb 25 2019, 9:05 PM
Jdlrobson set the point value for this task to 5.Feb 27 2019, 5:52 PM

Change 492369 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Don't ship MF prefixed variables to Vector desktop

https://gerrit.wikimedia.org/r/492369

Needs QA but I can QA this as this is very developer centric.

Jdlrobson updated the task description. (Show Details)

This is working as expected.