---
id: 7788
title: 'Epic: Unify highlight.js architecture for Browser and SSR'
state: CLOSED
labels:
  - enhancement
  - ai
assignees:
  - tobiu
createdAt: '2025-11-18T09:24:44Z'
updatedAt: '2025-11-18T20:07:27Z'
githubUrl: 'https://github.com/neomjs/neo/issues/7788'
author: tobiu
commentsCount: 0
parentIssue: null
subIssues:
  - '[x] 7791 Refactor ContentComponent to use new highlight.js utilities'
subIssuesCompleted: 1
subIssuesTotal: 1
blockedBy: []
blocking: []
closedAt: '2025-11-18T20:07:27Z'
---
# Epic: Unify highlight.js architecture for Browser and SSR

Our goal is to unify the code highlighting logic across the entire platform, making it work seamlessly for both client-side rendering (in the browser) and server-side rendering (in Node.js). This will allow us to remove the dependency on the main-thread  addon and simplify the architecture.

The core challenge is that the stock  npm package is a CommonJS module, which is incompatible with the Neo.mjs zero-builds development environment in the browser.

## The Plan

This epic will be achieved by completing the following sub-tasks:

1.  **Create a Universal ESM Bundle for  (#7790):** We will build our own custom, lightweight ES module version of  that includes only the languages our project needs. This single bundle will work in both Node.js and the browser.
2.  **Create a Line Numbering Utility (#7789):** We will create a simple, dependency-free utility to add line number markup to the HTML generated by .
3.  **Refactor  (#7791):** Once the utilities are in place, we will refactor  to use them directly, removing the old main thread addon and consolidating all styling into a single, reusable SCSS file.

## Timeline

- 2025-11-18T09:24:46Z @tobiu added the `enhancement` label
- 2025-11-18T09:24:46Z @tobiu added the `ai` label
- 2025-11-18T09:44:36Z @tobiu cross-referenced by #7789
- 2025-11-18T09:44:47Z @tobiu assigned to @tobiu
- 2025-11-18T10:13:59Z @tobiu added sub-issue #7791
- 2025-11-18T10:21:43Z @tobiu changed title from **Create a node-compatible highlight.js utility for SSR** to **Epic: Unify highlight.js architecture for Browser and SSR**
- 2025-11-18T20:07:27Z @tobiu closed this issue

