nodejs / nodejs/undici

use jsdoc to generate typings

Open
#3,584 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
7.7k
Forks
880
Avg merge
2d 16h
Merged PRs (30d)
68

Description

This would solve...

Currently typings have to written by hand.

The implementation should look like...

We need to crank up the use of jsdoc and then we can use typescript to generate the typings.

The first thing what we can do is to make it mandatory to write correct jsdoc for new features.
Then we should integrate the typescript typings as jsdoc into our javascript code.
When all typings are migrated to javascript, we could generate the typings directly from the jsdoc and should not break the typings.

It is still necessary to use tsd to ensure that the typings are implemented right.

I have also considered...

N.A.

Additional context

I created a PR #3579 as a possible solution.

If we consider this as good feature, I would look if we can transform iteratively.

Also we should consider to strip the jsdoc and all the comments when we build for node to ensure that we dont bloat the final file.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing PR #3579 and the current tsd checks; no implementation files are named in the issue. Map how typings and JavaScript are currently maintained, then define an incremental migration plan. Done would mean typings can be generated from JSDoc without breaking the tsd checks, with build output considered separately.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
build-system, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.