https://bugzilla.wikimedia.org/show_bug.cgi?id=44070
Web browser: ---
Bug ID: 44070
Summary: Dynamically loading SpecialPage ResourceLoader modules
causes unnecessary processing on ALL requests
Product: MediaWiki extensions
Version: master
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: MobileFrontend
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
Classification: Unclassified
Mobile Platform: ---
Changesets https://gerrit.wikimedia.org/r/#/c/43979/ and
https://gerrit.wikimedia.org/r/#/c/44442/ introduce changes that make mobile
ResourceLoader modules for SpecialPages get dynamically defined. This is neat,
however the current implementation in master
(https://gerrit.wikimedia.org/r/#/c/44442/) makes it so that the modules get
defined on EVERY request, including API requests, which adds unnecessary
overhead.
We initially attempted to have the processing happen ONLY inside of the
invocation of the ResourceLoaderRegisterModules hook, which works in
MobileFrontend alpha/beta, but not in production. There are a couple of reasons
for this:
1) The ResourceLoaderRegisterModules hook runs AFTER
SkinMobile::attachAdditionalPageResources() attaches resources (when RL is not
fully in use, eg in production). You can try to get around that by forcing the
hook to run by calling OutputPage::getResourceLoader() in
SkinMobile::attachAdditionalPageResources(), but that bumps into another
problem:
2) using $resourceLoader->registerModule() in an invocation of the
ResourceLoaderRegisterModules hook appears to not work properly for modules
that need to be loaded at the bottom of the page. I'll be filing a separate bug
for that.
We should get this fixed sooner rather than later. A few options I can think
of:
* Fix #2 above
* Add a hook in SkinMobile to dynamically load last-minute modules into
$wgResourceModules (this is ugly, but would go away once we resolve
https://bugzilla.wikimedia.org/show_bug.cgi?id=41340)
--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l