mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Revert "PERF: Move highlightjs to a background worker, and add result cache (#10191)"
This caused a CORS error when used with S3 asset storage
This reverts commit d09f283e91.
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
import componentTest from "helpers/component-test";
|
||||
import {
|
||||
waitForHighlighting,
|
||||
setupHighlightJs
|
||||
} from "discourse/lib/highlight-syntax";
|
||||
|
||||
const LONG_CODE_BLOCK = "puts a\n".repeat(15000);
|
||||
|
||||
@@ -12,15 +8,12 @@ componentTest("highlighting code", {
|
||||
template: "{{highlighted-code lang='ruby' code=code}}",
|
||||
|
||||
beforeEach() {
|
||||
setupHighlightJs({
|
||||
highlightJsUrl: "/assets/highlightjs/highlight-test-bundle.min.js",
|
||||
highlightJsWorkerUrl: "/assets/highlightjs-worker.js"
|
||||
});
|
||||
Discourse.HighlightJSPath =
|
||||
"assets/highlightjs/highlight-test-bundle.min.js";
|
||||
this.set("code", "def test; end");
|
||||
},
|
||||
|
||||
async test(assert) {
|
||||
this.set("code", "def test; end");
|
||||
await waitForHighlighting();
|
||||
assert.equal(
|
||||
find("code.ruby.hljs .hljs-function .hljs-keyword")
|
||||
.text()
|
||||
@@ -30,19 +23,16 @@ componentTest("highlighting code", {
|
||||
}
|
||||
});
|
||||
|
||||
componentTest("highlighting code limit", {
|
||||
componentTest("large code blocks are not highlighted", {
|
||||
template: "{{highlighted-code lang='ruby' code=code}}",
|
||||
|
||||
beforeEach() {
|
||||
setupHighlightJs({
|
||||
highlightJsUrl: "/assets/highlightjs/highlight-test-bundle.min.js",
|
||||
highlightJsWorkerUrl: "/assets/highlightjs-worker.js"
|
||||
});
|
||||
Discourse.HighlightJSPath =
|
||||
"assets/highlightjs/highlight-test-bundle.min.js";
|
||||
this.set("code", LONG_CODE_BLOCK);
|
||||
},
|
||||
|
||||
async test(assert) {
|
||||
this.set("code", LONG_CODE_BLOCK);
|
||||
await waitForHighlighting();
|
||||
assert.equal(
|
||||
find("code")
|
||||
.text()
|
||||
|
||||
Reference in New Issue
Block a user