Page MenuHomePhabricator

Document hooks fired by VE via mw.hook
Closed, ResolvedPublic1 Estimated Story Points

Description

VE fires several hooks via mw.hook, most importantly:

  • ve.activate
  • ve.activationComplete
  • ve.deactivate
  • ve.deactivationComplete

While it is more or less clear what these hooks signal, they have some strange edge cases, and without detailed documentation it is not clear whether this is intentional or a bug.

Especially the CSS classes added to the <html> element do not always correspond to the hook, it rarely happens that we still have ve-activating as class when ve.activationComplete fires (while in most cases the expected ve-active class is set at that point already). Also, when switching between VE and NWE, the ve.activationComplete hook is fired, but not the other ones, which isn't obvious just from the names of the hooks.

Event Timeline

Deskana set the point value for this task to 1.Oct 11 2017, 9:49 PM

Love ya guys, always coming across this page when trying to recall those hook names & googling. How about adding them to https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.hook?

@Esanders: Since you authored rEVEDbe9c6800adb4: Audit target hooks, you might be interested in clarifying the edge cases here (I didn't test whether my remarks about the CSS class and about switching between VE and NWE are still true, but I assume so).