mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: Move highlightjs to a background worker, and add result cache (#10191)
Syntax highlighting is a CPU-intensive process which we run a lot while rendering posts and while using the composer preview. Moving it to a background worker releases the main thread to the browser, which makes the UX much smoother.
This commit is contained in:
@@ -469,7 +469,8 @@ module ApplicationHelper
|
||||
default_locale: SiteSetting.default_locale,
|
||||
asset_version: Discourse.assets_digest,
|
||||
disable_custom_css: loading_admin?,
|
||||
highlight_js_path: HighlightJs.path,
|
||||
highlight_js_url: HighlightJs.path,
|
||||
highlight_js_worker_url: script_asset_path('highlightjs-worker'),
|
||||
svg_sprite_path: SvgSprite.path(theme_ids),
|
||||
enable_js_error_reporting: GlobalSetting.enable_js_error_reporting,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user