Page MenuHomePhabricator

Declare Wikibase JavaScript hooks stable
Closed, ResolvedPublic2 Story Points

Description

We want to declare the wikibase.entityPage.entityLoaded, wikibase.statement.saved, wikibase.statement.removed, and perhaps wikibase.entityPage.entityView.rendered hooks as stable interfaces.

We might also want to amend the Stable Interface Policy to clarify that adding arguments to a hook is not a breaking change. (I have to admit, I don’t remember what the PM / Engineering Time decision on this was – were we going to do this or not?)

This includes making and maintaining the documentation of JS hooks on mediawiki.org.

https://www.wikidata.org/wiki/Wikidata:Stable_Interface_Policy

Tasks:

Details

Related Gerrit Patches:
mediawiki/extensions/Wikibase : masterSplit hooks documentation by programming language
mediawiki/extensions/Wikibase : masterAdd documentation about JavaScript hooks

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 5 2017, 4:35 PM
Jonas updated the task description. (Show Details)Jul 24 2018, 7:21 PM

Before: check that statement.removed and statement.saved hooked are passed the Form or Sense ID, when the statement on form- or sense-level on lexemes is in question.

WMDE-leszek updated the task description. (Show Details)Jul 31 2018, 1:27 PM
WMDE-leszek set the point value for this task to 2.
WMDE-leszek updated the task description. (Show Details)Jul 31 2018, 2:05 PM

Let me know if you need help for this. I'll also take care of announcing it on the community channels.

@Jonas: it was not really discussed earlier, but do you think doing this deserves some ADR document to be added to Wikibase repo?

Do you mean the decision to use mw.hooks in Wikibase JS?
Or what exactly you think should be documented?

  • that hooks are made stable (this is the decision)
  • what were the arguments in favour doing this
  • what implications does it have for developers of Wikibase

Basically, I think it make sense to say _together_with_code_ that if you change this, you need to X and Z.

Jonas moved this task from Ready to estimate to In Progress on the Wikidata-Campsite board.
Jonas updated the task description. (Show Details)Aug 20 2018, 9:16 AM
Jonas updated the task description. (Show Details)Aug 20 2018, 9:42 AM

Change 454012 had a related patch set uploaded (by Jonas Kress (WMDE); owner: Jonas Kress (WMDE)):
[mediawiki/extensions/Wikibase@master] Add documentation about JavaScript hooks

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

Jonas updated the task description. (Show Details)Aug 20 2018, 1:13 PM
Jonas updated the task description. (Show Details)

Change 454012 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add documentation about JavaScript hooks

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

Jonas updated the task description. (Show Details)Aug 27 2018, 11:58 AM

@Addshore @WMDE-leszek if you agree I would add a section 'Stable hooks' to the https://www.wikidata.org/wiki/Wikidata:Stable_Interface_Policy stating that all hooks defined in https://phabricator.wikimedia.org/diffusion/EWBA/browse/master/docs/hooks.txt excluding deprecated hooks are considered stable.

@Addshore @WMDE-leszek if you agree I would add a section 'Stable hooks' to the https://www.wikidata.org/wiki/Wikidata:Stable_Interface_Policy stating that all hooks defined in https://phabricator.wikimedia.org/diffusion/EWBA/browse/master/docs/hooks.txt excluding deprecated hooks are considered stable.

Per the policy:

Wikibase PHP code is not considered a stable interface. Since there are currently no official releases of the Wikibase extension, just a rolling deployment to wikidata.org, there is no point in time at which any given PHP class or interface can be assumed to remain stable.

PHP hooks shouldn't be added / marked as stable

Yes, I'd rather see the policy only mention JS hooks explicitly.

Change 455785 had a related patch set uploaded (by Jonas Kress (WMDE); owner: Jonas Kress (WMDE)):
[mediawiki/extensions/Wikibase@master] Split hooks documentation by programming language

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

Change 455785 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Split hooks documentation by programming language

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

Text for the wiki and the announcement on the mailing list:
To allow better gadget integration hooks (JavaScript) documented in this file hooks-js.txt are considered stabled

\o/
All good from my side besides small typo at end of message (stabled -> stable).

So final text:

To allow better gadget integration JavaScript hooks documented in the hooks-js.txt file delivered together with Wikibase source code are considered stable.