Skip to content

MarkdownRenderer: disable HLJS#57

Merged
gapry merged 1 commit intomainfrom
HLJS-disable
Apr 1, 2026
Merged

MarkdownRenderer: disable HLJS#57
gapry merged 1 commit intomainfrom
HLJS-disable

Conversation

@gapry
Copy link
Copy Markdown
Owner

@gapry gapry commented Apr 1, 2026

No description provided.

Copy link
Copy Markdown

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This PR disables HLJS syntax highlighting and updates the layout max-width from 1024px to 800px. While the changes work correctly, there are dead code issues that should be addressed before merge.

Critical Issues

  • Dead Code: Disabling HLJS by emptying HLJS_LANGS leaves unused imports, registrations, and the entire HLJSCodeBlock component in the bundle, unnecessarily increasing bundle size.

Recommended Actions

Remove all HLJS-related code:

  • Lines 7, 9: HLJS imports
  • Lines 12-13: Language imports (x86asm, armasm)
  • Lines 15-16: Language registrations
  • Lines 20-29: HLJSCodeBlock component

You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

HLJSHighlighter.registerLanguage('armasm', armasm);

const HLJS_LANGS = ['x86asm', 'armasm'];
const HLJS_LANGS = []; // ['x86asm', 'armasm'];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Dead Code: Remove unused HLJS imports and registrations on lines 7, 9, 12-13, and 15-16. Since HLJS_LANGS is now empty, the HLJSHighlighter import, HLJSStyles import, language imports (x86asm, armasm), and registerLanguage calls serve no purpose and unnecessarily increase bundle size.

HLJSHighlighter.registerLanguage('armasm', armasm);

const HLJS_LANGS = ['x86asm', 'armasm'];
const HLJS_LANGS = []; // ['x86asm', 'armasm'];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Dead Code: Remove the HLJSCodeBlock component on lines 20-29. Since HLJS_LANGS is empty, isHLJS on line 49 will always be false, making this component unreachable and unnecessarily increasing bundle size.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request reduces the maximum width of the application layout to 800px and updates the Markdown renderer's syntax highlighting theme. Feedback was provided regarding the disabling of Highlight.js languages, which currently leaves behind unused imports and dead code that should be removed to optimize the bundle.

HLJSHighlighter.registerLanguage('armasm', armasm);

const HLJS_LANGS = ['x86asm', 'armasm'];
const HLJS_LANGS = []; // ['x86asm', 'armasm'];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Emptying HLJS_LANGS effectively disables the feature, but it leaves behind significant dead code, including unused imports (HLJSHighlighter, HLJSStyles, x86asm, armasm), language registrations (lines 15-16), and the HLJSCodeBlock component (lines 20-29). This results in unnecessary code being included in the production bundle. If HLJS is no longer required, consider removing all related logic and dependencies to optimize the application. Additionally, avoid leaving commented-out code in the source.

Suggested change
const HLJS_LANGS = []; // ['x86asm', 'armasm'];
const HLJS_LANGS = [];

@gapry gapry merged commit 7aa1fea into main Apr 1, 2026
2 checks passed
@gapry gapry deleted the HLJS-disable branch April 1, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant