Page MenuHomePhabricator

Remove deprecation warnings in form of HTML comment
Closed, ResolvedPublic

Description

Every time I open any page in any wiki, I get between 8-11 HTML comments like this:

<!-- Please do not use role attribute as CSS selector, it is deprecated. -->

This is wrong on so many levels:

  • It is adding a huge traffic overhead. Just in March 2021, we had 24B page views and this adds around 0.5KB to the payload => 12 TB extra traffic a month.
  • 12 TB according to CO2 calculator is equivalent to 10.3 ton of extra CO2.
  • It adds 0.5 to every parser cache and edge cache entry reducing their efficiency (they can store less entries in memory)
  • This doesn't count extra traffic in special pages (they are not counted as page views) or third party mediawiki instances.
  • Keep it in mind: We are enjoying an effortless and easy and cheap internet connection. Not everyone in the world is so lucky.
  • DOM of Wikipedia is not the way to communicate with gadget developers. We have Tech News. We have mass message. They will very likely miss this.
  • It is in English, assumes gadget developers know English (or must know English). It sends a bad signal at best.

We have been squeezing byte after byte from the default payload, please don't add such a large overhead.

Event Timeline

Ladsgroup updated the task description. (Show Details)

The data transfer waste is probably not that severe since HTML is gzipped and repetitive strings compress really well, but it's still waste. The Performance Team's position on these is that they serve little purpose and should be removed.

Jdlrobson triaged this task as Low priority.EditedApr 26 2021, 6:44 PM
Jdlrobson added a subscriber: phuedx.

I think the problem here is that at some point we made a decision that HTML and classes are an API that gadgets can be depended on and thus part of a deprecation process where enough time is needed for migrations. Thus when removing classes/changing classes we need to ensure that we have provided some hint to gadget developers that these changes are coming.

I think HTML and CSS are not APIs and we should perhaps change our stance on this, making these HTML comments obsolete and leaning more on User-notice
and being more accepting of breakage to gadget where it happens.

cc @phuedx

In terms of these particular comments they will be removed soon before the end of the project.

We have been squeezing byte after byte from the default payload, please don't add such a large overhead.

Citation needed for "large overhead". I highly doubt these comments are making much difference when you consider gzip. Things like collapsed navboxes take up 10% of the page (T124168) and would be better to focus on if you are concerned about HTML payload.

The data transfer waste is probably not that severe since HTML is gzipped and repetitive strings compress really well, but it's still waste. The Performance Team's position on these is that they serve little purpose and should be removed.

Agreed.

I think the problem here is that at some point we made a decision that HTML and classes are an API that gadgets can be depended on and thus part of a deprecation process where enough time is needed for migrations. Thus when removing classes/changing classes we need to ensure that we have provided some hint to gadget developers that these changes are coming.

I think HTML and CSS are not APIs and we should perhaps change our stance on this, making these HTML comments obsolete and leaning more on User-notice and being more accepting of breakage to gadget where it happens.

The comments have been in production for ~11 months (they were introduced in rSVEC4466eb3a2fd5: Use semantic HTML5 elements where applicable). @Gilles' comment above, this point, and that it's trivial to remove these comments are strong enough reasons for removal independent of whether such a decision has been made.

Change 683920 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/skins/Vector@master] templates: Remove role deprecation HTML comments

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

Agreed. I think we can remove them and the code they are referring to now, and should, but I'd definitely like to rethink the policy that led to these :)

Change 683920 merged by jenkins-bot:

[mediawiki/skins/Vector@master] templates: Remove role deprecation HTML comments

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

Krinkle claimed this task.
Krinkle reassigned this task from Krinkle to phuedx.