Ori.livneh has submitted this change and it was merged.

Change subject: Disable background linting using WebWorkers
......................................................................


Disable background linting using WebWorkers

Ace uses JavaScript Web Workers for linting code. Ace's attempt to load workers
in JS and JSON modes runs into the mismatch between its require()
implementation and ResourceLoader, resulting in a request for
/worker_<lang>.js, which 404s.

Change-Id: Ia60ef2122c015635ef0ad963a956b4f77cd6f7e8
---
M modules/jquery.codeEditor.js
1 file changed, 6 insertions(+), 1 deletion(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved
  Mattflaschen: Looks good to me, but someone else must approve



diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js
index 6e3492d..2f62cf8 100644
--- a/modules/jquery.codeEditor.js
+++ b/modules/jquery.codeEditor.js
@@ -163,7 +163,12 @@
                                }
                        ];
                        box.closest('form').submit( 
context.evt.codeEditorSubmit );
-                       context.codeEditor.getSession().setMode(new 
(require("ace/mode/" + lang).Mode));
+                       var session = context.codeEditor.getSession();
+
+                       // Disable code-linting in the background using 
JavaScript WebWorkers.
+                       // Currently broken due to require() / ResourceLoader 
mismatch.
+                       session.setUseWorker(false);
+                       session.setMode(new (require("ace/mode/" + lang).Mode));
 
                        // Force the box to resize horizontally to match in 
future :D
                        var resize = function() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia60ef2122c015635ef0ad963a956b4f77cd6f7e8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeEditor
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Spage <[email protected]>

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

Reply via email to