Skip to content
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

feat(vitepress-twoslash): cache type informations to improve performance #798

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nakasyou
Copy link

@nakasyou nakasyou commented Oct 4, 2024

Description

VitePress Twoslash takes a long time to render large Types.
This PR solves part of this.

This PR can cache type information with the following code:

export default defineConfig({
  markdown: {
    codeTransformers: [
      transformerTwoslash({
        typesCacheDir: './my-custom-cache-dir'
      })
    ]
  }
})

This will cache the type information in the specified directory.
Use a cache such as GitHub Actions with this to speed up your builds

Linked Issues

Nothing

Additional context

ElysiaJS appears to have cut back on Twoslash because it took 30 minutes to build the documentation. This PR may resolve it.
https://x.com/saltyAom/status/1842140132897615963

Copy link

netlify bot commented Oct 4, 2024

Deploy Preview for shiki-matsu ready!

Name Link
🔨 Latest commit 74575bc
🔍 Latest deploy log https://app.netlify.com/sites/shiki-matsu/deploys/66fffb190951ef000910cf20
😎 Deploy Preview https://deploy-preview-798--shiki-matsu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 4, 2024

Deploy Preview for shiki-next ready!

Name Link
🔨 Latest commit 74575bc
🔍 Latest deploy log https://app.netlify.com/sites/shiki-next/deploys/66fffb195a9ad60008c78f72
😎 Deploy Preview https://deploy-preview-798--shiki-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nakasyou nakasyou changed the title feat(vitepress-twoslash): cache type infomations feat(vitepress-twoslash): cache type informations to improve performance Oct 6, 2024
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.

1 participant