Page MenuHomePhabricator

Implement basic feature management
Closed, DuplicatePublic

Description

 Plan/AC

  • Add a feature manager class to the PHP codebase
    • Provide a mechanism to register features, e.g. $wgMFFeatures config var
  • Add classes to the body element for the CSS code to target
  • Forward additional state to the client (via mw.config presumably)
  • Add a feature manager class to the JS codebase
  • Hydrate the state of the JS feature manager from the forwarded state (from mw.config presumably)

Event Timeline

@Danny_B: I had the relationships backwards!?

@phuedx According to what you wrote in those tasks yes. Subtask == blocker. Parent task == blocked.

Also, no need to use Stalled if something is blocked (unless you declined the blocker and there is currently no other known way how to unblock, but it is desired to unblock).

@phuedx As I understand it, the JS flag manager will hydrate from flags state in the HTML (cached or not), right?

So if we forward state from PHP to frontend, it'd be ideal if that state was always in sync with the HTML, so that we can stop thinking about cached/not-cached html, right?

The mw.config variables are in the HTML so this seems ready and feasible to do.

as a suggestion, CSS classes should be either on the body or on the html tag, as done by modernizr and other libraries. In head wouldn't make much sense.

as a suggestion, CSS classes should be either on the body or on the html tag, as done by modernizr and other libraries. In head wouldn't make much sense.

Mibad. On both occasions, head was a typo.

The mw.config variables are in the HTML so this seems ready and feasible to do.

IIRC the static configuration data delivered in the RL startup module (see [the ResourceLoaderGetConfigVars hook](https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderGetConfigVars)) is cached for ~5 minutes.

As per irc convo, adding the flags to outputpage would make them live with the cached HTML pages.

Per the above, we'll use the MakeGlobalVariablesScript hook.

If y'all don't mind, I'm removing this from the sprint as T141121 needs more work.

Jdlrobson subscribed.
  • How do we define a feature?
  • What is the list of features that will be managed by such a thing?