shikijs / twoslash

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples
https://shikijs.github.io/twoslash/
MIT License
1.08k stars 54 forks source link

markdown-it-shiki-twoslash doesn't render code examples #124

Open JessicaSachs opened 3 years ago

JessicaSachs commented 3 years ago

I tried to swap out the default Shiki markdown support from Vitesse to use shiki twoslash. It worked well for my dev server, but when I went to build for prod, I realized it wasn't working. The async nature of the Markdownit/remark interop was causing a race condition to occur that was covered up by my build's HMR. 😢

Since it was a race condition, I was pretty sure it had something to do with Markdown It's need for sync and Remark's need for async being incompatible. Because the MarkdownIt and Remark interop relies on deasync I made a go at swapping that out for synckit which uses worker threads, instead of the (seemingly broken) deasync hack. I wasn't able to get very far.

Can someone make sure this plugin is still working?

Node: v14.17.4 OSX Monterey 12.0.1

Screen Shot 2021-11-12 at 12 18 39 AM

orta commented 3 years ago

I think you're between a rock and a hard place, shiki can't go sync and markdown-it won't support async calls