== What? ==
The MobileFrontend ~~extension~~ application comprises of a set of core modules and a set of features that rely on them. Some-to-most of these features can be enabled or disabled by setting a configuration variable, a **flag**, to a truthy value. Moreover, most of these features also have additional configuration variables, which change the behaviour of specific parts of the feature.
[The number of features in the application is large](https://www.mediawiki.org/wiki/Reading/Features#Feature_matrix) and their configuration and location in the codebase sufficiently complex that it's non-trivial to identify and document them after the fact. A feature management system for MobileFrontend, therefore, must not only standardise how a feature is enabled and configured, but also where it's defined and documented as well. Moreover, this information should be immediately available to both MobileFrontend developers and to stakeholders, e.g. the Product Owner of the Reading Web team.
A feature's behaviour can be implemented in PHP and/or JS, and CSS – LESS strictly. Consequently, the feature management system must make information about the feature available in those execution environments.
MobileFrontend can operate in either "stable" or "beta" mode. Generally speaking, all features are expected to be enabled in beta mode and will, at some point, be "promoted" from beta to stable mode. Given that the majority of requests to the Wikipedias are serviced by Varnish, promoting a feature requires considering how the distinct parts of the feature's implementation will interact when the feature is enabled, i.e. the response from Varnish may or may not be up to date but the JS and CSS will be. The feature management system must provide a mechanism for handling this state gracefully by either:
* updating the state of the application to reflect that the feature is disabled, which should probably be the default behaviour; or
* allowing a feature to provide a script – say, an RL module – that'll update the state of the application such that the feature can be enabled
---
From T140352:
* Feature flagging modules for PHP and JS
* Follow-up to migrate current features to it
* Follow-up to remove access to isBeta in php and JS (to force relying in feature flags)
* Special page like Special:Versions that shows the flags and which are enabled