Page MenuHomePhabricator

CSS-only gadgets enabled shouldn't be loaded via mw.loader.load
Closed, ResolvedPublic

Description

When a gadget only has css files, it get a loader.load entry. In my opinion it is easy/cheap to check, if the gadget has only css files and than skip that entry, because the css should be enough to get. Thanks.


Version: unspecified
Severity: enhancement

Details

Reference
bz34904

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:18 AM
bzimport set Reference to bz34904.
bzimport added a subscriber: Unknown Object (MLST).

(In reply to comment #0)

When a gadget only has css files, it get a loader.load entry. In my opinion it
is easy/cheap to check, if the gadget has only css files and than skip that
entry, because the css should be enough to get. Thanks.

Then how do you suggest the CSS actually ends up in the client ?

mw.loader requests modules in batch from load.php based on the dependency model and current last-modified timestamps from the startup module.

load.php then responses with the requested modules and their 3 components (of which some could be empty/undefined): JS function, CSS stylesheet, i18n messages. These are then unpackaged on the client (e.g. style is inserted into the <style> tag).

What is your suggestions exactly?

CSS is loaded with a <link rel="stylesheet" href="//.../load.php?debug=false&..." type="text/css" media="all" />.

There is no need for a javascript part.

Krinkle claimed this task.
Krinkle added a project: Performance-Team.