https://bugzilla.wikimedia.org/show_bug.cgi?id=61577

            Bug ID: 61577
           Summary: OutputPage::addModuleStyles should support module
                    dependencies
           Product: MediaWiki
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Skin and page rendering
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: krinklem...@gmail.com
                CC: krinklem...@gmail.com, matma....@gmail.com
       Web browser: ---
   Mobile Platform: ---

(There was no bug yet for "addModuleStyles should support dependencies" - which
I've commonly said is WONTFIX, so I'll put it here so I can refer to it)

Just semantics, but there is no case of ResourceLoader not being able to handle
skin css dependencies. It is impossible by design due to restrictions outside
ResourceLoader.

Some of these restrictions are:
 1) Skin css can't require javascript, which means we can't just list the top
level modules and handle dependencies client-side, we'd have to flatten and
hardcode dependencies in the page html <link> tag

 2) page html must not be required to change for things not to break, cached
page html must continue to work. This means:

 2a) version can't be in page html,
 2b) This can't work because if a dependency is added or things moved into a
lower-level module, then all existing page cache will be broken as it would now
have a <link> that soon  generates an incomplete stylesheet where a dependency
is missing.


Possible solutions involve ESI, which is fine for enhancement (we can make the
<link> tag contain a version number that way for better caching), but we don't
want to depend on it for proper functionality, which means we can't have it
replace dependencies.

Alternatively (current practice[1]) you can continue the convention that one
*should not* use addModuleStyles for anything other than the core basic css
(which must not have dependencies or concerns about module order).

If you want dependencies, you'll have to join the regular load stack, which
won't run without javascript.

----
See:
* bug 45229
* Ia5eadcfcd4b98685
* ...


[1]
https://www.mediawiki.org/wiki/ResourceLoader/Developing_with_ResourceLoader#CSS_2

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to