You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit addresses issue ibelick#103 by implementing a singleton pattern for the Shiki highlighter instance. It ensures that instances are reused and properly disposed of, preventing memory leaks and performance degradation during hot reloads.
This commit addresses issue ibelick#103 by implementing a singleton pattern for the Shiki highlighter instance. It ensures that instances are reused and properly disposed of, preventing memory leaks and performance degradation during hot reloads.
We have an issue where Shiki highlighter instances accumulate during hot reloads, leading to performance degradation. Console logs show: path
/docs/*
Steps to Reproduce
npm run dev
).Expected Behavior
Shiki should be used as a singleton, with instances disposed of during hot reloads.
Actual Behavior
Multiple Shiki instances are created without disposal, resulting in warnings:
Shiki is supposed to be used as a singleton; consider refactoring your code...
Proposed Solution
Refactor to implement a singleton pattern for the Shiki highlighter instance, disposing of it only when necessary.
I will submit a pull request to address this issue soon.
The text was updated successfully, but these errors were encountered: