Skip to content

Draft: Highlight all source code in a webworker instead of highlighting in chunks

Jacques Erasmus requested to merge 366531-source-viewer-webworker into master

What does this MR do and why?

Currently, we highlight source code in chunks dynamically as the user scrolls. While this gives us a lot of performance benefits, highlight.js can lose context of what is being highlighted. Highlighting will be more accurate if all of the source code is highlighted upfront.

This MR highlights all source code in a webworker instead of highlighting in chunks, and then splits the result from highlight.js into chunks that can be rendered as the user scrolls.

Screenshots or screen recordings

TODO

How to set up and validate locally

  1. Open a large Source File sample.
  2. The file should be highlighted 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 #366531 (closed)

Merge request reports