Page MenuHomePhabricator

Does mw.rcfilters need to be a public stable API?
Closed, ResolvedPublic

Description

Noticed while working on T352308.

Currently mw.rcfilters is a public stable API by the definition expressed in https://www.mediawiki.org/wiki/Stable_interface_policy/Frontend however it is never used (https://codesearch.wmcloud.org/search/?q=mw%5C.rcfilters%5C.&files=&excludeFiles=&repos=) and appears in our JavaScript documentation.

Decision

  • No longer populate mw.rcfilters. Instead use module.exports and mark the export as for internal usage.

Event Timeline

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

I don't think it needs to be. It was never intended to be a public stable API. The code was just written before packageFiles existed, so attaching things to a public namespace was the only way to share classes between files at that time. Now that the code has been packageFiles-ified, we can probably remove mw.rcfilters (with some changes to remove reliance on it internally within the RCFilters code, and in the tests).

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

[mediawiki/core@master] mw.rcfilters is a private module

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

Jdlrobson triaged this task as Medium priority.Feb 1 2024, 10:42 PM

Change 993820 merged by jenkins-bot:

[mediawiki/core@master] mw.rcfilters is a private module

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

Jdlrobson updated the task description. (Show Details)