Page MenuHomePhabricator

Drop resourceloader handling for legacy style formats
Closed, ResolvedPublic

Description

In the code for mw.loader there is some handling for the old format of specifying styles, as { <media>: css } or { <media>: [url, ..] }. This is documented as "needs to be supported forever due to caching" since the style was changed in ff594d3b0ae88009120fcde48c91c24c1e3d0445 (T33676, T37562, T42498, T42500). However, the versions for all modules have changed since then (at the very least due to the switch from 7 characters to 5) so shouldn't anything from before this switch no longer be cached, and thus the logic no longer needed? Or are there still modules that need this?

I propose removing the handling if nothing is still using it.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Krinkle triaged this task as Medium priority.Sep 24 2021, 9:30 PM
Krinkle moved this task from Inbox to Accepted Enhancement on the MediaWiki-ResourceLoader board.

I believe this is okay to remove because:

  • For cases where this is transmitted over a versioned JavaScript response, even if a site upgrades from MediaWiki 1.23 to the latest release in one go, it will be fine since our version manifest is in the same reponse as the loader client, which enables forward-moving cache propagation (Docs). Basically, any client with the old manifest has the old loader and request older versions. Any client with the newer manifest, has the newer client and thus bypasses any cached responses from before.
  • We do sometimes have to account for backward-compatiblity, namely in our unversioned responses. This is mainly the case for stylesheets for the skin, and the cached HTML. However, while this task is about compatibility code for stylesheets, it is specifically for JS-loaded stylesheets, not the stylesheets of style modules queued server-side.

Change 723636 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] resourceloader: drop handling for loading of legacy style format

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

Change 723636 merged by jenkins-bot:

[mediawiki/core@master] resourceloader: Remove execute() handling of legacy style formats

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

Change 724117 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] resourceloader: unhoist another variable in mediawiki.loader.js

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

Change 724117 abandoned by DannyS712:

[mediawiki/core@master] resourceloader: unhoist another variable in mediawiki.loader.js

Reason:

Post-compression size increases, nevermind

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