Page MenuHomePhabricator

[EPIC] Reduce the amount of modules in MobileFrontend
Closed, ResolvedPublic

Description

Per T194098, the more RL modules there are, the larger the startup module, the slower performance, so we want to minimise this.

MobileFrontend currently has 58 resource loader modules.
If we ignore style/image-only modules we are left with 32 modules in Mobilefrontend alone.
Many of these relate to client side code which has been working around the lack of a module loading system.

We should aim to reduce the amount of these modules. Note: the goal is not to remove all of them, but reduce the list as much as we possibly can.

Modules that will not be removed from MobileFrontend (and why!)

module namewhy
mobile.special.userlogin.scriptsThis can be removed when mediawiki.special.userlogin.signup.js is enabled on mobile. This is captured in T211439.
mobile.special.mobilediff.scriptsentry point
mobile.special.mobileoptions.scriptsentry point
mobile.special.nearby.scriptsentry point
mobile.special.uploads.scriptsentry point
mobile.special.watchlist.scriptsentry point
mobile.initentry point
mediawiki.template.hoganshared module and imposed on us by mediawiki core
mobile.startupshared module
mobile.mediaViewerWe currently split code by feature
mobile.languages.structuredWe currently split code by feature
mobile.talk.overlaysWe currently split code by feature
mobile.editor.overlayWe currently split code by feature
mobile.categories.overlaysWe currently split code by feature
mobile.editor.veWe currently split code by feature
mobile.notifications.overlayWe currently split code by feature

Acceptance criteria

  • All subtasks are resolved (not stalled, not open)
  • Code relating to features is clearly identifiable and intuitive
  • Special page code e.g. mobile.special.watchlist.scripts is only loaded on the special page that needs it
  • Categories, image overlay, language talk and editor code continues to be lazy loaded and is not part of the initial webpack bundle
  • At most 16 of the initial 32 modules remain (50%) - (estimate is made by looking at dependency tree and seeing what needs what)

there were 57 ResourceLoader modules residing MobileFrontend. 24 ResourceLoader modules were removed in the project leaving 34. This estimate was a rough estimate and based on a number (32) which seems incorrect.

Checklist

The following RL modules are now managed by webpack:

  • mediawiki.template.hogan *
  • mobile.categories.overlays (T213472) *
  • mobile.editor.api (T213340)
  • mobile.editor.common (T213340)
  • mobile.editor.overlay (T213340) *
  • mobile.editor.ve (T213340)
  • mobile.editor (T213340)
  • mobile.foreignApi (T212518)
  • mobile.gallery (T213298)
  • mobile.init (T213112) *
  • mobile.languages.structured (T210210) *
  • mobile.loggingSchemas
  • mobile.mediaViewer (T210209) *
  • mobile.messageBox (TBC_FEATURE_MEDIUM_1)
  • mobile.nearby (T213299)
  • mobile.notifications.overlay (T213111) *
  • mobile.pagelist.scripts
  • mobile.references
  • mobile.references.gateway
  • mobile.scrollEndEventEmitter +
  • mobile.search
  • mobile.search.api
  • mobile.search.util
  • mobile.special.userlogin.scripts (T213112)
  • mobile.special.mobilediff.scripts (T213112) *
  • mobile.special.mobileoptions.scripts (T213112) *
  • mobile.special.nearby.scripts (T213299) *
  • mobile.special.uploads.scripts (T213298) *
  • mobile.special.watchlist.scripts (T212823) *
  • mobile.startup *
  • mobile.talk.overlays (T213474) *
  • mobile.toc
  • mobile.toggle
  • mobile.watchlist (T212823)
  • mobile.watchstar

( RL modules marked with * are unlikely to be removed as part of this epic given their role as an entry point for code splitting purposes - see table above)
( + The mobile.scrollEndEventEmitter module is interesting - it is shared by a special page and a feature. We may want to consider moving this into mobile.startup or splitting code in a different way.)

sign off steps

  • Document how many RL modules have disappeared.
  • document number of bytes changed

Related Objects

StatusAssignedTask
OpenNone
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedJdlrobson
Resolved Niedzielski
Resolved Niedzielski
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedNone
Resolved Niedzielski
ResolvedJdrewniak
ResolvedJdrewniak
ResolvedJdrewniak
ResolvedNone
ResolvedJdrewniak
ResolvedNone
ResolvedJdrewniak
ResolvedJdrewniak

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 23 2018, 7:56 PM
Jdlrobson updated the task description. (Show Details)Oct 23 2018, 8:04 PM
Jdlrobson updated the task description. (Show Details)Oct 23 2018, 11:20 PM
Jdlrobson updated the task description. (Show Details)Dec 21 2018, 7:38 PM
Jdlrobson updated the task description. (Show Details)Jan 3 2019, 12:34 AM
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)Jan 3 2019, 9:40 PM
Jdlrobson updated the task description. (Show Details)Jan 3 2019, 10:46 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)Jan 3 2019, 10:54 PM
Jdlrobson triaged this task as High priority.Jan 7 2019, 8:09 PM
Jdlrobson updated the task description. (Show Details)Jan 7 2019, 8:14 PM
Jdlrobson updated the task description. (Show Details)Jan 8 2019, 2:39 AM
Jdlrobson updated the task description. (Show Details)Jan 9 2019, 4:03 PM
Jdlrobson updated the task description. (Show Details)

Change 483200 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] VisualEditorOverlay code is merged with EditorOverlay

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

Jdlrobson updated the task description. (Show Details)Jan 9 2019, 9:15 PM
Jdlrobson updated the task description. (Show Details)Jan 10 2019, 7:38 PM

Change 483639 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] TableOfContents bundled in mobile.startup

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

Change 483639 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] TableOfContents bundled in mobile.startup

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

Jdlrobson updated the task description. (Show Details)Jan 16 2019, 3:16 PM
Jdlrobson updated the task description. (Show Details)Jan 18 2019, 12:54 AM

Change 483200 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] VisualEditorOverlay View code is merged with EditorOverlay

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

Jdlrobson updated the task description. (Show Details)Jan 23 2019, 9:42 PM
Jdlrobson updated the task description. (Show Details)Jan 24 2019, 2:08 AM
Jdlrobson removed a project: Patch-For-Review.
phuedx added a subscriber: phuedx.Feb 5 2019, 6:08 PM
Jdlrobson updated the task description. (Show Details)Feb 12 2019, 12:40 AM

Document how many RL modules have disappeared.

At the start of the project (commit d518689) there were 57 ResourceLoader modules insiding MobileFrontend. 24 ResourceLoader modules were removed in the project leaving 34.
See also: https://www.mediawiki.org/wiki/Reading/Web/Projects/Invest_in_the_MobileFrontend_&_MinervaNeue_frontend_architecture/Progress#Outcomes_2

document number of bytes changed

See https://www.mediawiki.org/wiki/Reading/Web/Projects/Invest_in_the_MobileFrontend_&_MinervaNeue_frontend_architecture/Progress#Impact_on_bytes_shipped

Jdlrobson updated the task description. (Show Details)Feb 12 2019, 12:41 AM
Jdlrobson updated the task description. (Show Details)

Jdlrobson removed a subtask: T208915: MobileFrontend modules: Cleanup some deprecation calls.

This is not a blocker to resolving this.

Jdlrobson closed this task as Resolved.Feb 12 2019, 12:43 AM

Hurrah! This is done. See https://phabricator.wikimedia.org/T195475#4946011 for a write up!