Last modified: 2014-04-09 18:56:58 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 33836 - Set $wgIncludeLegacyJavaScript = false by default
Set $wgIncludeLegacyJavaScript = false by default
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: Future release
Assigned To: Nobody - You can work on this!
:
Depends on: 34958 35858
Blocks: 50039
  Show dependency treegraph
 
Reported: 2012-01-20 12:44 UTC by Helder
Modified: 2014-04-09 18:56 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Helder 2012-01-20 12:44:19 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.
Comment 1 Erwin Dokter 2012-01-20 16:24:09 UTC
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.
Comment 2 Helder 2012-01-20 18:42:33 UTC
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.
Comment 3 Krinkle 2012-01-20 23:16:29 UTC
(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.
Comment 4 Krinkle 2012-01-20 23:17:07 UTC
(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.
Comment 5 Michael M. 2012-01-21 09:38:02 UTC
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.
Comment 6 Helder 2012-01-24 19:40:45 UTC
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).
Comment 7 Krinkle 2012-03-10 22:05:19 UTC
Removed dependency
Comment 8 Krinkle 2012-03-10 22:06:20 UTC
Removed dependency on bug 27281, added bug 34958
Comment 9 Krinkle 2012-05-11 17:28:55 UTC
(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)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links