Last modified: 2014-04-09 18:56:58 UTC
The page [[mw:ResourceLoader/JavaScript Deprecations]] says that wikibits.js functions will be removed eventually. If anyone knows if this is already scheduled to be done in some specific future version of MediaWiki, please inform us below (and update the Target milestone from "Mysterious future" to something more appropriated). Anyway, I'm creating this bug so that people (me included) can be notified about the progress on this and avoid being caught by surprise.
From [[mw:ResourceLoader/Migration guide (users)]]: "There are a few old wikibits functions that don't have a simple drop-in replacement yet (such as importScript()). importScriptURI does have a simple successor: mw.loader.load. Recommendation: Keep using importScript the way you do, the way you know they work. They won't go away anytime soon, certainly not before there is a good replacement." The old wikibits.js is now a module (mediawiki.legacy.wikibits) which even relies on mediawiki.util. There are no plans to deprecate wikibits in any time soon.
For the record, the legacy wikibits is included by these lines: if ( $wgIncludeLegacyJavaScript ){ $this->addModules( 'mediawiki.legacy.wikibits' ); } from http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/OutputPage.php?view=markup#l2452 So, this bug is about changing $wgIncludeLegacyJavaScript to false once we have replacements for the legacy functions.
(In reply to comment #2) > For the record, the legacy wikibits is included by these lines: > if ( $wgIncludeLegacyJavaScript ){ > $this->addModules( 'mediawiki.legacy.wikibits' ); > } > from > http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/OutputPage.php?view=markup#l2452 > > So, this bug is about changing $wgIncludeLegacyJavaScript to false once we have > replacements for the legacy functions. Yep, and even after that default is changed: * wikis can still set it to true * any extension module or gadget can list it as a dependency and ResourceLoader will make sure it's loaded before the rest of the module.
(In reply to comment #3) > * any extension module or gadget can list it as a dependency and ResourceLoader > will make sure it's loaded before the rest of the module. .. regardless of what $wgIncludeLegacyJavaScript is set to.
Even when $wgIncludeLegacyJavaScript is set to false by default, wikibits.js will be loaded in a standard installation: $wgUseAjax is true by default, this loads the legacy ajax.js (though at least the ajax features in core don't need it anymore), which has wikibits.js as dependency.
Adding bug 25845 as a dependency since the request from bug 27475 to have an equivalent to importScript was marked as a duplicated of the first bug (see also bug 27535).
Removed dependency
Removed dependency on bug 27281, added bug 34958
(In reply to comment #5) > Even when $wgIncludeLegacyJavaScript is set to false by default, wikibits.js > will be loaded in a standard installation: $wgUseAjax is true by default, this > loads the legacy ajax.js (though at least the ajax features in core don't need > it anymore), which has wikibits.js as dependency. Yes, but one must never depend on another module's dependency. wgIncludeLegacyJavaScript is intended for scripts that are not resource loader modules (yet) so that those (usually older) scripts may assume presence of wikibits methods. If wgIncludeLegacyJavaScript is false, eventhough it may end up being loaded, you can't know for sure if it will be loaded when you need it. For example, if wgIncludeLegacyJavaScript is false, and your module loads before ajax.js then you won't have wikibits. (unless you add mediawiki.legacy.wikibits to your module dependencies, see comment 3)