Page MenuHomePhabricator

Use post-cache transforms to remove `wrapclass` from the parser cache key
Closed, ResolvedPublic

Description

From T171797#3478411:

There are three cases with the wrapclass parser option:

  1. Wrapping with the default "mw-parser-output"
  2. No wrapping at all
  3. Wrapping with some non-default class

As far as actual parser output beyond the wrapper div itself, the only thing currently varying on this option is TemplateStyles. And TemplateStyles generates the same output for #1 and #2. So what we could probably do is:

  • Deprecate #2 (the ability to set wrapclass to false for "no wrapping") in favor of an "unwrap" transformation that removes the default wrapper div.
  • Change MessageCache/Message, TextExtracts, ParsoidBatchAPI, and MobileFrontend to use the "unwrap" transformation instead of setting false. Also update tests in TemplateStyles and Wikibase to do whatever is appropriate where they're currently setting false.
  • Remove wrapclass from ParserOptions::$inCacheKey, causing ParserOptions with a non-default wrapclass to become non-cacheable.

Event Timeline

Anomie created this task.Dec 1 2017, 7:48 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 1 2017, 7:48 PM

Change 399907 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] Add 'unwrap' ParserOutput post-cache transform

https://gerrit.wikimedia.org/r/399907

Change 399908 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] Remove wrapclass from parser cache key

https://gerrit.wikimedia.org/r/399908

Change 399907 merged by jenkins-bot:
[mediawiki/core@master] Add 'unwrap' ParserOutput post-cache transform

https://gerrit.wikimedia.org/r/399907

Change 399908 merged by jenkins-bot:
[mediawiki/core@master] Remove wrapclass from parser cache key

https://gerrit.wikimedia.org/r/399908

Anomie closed this task as Resolved.Feb 2 2018, 8:22 PM