r109965 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109964‎ | r109965 | r109966 >
Date:22:45, 24 January 2012
Author:gregchiasson
Status:ok (Comments)
Tags:
Comment:
AFT5 - add mediawiki.util dependency for Special page, per r105471. Not sure if that fixes anything at this point, since the page is using resource loader already, and and loads ext.articleFeedbackv5.dashboard, which has a dependency on mediawiki.util as well as jquery.articleFeedbackv5.special already, but it doesn't seem to hurt. I'm open to suggestion on this,
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php
@@ -179,6 +179,9 @@
180180 'articlefeedbackv5-special-sort-asc',
181181 'articlefeedbackv5-special-sort-desc'
182182 ),
 183+ 'dependencies' => array(
 184+ 'mediawiki.util',
 185+ ),
183186 ),
184187 );
185188

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r105471AFTv5 - JS fixes on feedback page - I think there was an issue with wikiScrip...gregchiasson22:40, 7 December 2011

Comments

#Comment by Johnduhart (talk | contribs)   22:47, 24 January 2012

If your module uses code from another module, declare it. :)

#Comment by Krinkle (talk | contribs)   22:52, 24 January 2012

Yep, modules should declare all and only dependencies used directly in the scripts listed in the module itself. The jquery.articleFeedbackv5.special module contains jquery.articleFeedbackv5.special.js which uses mw.util several times. So loading the jquery.articleFeedbackv5.special requires the presence of the mediawiki.util, which is only enforced by doing what this commit adds. Otherwise loading of this module could fail.

loads ext.articleFeedbackv5.dashboard, which has a dependency on mediawiki.util as well as jquery.articleFeedbackv5.special already

The problem here is that you don't control what is loaded when. One shouldn't depend on modules executing in a certain order or combination. The only guarantee is the dependency map.

Status & tagging log