Bugfix: PrismJS loading improvements & error handling#988
Merged
Conversation
…s (including plugins & languages) to streamline the update process & to switch to minified versions
…dd error handling for loading static resources Now when there's an issue loading static resources or executing Prism, the LWC should (hopefully) show a fallback version of the code snippet - it won't look as nice as the Prism version, but it will let users see the relevant data, instead of endless displaying a spinner ~_~
jamessimone
reviewed
May 12, 2026
…Prism directory, as well as a themes subdirectory This is all a bit of a prefactor for eventually having other static resource files, and possibly supporting other Prism themes in the future
…-standing issue where calling Prism.highlightAll() twice was previously needed
60aa035 to
05eadeb
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #988 +/- ##
==========================================
+ Coverage 93.35% 93.76% +0.40%
==========================================
Files 58 58
Lines 6306 6335 +29
Branches 200 204 +4
==========================================
+ Hits 5887 5940 +53
+ Misses 413 393 -20
+ Partials 6 2 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Owner
Author
|
This has been released in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed #963 by making a few changes to the LWC
loggerCodeViewer, used to display code snippets using PrismJSimportcan cause the Prism JS file to not load/execute successfully (╯‵□′)╯︵┻━┻Prism.highlightAll()twice was previously neededlogEntryMetadataViewerto better cover the current functionalityScreenshots
When 1 or more of the Prism static resources can't be loaded or executed,
loggerCodeViewerwill now show the code snippet without Prism formatting/highlighting (previously, alightning-spinnerjust endlessly displayed). Corresponding error messages are also printed in the browser's consoleWith the changes to use a minified version of Prism, it now successfully loads again (visually, this looks the same as before these recent issues started happening with Prism)