From 9f1a783d339f3a91c3d920886a0665a75a217e75 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 23 May 2018 00:28:36 +0100 Subject: [PATCH] resourceloader: Remove mwLoadEnd code (moved to Navigation Timing) This internal hook was primarily added for the Navigation Timing extension. As part of T192623, this should be removed from mediawiki.js because: * It is not used in anyway by core. * It should not be used by anything other than Navigation Timing. * It depends heavily on jQuery, which we don't want for mediawiki.js. Bug: T192623 Depends-On: I011c9d1beebe6fa8d21ab9260da0a817ff7aa5f0 Change-Id: I0bf60d37ebea96f2a22044f9db221c87dd88521c --- resources/src/mediawiki/mediawiki.js | 36 ---------------------------- 1 file changed, 36 deletions(-) diff --git a/resources/src/mediawiki/mediawiki.js b/resources/src/mediawiki/mediawiki.js index 9837ce89ef..702c18d1bb 100644 --- a/resources/src/mediawiki/mediawiki.js +++ b/resources/src/mediawiki/mediawiki.js @@ -2806,42 +2806,6 @@ mw.trackSubscribe( 'resourceloader.exception', logError ); mw.trackSubscribe( 'resourceloader.assert', logError ); - /** - * Fired when all modules associated with the page have finished loading. - * - * @event resourceloader_loadEnd - * @member mw.hook - */ - $( function () { - // Get a list of modules currently in loading state - var modules = mw.loader.getModuleNames().filter( function ( module ) { - return mw.loader.getState( module ) === 'loading'; - } ); - // Wait for them to complete loading (regardles of failures). First, try a single - // mw.loader.using() call. That's efficient, but has the drawback of being rejected - // upon first failure. Fall back to tracking each module separately. We usually avoid - // that because of high overhead for that internally to mw.loader. - mw.loader.using( modules ).catch( function () { - return $.Deferred( function ( deferred ) { - var i, count = modules.length; - function decrement() { - count--; - if ( count === 0 ) { - deferred.resolve(); - } - } - for ( i = 0; i < modules.length; i++ ) { - mw.loader.using( modules[ i ] ).always( decrement ); - } - } ); - } ).then( function () { - if ( window.performance && performance.mark ) { - performance.mark( 'mwLoadEnd' ); - } - mw.hook( 'resourceloader.loadEnd' ).fire(); - } ); - } ); - // Attach to window and globally alias window.mw = window.mediaWiki = mw; }( jQuery ) ); -- 2.20.1