twoslash
twoslash copied to clipboard
11ty plugin is not practical to use
Hi,
Thanks for your great work!
At the moment, the 11ty plugin is not practical to use. I am currently migrating a website to 11ty with 100 pages and the build time is 1.5seconds, with incremental builds a file change reloads in milliseconds. If I add the twoslash plugin, it pushes the build time to 8 seconds, and incremental builds take the same time. Having that as a dev mode experience is too painful.
The issue is clear, twoslash needs to run async and 11ty does not permit this behavior. I made a feature request with 11ty to enable plugins to be async. You can upvote that issue to help resolve this bottleneck.
That's pretty wild - there's result caching inside shiki-twoslash which might not be happening for some reason? (It's been a long time since I've looked in the code) which should just cache all the twoslash work, but still run the syntax highlighter at runtime. This was enough to make it usable on the place I was using it.