Skip to content

feat(ui): register bash, java, and pkl Prism grammars for CodeBlock - #8

Merged
baasil (baasilali) merged 2 commits into
mainfrom
feat/codeblock-grammars
Aug 31, 2026
Merged

feat(ui): register bash, java, and pkl Prism grammars for CodeBlock#8
baasil (baasilali) merged 2 commits into
mainfrom
feat/codeblock-grammars

Conversation

@baasilali

Copy link
Copy Markdown
Member

No description provided.

@baasilali baasil (baasilali) self-assigned this Aug 31, 2026
@baasilali baasil (baasilali) added the documentation Improvements or additions to documentation label Aug 31, 2026
@baasilali
baasil (baasilali) requested a lite review from Copilot August 31, 2026 11:19
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 2461f0f.

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.98%. Comparing base (d739ea0) to head (2461f0f).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main       #8      +/-   ##
==========================================
+ Coverage   97.89%   97.98%   +0.08%     
==========================================
  Files          38       39       +1     
  Lines         712      743      +31     
  Branches      318      310       -8     
==========================================
+ Hits          697      728      +31     
  Misses         15       15              
Flag Coverage Δ
ui-browser 97.98% <100.00%> (+0.08%) ⬆️
ui-unit 97.98% <100.00%> (+0.08%) ⬆️

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

Files with missing lines Coverage Δ
packages/ui/src/components/code-block.tsx 100.00% <100.00%> (ø)
packages/ui/src/components/prism-languages.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds additional Prism language grammars to the UI package so CodeBlock can syntax-highlight bash, java, and a custom pkl grammar using the Prism instance shipped with prism-react-renderer.

Changes:

  • Add a side-effect module that registers bash, java, and pkl grammars into Prism.languages.
  • Ensure CodeBlock loads these grammars by importing the registration module.
  • Update package sideEffects configuration intended to prevent tree-shaking of the registration module.
File summaries
File Description
packages/ui/src/components/prism-languages.ts Adds Prism grammar registrations for bash, java, and a custom pkl grammar.
packages/ui/src/components/code-block.tsx Imports the grammar registration module so CodeBlock can highlight the new languages.
packages/ui/package.json Updates sideEffects to try to preserve the side-effectful grammar registration module during bundling.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/ui/package.json
Comment thread packages/ui/src/components/prism-languages.ts Outdated
Comment thread packages/ui/src/components/code-block.tsx
@baasilali
baasil (baasilali) merged commit 8edf5cc into main Aug 31, 2026
9 checks passed
@baasilali
baasil (baasilali) deleted the feat/codeblock-grammars branch August 31, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants