-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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: setup twoslash for codeblocks #2668
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for vuejs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I think it's ready now. The only thing is that if we should bring Options API or wait for Floating Vue to adopt to Composition API only |
@antfu thank you for working on this! Looks great ✨ Could you please resolve the conflicts? I'll merge the PR and add |
I'll release vitepress by tomorrow. It will have shiki@v1. We can remove resolutions from package.json here. Also, is it possible to use the older code background with twoslash? github-dark's default background doesn't look nice with other stuff. |
Let's enable Options API then, it's ok for now until we have a version of |
Should be good to go now |
I think we need to be a bit selective on where to use these, let me take a pass on the rest of the docs so it doesn't become distractive. |
This is working now, but with a few caveats:
Preview
Short-term
twoslash
is not stable yet: https://github.com/twoslashes/twoslashUsingshikiji
's beta https://shikiji.netlify.app/packages/twoslash, which is wait fortwoslash
Onceshikiji
v0.10 released and VitePress upgrade to it, the pnpm overrides can be removedLong-term
__VUE_OPTIONS_API__: true
is required at this moment becausefloating-vue
is still using Options APIshamefully-hoist=true
is required at this moment fortwoslash
to resolve the types correctlyAnd later we need to revise code blocks across the docs to add the
twoslash
flag.