Page MenuHomePhabricator

Deduplicate template styles in mobileviews API
Closed, DeclinedPublic

Description

T168333: CSS is duplicated on each template usage is now fixed for most things but the mobileviews API splits the HTML into sections so it needs to do its own, per-section deduplication.

The mechanism, as implemented in core for rMW9b2b375fcef1: ParserOutput: Add 'deduplicateStyles' post-cache transformation, is to find <style> tags with a data-mw-deduplicate attribute, and replace all but the first of each deduplication value with <link rel="mw-deduplicated-inline-style" href="mw-data:..."/>; the ellipsis there is a percent-encoded representation version of the deduplication value.

Related Objects

StatusSubtypeAssignedTask
DeclinedNone
ResolvedJdlrobson
DeclinedNone
DuplicateNone
ResolvedJdlrobson
DuplicateNone
DuplicateNone
DeclinedNone
ResolvedJdlrobson
DuplicateNone
DuplicateNone
Openbwang
Duplicateovasileva
ResolvedNone
OpenNone
OpenNone
ResolvedTheDJ
DeclinedNone
InvalidNone
OpenFeatureNone
InvalidNone
ResolvedTheDJ
ResolvedTheDJ
InvalidNone
ResolvedIzno
ResolvedTheDJ
OpenNone
ResolvedJdlrobson
DeclinedNone
ResolvedTgr
ResolvedTgr
DeclinedNone

Event Timeline

@Tgr Could you please clarify how this task relates to TemplateStyles deployment ruwiki? Thanks!

That's up to the ruwiki community to decide, there never was much concern about duplication on the WMF side. I'd imagine if they are concerned about desktop performance they would be about mobile web as well, which is where this API is used.

Deskana lowered the priority of this task from Medium to Low.Mar 16 2018, 9:50 AM
Deskana subscribed.

Nice to have, but not a blocker for any deployments per T133410#4055687.

Jdlrobson subscribed.

The plan is to deprecate the mobileview API within the next few years so this will not get worked on (T186627).