From 27e3cddfbef533f783898800ac4abdd5a453b436 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 13 Apr 2020 15:02:31 +0200 Subject: Move syntax highlighting to web worker (#11017) This should eliminate page freezes when loading big files/diff. `highlightBlock` is needed to preserve existing nodes when highlighting and for that, highlight.js needs access to the DOM API so I added a DOM implementation to make it work, which adds around 300kB to the output file size of the lazy-loaded `highlight.js`. Co-authored-by: Lauris BH --- package-lock.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'package-lock.json') diff --git a/package-lock.json b/package-lock.json index 6f1f73245d..f0f7d08017 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3659,6 +3659,11 @@ "domelementtype": "1" } }, + "domino": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/domino/-/domino-2.1.4.tgz", + "integrity": "sha512-l70mlQ7IjPKC8kT7GljQXJZmt5OqFL+RE91ik5y5WWQtsd9wP8R7gpFnNu96fK5MqAAZRXfLLsnzKtkty5fWGQ==" + }, "dompurify": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.0.8.tgz", @@ -15008,6 +15013,26 @@ "errno": "~0.1.7" } }, + "worker-loader": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/worker-loader/-/worker-loader-2.0.0.tgz", + "integrity": "sha512-tnvNp4K3KQOpfRnD20m8xltE3eWh89Ye+5oj7wXEEHKac1P4oZ6p9oTj8/8ExqoSBnk9nu5Pr4nKfQ1hn2APJw==", + "requires": { + "loader-utils": "^1.0.0", + "schema-utils": "^0.4.0" + }, + "dependencies": { + "schema-utils": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", + "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", + "requires": { + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0" + } + } + } + }, "wrap-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", -- cgit v1.2.3