Skip to content

Type Info on the Docs & Guides #7932

Description

@flakey5

Enter your suggestions in details:

Provide type info for code snippets on the docs and guides. For reference, see Hono's docs: https://hono.dev/docs/concepts/middleware.

This is very much so in the backlog until we have less things to do

(slack convo https://openjs-foundation.slack.com/archives/CVAMEJ4UV/p1751225431726929)

Activity

  1. avivkeller commented on Jul 1, 2025

    @avivkeller
    Member

    The program to do this is https://github.com/twoslashes/twoslash

  2. AugustinMauroy commented on Jul 2, 2025

    @AugustinMauroy
    Member

    The program to do this is https://github.com/twoslashes/twoslash

    same author than skiki.

    It's will be easy to setup (I think) https://twoslash.netlify.app/guide/highlight

  3. ovflowd commented on Jul 13, 2025

    @ovflowd
    Member
    Image
  4. avivkeller commented on Jul 13, 2025

    @avivkeller
    Member

    I've been experimenting with Twoslash today, and there's a slight issue: Twoslash relies on @types/node for type-definitions of a given function. When we publish a new version of Node.js, @types/node is not updated, so the types don't match the version of Node.js we are publishing.

    So, while twoslash will work on the guides, it may be difficult to get it set up on the docs.

  5. ovflowd commented on Jul 13, 2025

    @ovflowd
    Member

    Maybe we can reach out maintainers of two slash? And see if they can support us?

  6. avivkeller commented on Jul 14, 2025

    @avivkeller
    Member

    Maybe we can reach out maintainers of two slash? And see if they can support us?

    I mean, hypothetically, we could use a custom wrapper around twoslash which pulls the data from the documentation that we are generating, but that's a decent amount of boilerplate.

  7. ovflowd commented on Jul 14, 2025

    @ovflowd
    Member

    I'd rather reach out their maintainer

  8. avivkeller commented on Jul 14, 2025

    @avivkeller
    Member

    I'd rather reach out their maintainer

    And say what? That we need them to perform tedious typing on every Node.js release before it comes out?

    I don't think that's a feasible request.

  9. ovflowd commented on Jul 14, 2025

    @ovflowd
    Member

    No, the suggestion would be for somehow the package to support external references of types. After all the @types/node package is generated pretty much out of our JSON schema (generator)

  10. avivkeller commented on Jul 14, 2025

    @avivkeller
    Member

    No, the suggestion would be for somehow the package to support external references of types

    Ah, ok.

    Currently, our documentation generator is configured to allow each document to be generated independently (i.e., the sidebar is built from index.md rather than from a combined set of headers across all files). If we integrate Twoslash using an external reference, would that affect this setup, since (and I may be wrong) it would require loading all the documentation?

  11. self-assigned this
    on Sep 25, 2025
  12. moved this from 📋 Backlog to 🏗 In progress in Node.js Websiteon Sep 25, 2025
  13. moved this from 🏗 In progress to 👀 In review in Node.js Websiteon Sep 25, 2025
  14. moved this from 👀 In review to ✅ Done in Node.js Websiteon Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions