Page MenuHomePhabricator

Duplicated hooks in MediaWiki core JSDoc
Closed, ResolvedPublic

Description

The wikipage.diff and wikipage.indicators hooks are documented twice on the JSDoc site, although they only appear once each on the JSDuck site

See:

Details

Related Changes in Gerrit:

Event Timeline

The documentation in mediawiki.page.preview.js appeared during the JSDoc migration, in commit 2d4257305963, so it’s no surprise that it’s not duplicated in JSDuck. And during copying documentation around, it came that both copies are slightly different (minor punctuation and formatting differences), so they cannot automatically be de-duplicated. I see two options:

  • Remove the documentation from mediawiki.page.preview.js, the one in ready.js should be enough (and should be the canonical one).
  • Make the copies equal character-for-character. If JSDoc is smart enough, it can de-duplicate them at this point. If not, it may be possible to tweak it (hopefully any tweaking needs to happen in our theme, not upstream).

Thanks, @Tacsipacsi! That makes sense. I think it would be best to remove the doc blocks from mediawiki.page.preview.js so there's only one instance of the documentation.

Change #1017167 had a related patch set uploaded (by Alex Paskulin; author: Alex Paskulin):

[mediawiki/core@master] docs: Remove duplicate hook documentation

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

Change #1017167 merged by jenkins-bot:

[mediawiki/core@master] docs: Remove duplicate hook documentation

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