Page MenuHomePhabricator

Drop support for non-Codex message boxes
Open, MediumPublic

Description

Impacted extensions will lose message box styling without taking any action so it is important that teams prioritize this ticket.

Background

Historically code has used mw-message-box for styling message boxes.
As part of standardization to Codex, this markup must now be transitioned to CdxMessage markup:
https://doc.wikimedia.org/codex/latest/components/demos/message.html#markup-structure

If extensions are using Html::messageBox there is nothing to do here.
Extensions using JavaScript to create message box should either switch to Codex or alter their markup:

Currently to mitigate impact Vector 2022 skin loads the old styles via JavaScript but we would like to remove this in future.

TODO

Impacted code https://codesearch.wmcloud.org/deployed/?q=mw-message-box and https://global-search.toolforge.org/?q=mw-message-box&regex=1&namespaces=&title=
Phase 1: updates to extensions

  • MobileFrontend
  • CentralNotice
  • Gadgets (user notice)
  • FlaggedRevisions
  • Graph
  • GrowthExperiments
  • MassMessage
  • TwoColConflict
  • Minerva will drop support for the legacy message styles.

When this task is resolved

Create new tickets for:

  • Remove loading of message box styles via JavaScript in Vector and Minerva.
  • Update markup in core to remove references to old non-Codex classes.

Event Timeline

Restricted Application added a subscriber: Masumrezarock100. · View Herald Transcript

Extensions using JavaScript to create message box should either switch to Codex

Is there any way to switch to Codex without using Vue? Extensions (and gadgets!) may have complex JavaScript, which would take quite some time to be completely rewritten in Codex/Vue, blocking phase 2 longer than necessary.

or alter their markup

This should be a last resort, because if anything takes this way, the next task similar to this one is predetermined – the Codex markup won’t last forever either, it will probably be obsoleted within two decades (which may sound a lot, but isn’t an excuse for creating tech debt).

On the other hand, it’s probably the only choice for use in wikitext like cs:MediaWiki:readonlywarning, de:MediaWiki:deletedwhileediting and b:en:Help:CS1 errors. The question is whether this use is supported at all, and if not, what supported solution can replace it.

Extensions using JavaScript to create message box should either switch to Codex

Is there any way to switch to Codex without using Vue? Extensions (and gadgets!) may have complex JavaScript, which would take quite some time to be completely rewritten in Codex/Vue, blocking phase 2 longer than necessary.

Codex supports CSS-only versions of its components. e.g. https://doc.wikimedia.org/codex/latest/components/demos/message.html#css-only-version for message box. These don't need Vue and styles are available inside Vector 2022 and Minerva skins. For other skins, you'll need to load Codex's styles to render these.

The only downside of using the HTML is it is not covered by the stable policy in the same way as the JS so you must be aware and respond to any changes in Codex to the markup. We haven't needed to do this yet but I assume at some point in the future this may happen. https://www.mediawiki.org/wiki/Stable_interface_policy/Frontend#What_is_not_stable?

If I was writing templates using it, I would likely create some kind of test that generates the HTML using Vue.js and compares the result with the template output and alerts me if a change occurs (Vue.js will always generate the correct markup).

Esanders subscribed.

Removing VE (not uses) and TemplateData (only use is a parser test dependent on core functionality).

Jdlrobson triaged this task as Medium priority.Apr 24 2024, 3:11 PM

Change #1032031 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/MinervaNeue@master] Minerva should no longer support non-Codex message boxes

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

Change #1032039 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/MobileFrontend@master] Drop support for old style message boxes

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

Change #1032039 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Drop support for old style message boxes

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

Change #1032031 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Minerva should no longer support non-Codex message boxes

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