Repository navigation
Route component modules to the matching ResourceLoader queue - #126
Merged
Merged
Conversation
Follows-up to #80 Since #80, `onParserAfterParse` added every module of an active component to both queues. ResourceLoader accepts only styles-only modules in the styles queue, so the modules that also carry scripts (`modal.fix`, `carousel.fix`, `tooltip.fix`, `popover.fix`) logged `Unexpected general module "..." in styles queue.` on every page view using them. Add each module to the queue matching its ResourceLoader type instead. The browser receives the same as before: ResourceLoader skipped those modules in the styles queue, and they loaded through the general queue, where the hook also added them. Dropping the `addModuleStyles()` call would also silence the error, but the styles-only modules' CSS would then load through JavaScript: after first paint, and not at all without JavaScript. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
malberts
force-pushed
the
fix/route-modules-to-matching-queue
branch
from
October 8, 2026 14:16
40c2077 to
34047b3
Compare
malberts
marked this pull request as ready for review
October 8, 2026 14:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows-up to #80
Since #80,
onParserAfterParseadded every module of an active component to both queues. ResourceLoader accepts only styles-only modules in the styles queue, so the modules that also carry scripts (modal.fix,carousel.fix,tooltip.fix,popover.fix) loggedUnexpected general module "..." in styles queue.on every page view using them.Add each module to the queue matching its ResourceLoader type instead. The browser receives the same as before: ResourceLoader skipped those modules in the styles queue, and they loaded through the general queue, where the hook also added them.
Dropping the
addModuleStyles()call would also silence the error, but the styles-only modules' CSS would then load through JavaScript: after first paint, and not at all without JavaScript.Considered, omitted:
api.php?action=parseno longer lists those four modules undermodulestyles. Core's only consumer, live preview, loadsmodulesandmodulestylestogether, so nothing in core changes.Hooks/OutputPageParserOutputstill queues the styles-onlyext.bootstrapComponents.vector-fixthrough the general queue; that is a separate change.extension.jsonthrough the global ResourceLoader, so they fail ifbutton.fixstops being styles-only ormodal.fixloses its scripts. Decoupling them needs the code to receive its ResourceLoader instead of fetching the global one, a production refactor out of scope for this log fix.Production notes
The MW master CI leg fails four
ImageModalthumbnail tests because MediaWiki master now addsloading="lazy"to thumbnails;origin/masterfails that leg the same way. Earlier revisions of this PR were drafted withOpus 5 (1M context).