LearnNewsExamplesServices
Frontmatter
id7791
titleRefactor ContentComponent to use new highlight.js utilities
stateClosed
labels
enhancementairefactoring
assigneestobiu
createdAtNov 18, 2025, 11:13 AM
updatedAtNov 18, 2025, 8:27 PM
githubUrlhttps://github.com/neomjs/neo/issues/7791
authortobiu
commentsCount0
parentIssue7788
subIssues
7789 Create a utility for highlight.js line numbers
7790 Create a universal ESM bundle for highlight.js
subIssuesCompleted2
subIssuesTotal2
blockedBy[]
blocking[]
closedAtNov 18, 2025, 8:27 PM

Refactor ContentComponent to use new highlight.js utilities

Closed v11.5.0 enhancementairefactoring
tobiu
tobiu commented on Nov 18, 2025, 11:13 AM

With the creation of a universal highlight.js bundle (#7790) and a HighlightJsLineNumbers utility (#7789), we can now refactor Portal.view.learn.ContentComponent to use this new, unified, and synchronous approach.

This will remove the dependency on the main thread addon for highlighting and simplify the component's logic.

Plan

  1. Once #7790 and #7789 are complete, refactor ContentComponent.mjs.
  2. Remove all usages of Neo.main.addon.HighlightJS.
  3. Import the new Neo.util.Highlight and Neo.util.HighlightJsLineNumbers utilities.
  4. Change the processReadonlyCodeBlocks method to be synchronous, using the new utilities to process code blocks.
  5. Create a new SCSS file resources/scss/src/util/Highlight.scss.
  6. Move the styles from apps/portal/resources/lib/highlightjs-custom-github-theme.css and the line number styles into this new file.
  7. Ensure the new SCSS file is imported and used by the portal application.
  8. Remove the old CSS files (highlightjs-custom-github-theme.css, highlightjs-custom-dark-theme.css). The dark theme can be re-added later if needed, using SCSS variables.
tobiu added the enhancement label on Nov 18, 2025, 11:13 AM
tobiu added the ai label on Nov 18, 2025, 11:13 AM
tobiu added the refactoring label on Nov 18, 2025, 11:13 AM
tobiu added sub-issue #7789 on Nov 18, 2025, 11:13 AM
tobiu added sub-issue #7790 on Nov 18, 2025, 11:13 AM
tobiu added parent issue #7788 on Nov 18, 2025, 11:13 AM
tobiu cross-referenced by #7788 on Nov 18, 2025, 11:16 AM
tobiu assigned to @tobiu on Nov 18, 2025, 11:23 AM
tobiu cross-referenced by #7790 on Nov 18, 2025, 1:12 PM
tobiu referenced in commit 8f1d7b7 - "Refactor ContentComponent to use new highlight.js utilities #7791 & added Neo.util.HighlightJs" on Nov 18, 2025, 7:21 PM
tobiu referenced in commit 4d45226 - "#7791 theming" on Nov 18, 2025, 7:45 PM
tobiu referenced in commit 5132316 - "#7791 portal app: removed custom hljs resources, using our new util class now" on Nov 18, 2025, 8:22 PM
tobiu referenced in commit b0edcaa - "#7791 removed the highlightjs devDependency (not needed when cloning the repo)" on Nov 18, 2025, 8:27 PM
tobiu closed this issue on Nov 18, 2025, 8:27 PM