diff options
author | Timo Tijhof <krinklemail@gmail.com> | 2019-06-13 19:41:56 +0100 |
---|---|---|
committer | Aaron Schulz <aschulz@wikimedia.org> | 2019-06-27 00:08:14 +0000 |
commit | c554ee8e64e933b6dbe21aaf66eed8d46b6f177c (patch) | |
tree | 1beb577fb8f953a8775aeae5a2178c13db6d0796 /includes/resourceloader/ResourceLoaderFileModule.php | |
parent | 67d01c452da591faced0a4be7940acf4f3292928 (diff) | |
download | mediawikicore-c554ee8e64e933b6dbe21aaf66eed8d46b6f177c.tar.gz mediawikicore-c554ee8e64e933b6dbe21aaf66eed8d46b6f177c.zip |
resourceloader: Remove support for raw modules
Being a raw module means that when it is requested from load.php with
"only=scripts" set, then the output is *not* wrapped in an
'mw.loader.implement' closure *and* there no 'mw.loader.state()' appendix.
Instead, it is served "raw".
Before 2018, the modules 'mediawiki' and 'jquery' were raw modules.
They were needed before the client could define 'mw.loader.implement', and
could never be valid dependencies. Module 'mediawiki' merged to 'startup',
and 'jquery' became a regular module (T192623). Based on the architecture
of modules being deliverable bundles, it doesn't make sense for there to
ever be raw modules again. Anything that 'startup' needs should be bundled
with it. Anything else is a regular module.
On top of that, we never actually needed this feature because specifying
the 'only=scripts' and 'raw=1' parameters does the same thing.
The only special bit about marking modules (not requests) as "raw" was that
it allowed the client to forget to specify "raw=1" and the server would
automatically omit the 'mw.loader.state()' appendix based on whether the
module is marked as raw. As of Ie4564ec8e26ad53f2, the two remaining use
cases for raw responses now specify the 'raw=1' request parameter, and we
can get rid of the "raw module" feature and all the complexity around it.
== Startup module
In the startup module there was an interesting use of isRaw() that has
little to do with the above. The "ATTENTION" warning there applies to the
startup module only, not raw modules in general. This is now fixed by
explicitly checking for StartupModule.
Above that warning, it talked about saving bytes, which was an optimisation
given that "raw" modules don't communicate with mw.loader, they also don't
need to be registered there because even if mw.loader would try to load
them, the server would never inform mw.loader about the module having
arrived. There are now no longer any such modules.
Bug: T201483
Change-Id: I8839036e7b2b76919b6cd3aa42ccfde4d1247899
Diffstat (limited to 'includes/resourceloader/ResourceLoaderFileModule.php')
-rw-r--r-- | includes/resourceloader/ResourceLoaderFileModule.php | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index 7093ab1dc023..017b39934e74 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -140,9 +140,6 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { /** @var bool Link to raw files in debug mode */ protected $debugRaw = true; - /** @var bool Whether mw.loader.state() call should be omitted */ - protected $raw = false; - protected $targets = [ 'desktop' ]; /** @var bool Whether CSSJanus flipping should be skipped for this module */ @@ -305,7 +302,6 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { break; // Single booleans case 'debugRaw': - case 'raw': case 'noflip': $this->{$member} = (bool)$option; break; @@ -514,13 +510,6 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { } /** - * @return bool - */ - public function isRaw() { - return $this->raw; - } - - /** * Disable module content versioning. * * This class uses getDefinitionSummary() instead, to avoid filesystem overhead @@ -620,7 +609,6 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { 'templates', 'skipFunction', 'debugRaw', - 'raw', ] as $member ) { $options[$member] = $this->{$member}; } @@ -1004,7 +992,6 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { || $this->dependencies || $this->messages || $this->skipFunction - || $this->raw ); return $canBeStylesOnly ? self::LOAD_STYLES : self::LOAD_GENERAL; } |