Add 'unwrap' ParserOutput post-cache transform
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 22 Dec 2017 18:32:49 +0000 (13:32 -0500)
committerGergő Tisza <tgr.huwiki@gmail.com>
Thu, 1 Feb 2018 22:24:27 +0000 (14:24 -0800)
commitd511626236f9eeeb6a55c97c3c0d74d30150dc4f
treee2c715d5412006fce5070f7772d2a23278c555b9
parent58bc3348543df35a03bb4f7495dc380bad04d25c
Add 'unwrap' ParserOutput post-cache transform

And deprecate passing false for ParserOptions::setWrapOutputClass().

There are three cases for the Parser wrapper: the default
mw-parser-output, a custom wrapper, or no wrapper. As things currently
stand, we have to fragment the parser cache on each of these options,
which uses a nontrival amount of storage space (T167784).

Ideally we'd do all the wrapping as a post-cache transform, but
TemplateStyles needs to know the wrapper in use in order to properly
prefix its CSS rules (that's why we added the wrapper in the first
place). So, second best option is to make *un*wrapping be a post-cache
transform and make "custom wrapper" be uncacheable.

This patch does the first bit (unwrapping as a post-cache transform),
and a followup will do the second part once the deprecation process is
satisfied.

Bug: T181846
Change-Id: Iba16e78c41be992467101e7d83e9c3134765b101
12 files changed:
RELEASE-NOTES-1.31
includes/Message.php
includes/api/ApiParse.php
includes/cache/MessageCache.php
includes/installer/Installer.php
includes/parser/ParserOptions.php
includes/parser/ParserOutput.php
tests/parser/ParserTestRunner.php
tests/phpunit/includes/ExtraParserTest.php
tests/phpunit/includes/parser/ParserOptionsTest.php
tests/phpunit/includes/parser/ParserOutputTest.php
tests/phpunit/includes/parser/TagHooksTest.php