Fix freezing browser if syntax highlighting large files (#2010)

We unified syntax highlighting and extracted it into a low level module. Syntax highlighting from now on takes place in a web worker, so that the user interface stays responsive. The web worker stops automatically if the number of nodes which should be highlighted exceeds the defined limit we believe the browser can handle.

Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
This commit is contained in:
Matthias Thieroff
2022-04-25 16:34:40 +02:00
committed by GitHub
parent 0e930b8671
commit a0737a2c90
82 changed files with 24217 additions and 24879 deletions

View File

@@ -37,7 +37,7 @@ import {
DiffEventHandler,
File,
FileChangeType,
Hunk
Hunk,
} from "./repos";
export { validation, repositories };
@@ -81,7 +81,7 @@ export { default as CreateTagModal } from "./modals/CreateTagModal";
export { default as CardColumn } from "./CardColumn";
export { default as CardColumnSmall } from "./CardColumnSmall";
export { default as CommaSeparatedList } from "./CommaSeparatedList";
export { default as SplitAndReplace, Replacement } from "./SplitAndReplace";
export { SplitAndReplace, Replacement } from "@scm-manager/ui-text";
export { regExpPattern as changesetShortLinkRegex } from "./markdown/remarkChangesetShortLinkParser";
export * from "./markdown/PluginApi";
export * from "./devices";
@@ -114,7 +114,7 @@ export {
AnnotationFactory,
AnnotationFactoryContext,
DiffEventHandler,
DiffEventContext
DiffEventContext,
};
// Re-export from ui-api
@@ -131,7 +131,7 @@ export {
MissingLinkError,
createBackendError,
isBackendError,
TOKEN_EXPIRED_ERROR_CODE
TOKEN_EXPIRED_ERROR_CODE,
} from "@scm-manager/ui-api";
export { urls };