The MobileApp extension registers two ResourceLoader modules (both styles-only) mobile.app and mobile.app.parsoid. However, as far as I can tell, these are never loaded - the only reference to them I can find is in the mobileapps service which says that since April 2019 (T220045) styles are being served from a compiled copy of the various extension styles that were included (this changed from making ResourceLoader requests). If there is a copy of the styles there, are they still needed in the extension? If not, I suggest removing them, because their existence increases the module registry size for everyone.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Stop defining unused ResourceLoader modules | mediawiki/extensions/MobileApp | master | +5 -17 |
Related Objects
Event Timeline
Just a note that the styles that appear in the MobileApp extension are still useful for apps. But as long as they keep getting served up by the content service (via https://meta.wikimedia.org/api/rest_v1/data/css/mobile/base), the apps themselves don't need them to be ResourceLoader modules.
@Dbrant As I understand it, our apps indeed only get CSS from this mobileapps service REST endpoint and not from the load.php modules defined in the MobileApps MW extension. However from your comment it sounds like maybe this REST endpoint still uses load.php internally. I believe Danny has interpreted the mobileapps service documentation to mean that it no longer uses load.php internally.
Can you confirm that this REST endpoint is not in any way backed by an internal load.php request that involves modules=.*(mobile.app|mobile.app.parsoid)? And thus that neither the service nor the mobile apps using the service would be impacted by the removal of the frontend resources in the MobileApp extension repository?
With regards to older version of the mobile app, would those be affected? Or did they discover the load.php URLs in a run-time fashion that was that updated without an app update? Or do we know those are sufficiently old/rare versions that they would either already not work due to other changes and/or otherwise are no longer a concern for Product?
Can you confirm that this REST endpoint is not in any way backed by an internal load.php request that involves modules=.*(mobile.app|mobile.app.parsoid)? And thus that neither the service nor the mobile apps using the service would be impacted by the removal of the frontend resources in the MobileApp extension repository?
This would need to be confirmed definitively by Product Infrastructure, but based on my reading of the service code, it no longer relies on ResourceLoader for the mobile.app content, and instead references .less files directly.
With regards to older version of the mobile app, would those be affected? Or did they discover the load.php URLs in a run-time fashion that was that updated without an app update? Or do we know those are sufficiently old/rare versions that they would either already not work due to other changes and/or otherwise are no longer a concern for Product?
This should no longer be a concern. Apps never used load.php directly on their own. Prior to switching to our current service architecture the apps were bundling a local payload of CSS that would get injected into the WebView.
We don't send any requests from the mobileapps service to ResourceLoader for modules=.*(mobile.app|mobile.app.parsoid).
From what I understand we only send for modules=site.styles.
Specifically this is the outgoing request to ResouceLoader:
{"name":"service-mobileapp-node","hostname":"nemoworld-wikimedia","pid":298953,"level":"TRACE","msg":"Outgoing MW API request","to":"https://en.wikipedia.org/w/load.php?modules=site.styles&only=styles&target=mobile&skin=minerva&lang=en","levelPath":"trace/mwLoadResourceLoaderModules","time":"2021-09-22T09:28:23.460Z","v":0}
Change 722897 had a related patch set uploaded (by DannyS712; author: DannyS712):
[mediawiki/extensions/MobileApp@master] Stop defining unused ResourceLoader modules
Change 722897 merged by jenkins-bot:
[mediawiki/extensions/MobileApp@master] Stop defining unused ResourceLoader modules