Skip to content

util: doc deprecate legacy inspect signature - #22753

Closed
refack wants to merge 1 commit into
nodejs:masterfrom
refack:doc-deprecate-inspect-legacy
Closed

refack wants to merge 1 commit into
nodejs:masterfrom
refack:doc-deprecate-inspect-legacy

Conversation

@refack

@refack refack commented Sep 7, 2018

Copy link
Copy Markdown
Contributor

Refs: #22751

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to Node.js documentation. util Issues and PRs related to the built-in util module. labels Sep 7, 2018
@refack refack mentioned this pull request Sep 7, 2018
1 of 4 tasks
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Comment thread doc/api/util.md Outdated

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.

version: REPLACEME

@refack

refack commented Sep 7, 2018

Copy link
Copy Markdown
Contributor Author

Since this is deprecating an undocumented feature, I recommend to treat this as semver-patch. As such this needs @nodejs/tsc approval (see some previous discussion in #22751)

@targos targos added the semver-minor PRs that contain new features and should be released in the next minor version. label Sep 7, 2018
@targos

targos commented Sep 7, 2018

Copy link
Copy Markdown
Member

The collaborator guide says:

Documentation-Only Deprecations may be handled as semver-minor or semver-major changes.

Let's make this semver-minor and it won't need special TSC approval (It will also be highlighted in the release notes, which is a good thing).

Comment thread doc/api/util.md Outdated

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.

you can already add pr-url: https://github.com/nodejs/node/pull/22753

Comment thread doc/api/util.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: node -> Node.js.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed it completely (since it could be assumed that Node.js is the object on the sentence)

@refack
refack force-pushed the doc-deprecate-inspect-legacy branch from 5c52da1 to 76a64c3 Compare September 7, 2018 19:25
@refack
refack force-pushed the doc-deprecate-inspect-legacy branch from 76a64c3 to cfd0067 Compare September 7, 2018 19:26
Comment thread doc/api/util.md
example below. **Default:** `true`.
* Returns: {string} The representation of passed object

Deprecation notice: The legacy function signature that was changed in v0.9.3

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.

Nit: remove Deprecation notice:.

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.

I'd suggest simplifying this greatly:

The legacy function signature `util.inspect(object, [showHidden], [depth], [colors])` is deprecated.

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.

One problem with this is that it can be interpreted as saying that util.inspect(object) is deprecated but it is not. Can we indicate that the showHidden, depth, and colors arguments are deprecated instead of pointing to the function signature?

@jasnell

jasnell commented Sep 7, 2018

Copy link
Copy Markdown
Member

This would need to include a deprecation code assignment in deprecations.md

@addaleax addaleax 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.

Why do we deprecate this?

Comment thread doc/api/util.md
added: v0.3.0
changes:
- version: REPLACEME
pr-rul: https://github.com/nodejs/node/pull/22753

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.

typo: rul

Comment thread doc/api/util.md
* Returns: {string} The representation of passed object

Deprecation notice: The legacy function signature that was changed in v0.9.3
`util.inspect(object, [showHidden], [depth], [colors])` has been deprecated.

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.

I’d put this closer to the end of the description… this is probably not relevant to a lot of people (and if it is, we shouldn’t deprecate it)

@trivikr

trivikr commented Oct 1, 2018

Copy link
Copy Markdown
Member

Ping

@refack refack added the blocked PRs that are blocked by other issues or PRs. label Oct 1, 2018
@refack

refack commented Oct 1, 2018 •

Copy link
Copy Markdown
Contributor Author

Why do we deprecate this?

IMHO we should either deprecate or document.
Personally I was pro deprecation, and having a monomorphic signature, but there was pushback.

Ref: #23205

@refack refack closed this Oct 1, 2018
@refack
refack deleted the doc-deprecate-inspect-legacy branch October 1, 2018 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked PRs that are blocked by other issues or PRs. doc Issues and PRs related to Node.js documentation. semver-minor PRs that contain new features and should be released in the next minor version. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants