Closed antfu closed 3 months ago
Name | Link |
---|---|
Latest commit | 850a2a7ac156fbf4686c718a5b370f4d2c35680c |
Latest deploy log | https://app.netlify.com/sites/shiki-matsu/deploys/6675a884b1a9990008387590 |
Deploy Preview | https://deploy-preview-702--shiki-matsu.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Name | Link |
---|---|
Latest commit | 850a2a7ac156fbf4686c718a5b370f4d2c35680c |
Latest deploy log | https://app.netlify.com/sites/shiki-next/deploys/6675a8840eedf80008ebf851 |
Deploy Preview | https://deploy-preview-702--shiki-next.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Attention: Patch coverage is 90.55118%
with 12 lines
in your changes missing coverage. Please review.
Project coverage is 96.31%. Comparing base (
2468337
) to head (850a2a7
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The function name
getHighlighter
, inherited from Shiki v0.x, which is somehow confusing. While it is supposed to be a singleton, we see people using it incorrectly in components or loops:693
567
While we improved the docs in https://github.com/shikijs/shiki/commit/412fe10ef185a329ca9d5e2f722751e3cd7389a5, I think the confusing still down to the name prefix
get
reads like it will retrieve the global instance, while it actually not. In the actual behavior, it's more likecreate
a new instance every time calling the function, thus this PR propose renaming:getHighlighter
tocreateHighlighter
getHighlighterCore
tocreateHighlighterCore
getShikiInternal
tocreateShikiInternal
Alternatively, we encourage users to use
getSingletonHighlighter
instead, where it holds the singleton instance underneath, and loads new themes/languages automatically.Changes rolling out plan
createHighlighter
getSingletonHighlighter
functions. All docs change tocreate*
version. APIs likegetHighlighter
are shims to behave like before, but marked as deprecate on the type level.getHighlighter
etc.