-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
chore(shiki): only send required langs to client, and support more on server #7787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #7787 +/- ##
==========================================
+ Coverage 75.35% 75.46% +0.10%
==========================================
Files 96 101 +5
Lines 7861 8309 +448
Branches 192 218 +26
==========================================
+ Hits 5924 6270 +346
- Misses 1936 2037 +101
- Partials 1 2 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Lighthouse Results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refines language loading and exports for rehype-shiki, introducing a minimal build for client usage and expanding server-side language support.
- Refactored plugin export to default and adjusted import paths.
- Consolidated all language registrations in
index.mjsand added a lightweightminimal.mjsfor client-only needs. - Updated package exports, test scripts, and turbo tasks.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/rehype-shiki/turbo.json | Renamed test task to test:unit for Turbo alignment |
| packages/rehype-shiki/src/plugin.mjs | Switched to default export and updated highlightToHast import |
| packages/rehype-shiki/src/minimal.mjs | New minimal highlighter with only PowerShell and ShellScript |
| packages/rehype-shiki/src/languages.mjs | Removed standalone languages file |
| packages/rehype-shiki/src/index.mjs | Inlined all languages into createHighlighter call and reexported utilities |
| packages/rehype-shiki/src/highlighter.mjs | Transformed memoized loader into createHighlighter factory |
| packages/rehype-shiki/src/tests/plugin.test.mjs | Added plugin tests |
| packages/rehype-shiki/src/tests/highlighter.test.mjs | Adjusted tests for new createHighlighter API |
| packages/rehype-shiki/package.json | Switched to conditional exports and updated scripts |
| apps/site/next.mdx.plugins.mjs | Updated the rehype-shiki plugin import path |
| apps/site/components/Downloads/Release/ReleaseCodeBox.tsx | Switched to minimal import for client rendering |
Comments suppressed due to low confidence (2)
packages/rehype-shiki/src/minimal.mjs:1
- There are no tests for
minimal.mjs. Consider adding tests to verify that the minimal highlighter exports (shiki,getLanguageDisplayName,highlightToHast,highlightToHtml) work correctly with the reduced language set.
import powershellLanguage from 'shiki/langs/powershell.mjs';
apps/site/next.mdx.plugins.mjs:3
- The import path for the plugin has changed—update the project’s README or migration guide to show
@node-core/rehype-shiki/pluginas the new import source forrehypeShikiji.
import rehypeShikiji from '@node-core/rehype-shiki/plugin';
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Aviv Keller <me@aviv.sh>
Co-authored-by: Claudio W. <cwunder@gnome.org> Signed-off-by: Aviv Keller <me@aviv.sh>
ovflowd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Can you verify bundle size decrease?
|
(Thanks for the good stuff here ❤️) |
Patchhttps://github.com/nodejs/nodejs.org/actions/runs/15364890771/job/43236518885?pr=7787
|
We use
rehype-shikiinapi-docs-tooling, where these addtl languages are needed