Skip to content

Comments

fix: Shikijs Highlighter のメモ化#26

Merged
a01sa01to merged 8 commits intomainfrom
fix/memorize-shikijs
Nov 14, 2025
Merged

fix: Shikijs Highlighter のメモ化#26
a01sa01to merged 8 commits intomainfrom
fix/memorize-shikijs

Conversation

@a01sa01to
Copy link
Member

メモ化してなかったので怒られた

Copy link
Contributor

Copilot AI left a 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 fixes a performance issue by memoizing the Shiki highlighter instance to avoid re-initializing it on every call to the processor() function.

  • Introduced a module-level variable shikiHighlighter to cache the highlighter instance
  • Added a conditional check to only initialize the highlighter once

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/markdown-processor/src/server/index.ts Adds module-level memoization for the Shiki highlighter instance to prevent repeated initialization
.changeset/petite-points-cheer.md Documents the fix in the changeset for the patch release

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@a01sa01to a01sa01to merged commit c15a374 into main Nov 14, 2025
9 checks passed
@a01sa01to a01sa01to deleted the fix/memorize-shikijs branch November 14, 2025 04:04
@github-actions github-actions bot mentioned this pull request Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants