Skip to content

Bugfix: PrismJS loading improvements & error handling#988

Merged
jongpie merged 9 commits into
mainfrom
bugfix/prism-js-improvements-and-error-handling
May 13, 2026
Merged

Bugfix: PrismJS loading improvements & error handling#988
jongpie merged 9 commits into
mainfrom
bugfix/prism-js-improvements-and-error-handling

Conversation

@jongpie
Copy link
Copy Markdown
Owner

@jongpie jongpie commented May 12, 2026

Fixed #963 by making a few changes to the LWC loggerCodeViewer, used to display code snippets using PrismJS

  • Added error handling to help surface issues with loading Prism static resources, and added logic to still display code content when loading Prism fails for some reason
  • Created a new node script to auto-retrieve & auto-minify PrismJS files (including plugins, languages, and themes) to streamline the update process
  • Switched to using minified versions of Prism JS & CSS files to avoid a crazy issue within the platform where comments containing the text import can cause the Prism JS file to not load/execute successfully (╯‵□′)╯︵┻━┻
  • Finally fixed a long-standing issue where calling Prism.highlightAll() twice was previously needed
  • Updated folder structure for static resources to include a dedicated Prism directory, as well as a themes subdirectory
  • Expanded tests for LWC logEntryMetadataViewer to better cover the current functionality

Screenshots

  • When 1 or more of the Prism static resources can't be loaded or executed, loggerCodeViewer will now show the code snippet without Prism formatting/highlighting (previously, a lightning-spinner just endlessly displayed). Corresponding error messages are also printed in the browser's console

    image
  • With 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)

    image

jongpie added 4 commits May 12, 2026 00:19
…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 ~_~
@jongpie jongpie added Type: Bug Something isn't working optimization devops Items related to tooling, automation, and guidelines used for developing Nebula Logger Package Type: Managed Package Issues and enhancements that specifically apply to the managed package Layer: Log Management Items related to the custom objects & Logger Console app Package Type: Unlocked Package Issues and enhancements that specifically apply to the unlocked package dependencies Pull requests that update a dependency file Salesforce issue labels May 12, 2026
@jongpie jongpie temporarily deployed to Advanced Scratch Org May 12, 2026 04:25 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Base Scratch Org May 12, 2026 04:25 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Event Monitoring Scratch Org May 12, 2026 04:25 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Platform Cache Scratch Org May 12, 2026 04:37 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org May 12, 2026 04:39 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to OmniStudio Scratch Org May 12, 2026 04:40 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Base Scratch Org May 12, 2026 04:55 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Base Scratch Org May 12, 2026 05:08 — with GitHub Actions Inactive
jongpie added 2 commits May 12, 2026 13:13
…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
@jongpie jongpie force-pushed the bugfix/prism-js-improvements-and-error-handling branch from 60aa035 to 05eadeb Compare May 12, 2026 17:14
@jongpie jongpie had a problem deploying to Advanced Scratch Org May 12, 2026 17:16 — with GitHub Actions Failure
@jongpie jongpie had a problem deploying to Event Monitoring Scratch Org May 12, 2026 17:16 — with GitHub Actions Error
@jongpie jongpie temporarily deployed to Advanced Scratch Org May 12, 2026 17:26 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Event Monitoring Scratch Org May 12, 2026 17:26 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Base Scratch Org May 12, 2026 17:26 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Platform Cache Scratch Org May 12, 2026 17:37 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to OmniStudio Scratch Org May 12, 2026 17:42 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org May 12, 2026 17:44 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Base Scratch Org May 12, 2026 18:01 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Base Scratch Org May 12, 2026 18:12 — with GitHub Actions Inactive
@jongpie jongpie had a problem deploying to Event Monitoring Scratch Org May 13, 2026 17:12 — with GitHub Actions Failure
@jongpie jongpie had a problem deploying to Advanced Scratch Org May 13, 2026 17:12 — with GitHub Actions Error
@jongpie jongpie temporarily deployed to Event Monitoring Scratch Org May 13, 2026 17:15 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Advanced Scratch Org May 13, 2026 17:15 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Base Scratch Org May 13, 2026 17:15 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Platform Cache Scratch Org May 13, 2026 17:26 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to OmniStudio Scratch Org May 13, 2026 17:31 — with GitHub Actions Inactive
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.76%. Comparing base (62ceb99) to head (1854e82).

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     
Flag Coverage Δ
Apex 93.09% <ø> (ø)
LWC 96.27% <100.00%> (+1.91%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org May 13, 2026 17:38 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Base Scratch Org May 13, 2026 17:50 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Base Scratch Org May 13, 2026 18:04 — with GitHub Actions Inactive
@jongpie jongpie merged commit 05ce16c into main May 13, 2026
1 check passed
@jongpie jongpie deleted the bugfix/prism-js-improvements-and-error-handling branch May 13, 2026 19:26
@jongpie
Copy link
Copy Markdown
Owner Author

jongpie commented May 13, 2026

This has been released in v4.18.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file devops Items related to tooling, automation, and guidelines used for developing Nebula Logger Layer: Log Management Items related to the custom objects & Logger Console app optimization Package Type: Managed Package Issues and enhancements that specifically apply to the managed package Package Type: Unlocked Package Issues and enhancements that specifically apply to the unlocked package Salesforce issue Type: Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

logEntryMetadataViewer only displays spinner

3 participants