honojs / website

Repository for hono.dev
https://hono.dev
68 stars 217 forks source link

feat: Support vitepress-twoslash #253

Open shinGangan opened 4 months ago

shinGangan commented 4 months ago

🔗 Issues

🙋 Description

Support for using @shikijs/vitepress-twoslash in documents.

📸 Usage and Captured image

```ts twoslash
import { Hono } from 'hono'

const app = new Hono()

app.get('/', (c) => {
  return c.text('Hello Hono!')
})

export default app


show ↓

<img width="500" src="https://github.com/honojs/website/assets/44604921/57261913-7a6c-4dca-9257-1450a672dc95" />

### ☑️ Checklist

- [ ] linked an issue or discussion
- [x] add example

### 📗 Note

I believe there is still some debate on such issues as "should it be displayed on all pages?"
Therefore, this PR focuses on "building the environment."

This PR is for use when “We want to use Twoslash on Hono.dev as well".
shinGangan commented 4 months ago

Hi @yusukebe .

We consider this PR to be a very low priority for review. Therefore, we would appreciate a review when you are available. 🙇

yusukebe commented 4 months ago

Hi @shinGangan

This is a super cool feature!!

In Hono, however, we must consider whether to introduce it. This is because the types in Hono are so complex that users often do not immediately understand them when they see them.

For example, the HandlerInterface has more than 20 overloads.

Screenshot 2024-02-24 at 22 32 37

So, I am not sure if this is for the benefit of the real users. However, it is an awesome cool feature, so let's leave this PR open.

Thanks!

shinGangan commented 4 months ago

In Hono, however, we must consider whether to introduce it.

I agree with you on this. The same reason we have not made any updates to the documentation within this PR.

Whether this feature is really necessary for Hono and Hono users needs to be scrutinized within the team.