[PR #347] [MERGED] fix: enhance performance for codeblock #440

Closed
opened 2026-02-15 19:17:41 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/create-llama/pull/347
Author: @thucpn
Created: 10/7/2024
Status: Merged
Merged: 10/15/2024
Merged by: @marcusschiesser

Base: mainHead: fix/enhance-performance-for-code-block


📝 Commits (7)

  • cfa52dd fix: enhance performance for codeblock
  • de9d816 Merge branch 'main' into fix/enhance-performance-for-code-block
  • bdc59ef fix: use highlight.js instead of react-syntax-hightlighter
  • e6f01da fix: custom font
  • dba4f3b fix: package deps
  • 3fd0aa5 fix: add margin
  • 991a613 Update templates/types/streaming/nextjs/app/components/ui/chat/chat-message/codeblock.tsx

📊 Changes

4 files changed (+25 additions, -38 deletions)

View changed files

📝 helpers/typescript.ts (+1 -6)
📝 templates/types/streaming/nextjs/app/components/ui/chat/chat-message/codeblock.tsx (+21 -29)
📝 templates/types/streaming/nextjs/app/components/ui/chat/chat-message/markdown.tsx (+1 -0)
📝 templates/types/streaming/nextjs/package.json (+2 -3)

📄 Description

Currently, asking AI for generating inline code will make browser tag so lag.
The root cause is may because react-syntax-highlight re-render too many times.

image

Summary by CodeRabbit

  • New Features

    • Enhanced code block rendering with improved syntax highlighting using highlight.js.
    • Improved styling for code blocks and citation links in the Markdown component.
    • Expanded configurability for template installation, allowing for better handling of different frameworks and options.
  • Bug Fixes

    • Removed outdated dependencies related to the previous syntax highlighting library, ensuring smoother performance.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/create-llama/pull/347 **Author:** [@thucpn](https://github.com/thucpn) **Created:** 10/7/2024 **Status:** ✅ Merged **Merged:** 10/15/2024 **Merged by:** [@marcusschiesser](https://github.com/marcusschiesser) **Base:** `main` ← **Head:** `fix/enhance-performance-for-code-block` --- ### 📝 Commits (7) - [`cfa52dd`](https://github.com/run-llama/create-llama/commit/cfa52ddc18bb57b934fa2671e96473254f075184) fix: enhance performance for codeblock - [`de9d816`](https://github.com/run-llama/create-llama/commit/de9d81673c2caceedda03cf31b1cdbc51cc7a43a) Merge branch 'main' into fix/enhance-performance-for-code-block - [`bdc59ef`](https://github.com/run-llama/create-llama/commit/bdc59eff29062bffccde321f468222fbce1aa16a) fix: use highlight.js instead of react-syntax-hightlighter - [`e6f01da`](https://github.com/run-llama/create-llama/commit/e6f01da102ec4359308a78b45f2238c79c6f992c) fix: custom font - [`dba4f3b`](https://github.com/run-llama/create-llama/commit/dba4f3b777cea6de1683634f5c7fcee26a32229e) fix: package deps - [`3fd0aa5`](https://github.com/run-llama/create-llama/commit/3fd0aa5f6403d4f980533204d7b017ea8b7c9ac3) fix: add margin - [`991a613`](https://github.com/run-llama/create-llama/commit/991a61387131404189937d7c116b4dd77e04da58) Update templates/types/streaming/nextjs/app/components/ui/chat/chat-message/codeblock.tsx ### 📊 Changes **4 files changed** (+25 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `helpers/typescript.ts` (+1 -6) 📝 `templates/types/streaming/nextjs/app/components/ui/chat/chat-message/codeblock.tsx` (+21 -29) 📝 `templates/types/streaming/nextjs/app/components/ui/chat/chat-message/markdown.tsx` (+1 -0) 📝 `templates/types/streaming/nextjs/package.json` (+2 -3) </details> ### 📄 Description Currently, asking AI for generating inline code will make browser tag so lag. The root cause is may because react-syntax-highlight re-render too many times. ![image](https://github.com/user-attachments/assets/2aab414a-d364-4f58-a63c-52932a91a63f) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced code block rendering with improved syntax highlighting using `highlight.js`. - Improved styling for code blocks and citation links in the Markdown component. - Expanded configurability for template installation, allowing for better handling of different frameworks and options. - **Bug Fixes** - Removed outdated dependencies related to the previous syntax highlighting library, ensuring smoother performance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 19:17:41 -05:00
yindo closed this issue 2026-02-15 19:17:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/create-llama#440