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 name | why |
| mobile.special.userlogin.scripts | This can be removed when mediawiki.special.userlogin.signup.js is enabled on mobile. This is captured in T211439.|
|mobile.special.mobilediff.scripts | entry point |
|mobile.special.mobileoptions.scripts | entry point |
|mobile.special.nearby.scripts | entry point |
|mobile.special.uploads.scripts | entry point |
|mobile.special.watchlist.scripts | entry point |
|mobile.init | entry point |
|mediawiki.template.hogan| shared module and imposed on us by mediawiki core |
|mobile.startup | shared module |
| mobile.mediaViewer | We currently split code by feature |
|mobile.languages.structured | We currently split code by feature |
| mobile.talk.overlays | We currently split code by feature |
| mobile.editor.overlay | We currently split code by feature |
| mobile.categories.overlays | We currently split code by feature |
| mobile.editor.ve | We currently split code by feature |
| mobile.notifications.overlay | We 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)
== Checklist
The following RL modules are now managed by webpack:
[x] mediawiki.template.hogan *
[] mobile.categories.overlays (T213472) *
[] mobile.editor.api (T213340)
[] mobile.editor.common (T213340)
[] mobile.editor.overlay (T213340) *
[] mobile.editor.ve (T213340)
[x] mobile.foreignApi (T212518)
[] mobile.gallery (T213298)
[] mobile.init (T213112) *
[x] mobile.languages.structured (T210210) *
[x] mobile.loggingSchemas
[] mobile.mediaViewer (T210209) *
[] mobile.messageBox (TBC_FEATURE_MEDIUM_1)
[] mobile.nearby (T213299)
[x] mobile.notifications.overlay (T213111) *
[x] mobile.pagelist.scripts
[x] mobile.references
[x] mobile.references.gateway
[x] mobile.scrollEndEventEmitter +
[x] mobile.search
[x] mobile.search.api
[x] 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) *
[x] mobile.startup *
[] mobile.talk.overlays (T213474) *
[] mobile.toc
[x] mobile.toggle
[x] mobile.watchlist (T212823)
[x] 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.)