jenkins-bot has submitted this change and it was merged.

Change subject: Don't rely on 'user' and 'site' modules working correctly
......................................................................


Don't rely on 'user' and 'site' modules working correctly

I think somebody somewhere pointed to this as the reason why VE
wouldn't load when user's common.js has syntax errors, but I actually
can't reproduce that. Not sure if this is needed, but looks like a
good idea anyway.

Change-Id: I3abecacf083c1c9dfb2ea30207a9911eeea54b50
---
M modules/ve-mw/init/ve.init.mw.Target.js
1 file changed, 11 insertions(+), 6 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/init/ve.init.mw.Target.js 
b/modules/ve-mw/init/ve.init.mw.Target.js
index 4a1d5cc..bd792dc 100644
--- a/modules/ve-mw/init/ve.init.mw.Target.js
+++ b/modules/ve-mw/init/ve.init.mw.Target.js
@@ -991,7 +991,7 @@
  * @returns {boolean} Loading has been started
 */
 ve.init.mw.Target.prototype.load = function ( additionalModules ) {
-       var data, start, xhr, target = this;
+       var data, start, xhr, modulesPromise, additionalModulesPromise, target 
= this;
 
        // Prevent duplicate requests
        if ( this.loading ) {
@@ -999,11 +999,16 @@
        }
        this.events.timings.activationStart = ve.now();
        // Start loading the module immediately
-       mw.loader.using(
-               // Wait for site and user JS before running plugins
-               this.modules.concat( additionalModules || [] ),
-               ve.init.mw.Target.onModulesReady.bind( this )
-       );
+       modulesPromise = mw.loader.using( this.modules );
+       additionalModulesPromise = mw.loader.using( additionalModules || [] );
+
+       modulesPromise.done( function () {
+               // Wait for site and user JS before running plugins.
+               // These modules could fail to load, proceed even if they do.
+               additionalModulesPromise.always( function () {
+                       ve.init.mw.Target.onModulesReady.call( this );
+               } );
+       } );
 
        data = {
                action: 'visualeditor',

-- 
To view, visit https://gerrit.wikimedia.org/r/184234
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3abecacf083c1c9dfb2ea30207a9911eeea54b50
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoƄski <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to