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: setup twoslash for codeblocks #2668

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

antfu
Copy link
Member

@antfu antfu commented Jan 15, 2024

This is working now, but with a few caveats:

Preview

image

Short-term

Long-term

  • __VUE_OPTIONS_API__: true is required at this moment because floating-vue is still using Options API
  • shamefully-hoist=true is required at this moment for twoslash to resolve the types correctly

And later we need to revise code blocks across the docs to add the twoslash flag.

Copy link

netlify bot commented Jan 15, 2024

Deploy Preview for vuejs ready!

Name Link
🔨 Latest commit c417157
🔍 Latest deploy log https://app.netlify.com/sites/vuejs/deploys/65e72cc7e95a7e0008476cf4
😎 Deploy Preview https://deploy-preview-2668--vuejs.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.

@antfu antfu marked this pull request as ready for review February 6, 2024 14:25
@antfu
Copy link
Member Author

antfu commented Feb 6, 2024

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

@NataliaTepluhina
Copy link
Member

@antfu thank you for working on this! Looks great ✨

Could you please resolve the conflicts? I'll merge the PR and add twoslash to the codeblocks

@brc-dd
Copy link
Member

brc-dd commented Feb 17, 2024

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.

@yyx990803
Copy link
Member

Let's enable Options API then, it's ok for now until we have a version of floating-vue that is Composition API based.

@antfu
Copy link
Member Author

antfu commented Mar 5, 2024

Should be good to go now

@yyx990803
Copy link
Member

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.

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.

4 participants