Lucas_Werkmeister_WMDE added a comment.

  Hm, this is a bit trickier than I thought because `wikibase.common` is a 
style module loaded with `addModuleStyles()`, which has some additional 
restrictions (see docs 
<https://www.mediawiki.org/wiki/ResourceLoader/Developing_with_ResourceLoader#Style_modules>):
 the styles are directly referenced from the parser cached HTML (which may live 
for longer than a train deployment), and dependencies aren’t resolved. So we 
can’t just add a new “all targets” module and add it as a dependency of 
`wikibase.common`: the relevant `addModuleStyles()` calls (at least the one in 
`HtmlPageLinkRendererEndHookHandler`, I think) need to add the new module to 
the list of modules, and also, `wikibase.common` still needs to directly 
include the old styles at least until all the HTML that doesn’t load the new 
module has fallen out of the parser cache.
  
  However, the style reference in the parser cached HTML takes the form of a 
URL like `/w/load.php?lang=en&modules=...|wikibase.common|...` – it’s not 
referencing individual files in the module. So I think we can shuffle around 
the files inside the module definition as much as we want, and potentially 
include the same file from more than one module, and the worst that happens is 
that some styles are sent to the client twice. (I think.)
  
  So we could have modules like:
  
  - `wikibase.alltargets`
    - badges
    - language fallback indicators
    - other “really common” stuff
  - `wikibase.desktop` (or `wikibase.entityview`?)
    - everything else in `wikibase.less`
    - all the other files in `wikibase.common`: aliasesview, descriptionview, 
etc.
  - `wikibase.mobile`
    - unchanged
  - `wikibase.common`
    - badges
    - language fallback indicator
    - other “really common” stuff
    - everything else in `wikibase.less`
    - all the other files in `wikibase.common`: aliasesview, descriptionview, 
etc.
  
  This would effectively split the current `wikibase.common` module into styles 
that we want on all targets, and styles that we only want for the desktop 
entity view; but it would also keep `wikibase.common` around for now, with the 
same contents as before (effectively `wikibase.alltargets` + 
`wikibase.desktop`). We would update the code to emit the new modules instead 
of the old ones, and eventually all references to `wikibase.common` would fall 
out of the parser cache, at which point we could remove it from the 
ResourceLoader modules definition. Also, we could change several places that 
currently emit `wikibase.common`, but only need the “really common” stuff 
(especially language fallback indicators), to emit `wikibase.alltargets` but 
not `wikibase.desktop`: there’s no reason why, e.g. “undo” (T267502 
<https://phabricator.wikimedia.org/T267502>) or Special:NewLexeme (T322687 
<https://phabricator.wikimedia.org/T322687>) should need styles for 
aliasesview, descriptionview, etc., all of which are part of `wikibase.common` 
at the moment.
  
  But this seems like a bit too much of a change to do all at once, to be 
honest, even with the `wikibase.common` module kept for now…

TASK DETAIL
  https://phabricator.wikimedia.org/T325084

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Jdlrobson, Lucas_Werkmeister_WMDE, Aklapper, Astuthiodit_1, karapayneWMDE, 
Invadibot, maantietaja, ItamarWMDE, Akuckartz, Nandana, Lahi, Gq86, 
GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Scott_WUaS, 
Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org

Reply via email to