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: twoslash-svelte #57

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

Feat: twoslash-svelte #57

wants to merge 39 commits into from

Conversation

Hugos68
Copy link

@Hugos68 Hugos68 commented Oct 29, 2024

This PR attempts to create twoslash-svelte which is an extension of twoslashthat supports Svelte.

Copy link

netlify bot commented Oct 29, 2024

Deploy Preview for twoslash ready!

Name Link
🔨 Latest commit be58cda
🔍 Latest deploy log https://app.netlify.com/sites/twoslash/deploys/6726598ef8d4bc000874501f
😎 Deploy Preview https://deploy-preview-57--twoslash.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.

@Hugos68 Hugos68 marked this pull request as draft October 30, 2024 09:13
@Hugos68
Copy link
Author

Hugos68 commented Oct 31, 2024

@antfu @orta
A review would be appreiciated, I'm now at a point where I feel confident I have the code working. I was able to copy some code from twoslash-vue as it works similarly (convert source to tsx then typecheck and use sourcemaps to backtrack the original location).

All that's left is tests.

@orta
Copy link
Member

orta commented Oct 31, 2024

From a high level, this looks very cool to me!

@Hugos68
Copy link
Author

Hugos68 commented Oct 31, 2024

@antfu There seems to be a bug related to the $ inside twoslash or @shikijs/vitepress-twoslash. Everytime a variable has the $ inside of it there are 2 popups:

1: image
2: image

As you can see both popups show information about $state but one is at the first index of the word and the other is at the middle index (which is the correct one). Why is there an extra popup for the $?

In the HTML output you can see that instead of a single span the $ and state are seperated:
image

@Hugos68
Copy link
Author

Hugos68 commented Nov 1, 2024

Also, for some reason twoslash-vue test aren't passing anymore, I have no clue why as I didn't touch the tests from twoslash-vue.

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