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

phuedx created this task.Jul 22 2016, 4:36 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 22 2016, 4:36 PM
phuedx updated the task description. (Show Details)Jul 22 2016, 4:38 PM
phuedx added a subscriber: Danny_B.Jul 25 2016, 7:56 AM

@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.

Jhernandez updated the task description. (Show Details)Jul 25 2016, 12:24 PM
phuedx updated the task description. (Show Details)Jul 25 2016, 3:43 PM

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) 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.

Jhernandez triaged this task as High priority.Jul 25 2016, 4:43 PM
Jhernandez moved this task from Backlog to Tasks on the MobileFrontend board.
Jhernandez moved this task from Incoming to 2016-17 Q2 on the Readers-Web-Backlog board.
Danny_B removed a subscriber: Danny_B.Jul 27 2016, 11:27 AM

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

phuedx updated the task description. (Show Details)Aug 10 2016, 10:12 AM
phuedx updated the task description. (Show Details)Aug 10 2016, 7:30 PM
Jdlrobson added a subscriber: Jdlrobson.
  • How do we define a feature?
  • What is the list of features that will be managed by such a thing?