FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

lib: add JSDoc typings for util by rohit-gohri · Pull Request #38213 · nodejs/node · GitHub

/ node Public

lib: add JSDoc typings for util - #38213

Closed
rohit-gohri wants to merge 5 commits into
nodejs:masterfrom
rohit-gohri:jsdoc-util
Closed

lib: add JSDoc typings for util#38213
rohit-gohri wants to merge 5 commits into
nodejs:masterfrom
rohit-gohri:jsdoc-util

Conversation

rohit-gohri commented Apr 12, 2021
edited
Loading

Copy link
Copy Markdown
Contributor

Ref: #38182
Ref: https://twitter.com/bradleymeck/status/1380643627211354115

Added JSDoc typings to lib/util. Most of the typings are pretty simple and direct, all the isThing methods have been typed using type predicates.

callbackify is a bit complex, for this I used the new Leading Rest elements in tuple types to infer types.

Before:

After:

There are still some errors with checkJs enabled that I'm not sure how to fix since we are mutating the original type:

nodejs-github-bot added needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. labels Apr 12, 2021

bmeck commented Apr 12, 2021

Copy link
Copy Markdown
Member

No need to fix all the checkJs errors for now! it is going to be an iterative process that will get easier as more types are added throughout core.

Comment thread lib/util.js Outdated
Comment thread lib/util.js Outdated

bmeck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

nits but LGTM

rohit-gohri and others added 2 commits April 12, 2021 23:15
Co-authored-by: Bradley Farias <bradley.meck@gmail.com>
Co-authored-by: Bradley Farias <bradley.meck@gmail.com>

mhdawson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

This comment has been minimized.

Copy link
Copy Markdown
Collaborator

mhdawson added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Apr 16, 2021

marsonya left a comment
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Many of the util functions are deprecated.
Should we use jsdoc's @deprecated tag to mark them as such?

Comment thread lib/util.js
Comment thread lib/util.js
Comment thread lib/util.js
Comment thread lib/util.js
Comment thread lib/util.js
Comment thread lib/util.js
Comment thread lib/util.js
Comment thread lib/util.js
Comment thread lib/util.js
Comment thread lib/util.js
Comment thread lib/util.js
Comment thread lib/util.js

Copy link
Copy Markdown
Contributor Author

Many of the util functions are deprecated.
Should we use jsdoc's @deprecated tag to mark them as such?

Added @deprecated tags since Typescript does support them (https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#-deprecated--support)

targos commented Apr 20, 2021

Copy link
Copy Markdown
Member

Many of the util functions are deprecated.
Should we use jsdoc's @deprecated tag to mark them as such?

Added @deprecated tags since Typescript does support them (https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#-deprecated--support)

It is supported by TypeScript but the goal of JSDoc in core files is not to duplicate the public-facing documentation. Maybe it's fine in this case, because we don't use these functions in core, but we have to be careful about this (avoid too much duplication, focus on typings and other small changes that help core developers).

targos self-assigned this Apr 24, 2021

Copy link
Copy Markdown
Collaborator

targos pushed a commit that referenced this pull request Apr 24, 2021
PR-URL: #38213
Refs: #38182
Refs: https://twitter.com/bradleymeck/status/1380643627211354115
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

targos commented Apr 24, 2021

Copy link
Copy Markdown
Member

Landed in 767d91b

targos closed this Apr 24, 2021
rohit-gohri deleted the jsdoc-util branch April 24, 2021 12:56
targos pushed a commit that referenced this pull request Apr 29, 2021
PR-URL: #38213
Refs: #38182
Refs: https://twitter.com/bradleymeck/status/1380643627211354115
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos mentioned this pull request May 3, 2021
targos pushed a commit that referenced this pull request May 30, 2021
PR-URL: #38213
Refs: #38182
Refs: https://twitter.com/bradleymeck/status/1380643627211354115
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Jun 5, 2021
PR-URL: #38213
Refs: #38182
Refs: https://twitter.com/bradleymeck/status/1380643627211354115
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Jun 11, 2021
PR-URL: #38213
Refs: #38182
Refs: https://twitter.com/bradleymeck/status/1380643627211354115
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos removed their assignment Oct 31, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL