-
Notifications
You must be signed in to change notification settings - Fork 72
use getSingletonHighlighter #250
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
🦋 Changeset detectedLatest commit: 275e38d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
I am actually not sure if it makes a difference as you are already caching the highlighters. I am doing some testing on our frontend to see if it does change things. |
Yeah, the highlighter instances are already cached based on the rehype-pretty-code/packages/core/src/index.ts Lines 188 to 200 in eee1b21
Does the singleton work if you're creating instances with different theme keys in a single process? |
i think it was finally removed in shiki v3 |
Oh does this PR already close #255? |
yep I believe so, the issue title refers to createHighlighter but this use of getSingletonHighlighter should fix it |
Thanks for merging! I think there is also upstream support for rehype now (https://shiki.matsu.io/packages/rehype) |
Yeah that's a good point! When this was first made in 2021, there wasn't any official options but now there's a good one. It doesn't have every feature I think, but it's probably better to try and contribute them to it instead |
Any idea when ya'll might cut a new release with this? |
The
getHighlighter
function has been deprecated and leads to memory issues from what I read.Closes #255