Skip to content

Highlight all supported languages with the highlight.js worker

Jacques Erasmus requested to merge 415753-hljs-worker-all-languages into master

What does this MR do and why?

As part of &7146 we've created a highlight worker so that the task of highlighting does not happen on the main thread.

Currently we're only highlighting JSON files with our highlight worker, this MR ensures we highlight all supported languages with the worker.

Screenshots or screen recordings

No visual changes are expected

Before After
webpack_blob__before_ webpack_blob__after_
webpack_performance__before_ webpack_performance__after_

How to set up and validate locally

Run echo "Feature.enable(:highlight_js_worker)" | gdk rails c

Webpack

  1. Open any source code blob via the repository files browser
  2. The syntax should highlight as expected

Vite

  1. Run echo "Feature.enable(:vite)" | gdk rails c
  2. Launch bundle exec vite dev
  3. Restart GDK
  4. Open any source code blob via the repository files browser
  5. The syntax should highlight as expected

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #415753 (closed)

Edited by Jacques Erasmus

Merge request reports

Loading