Skip to content

readline: rename input field and remove excess params - #31991

Closed
rexagod wants to merge 3 commits into
nodejs:masterfrom
rexagod:createInterface-params-fix
Closed

readline: rename input field and remove excess params #31991
rexagod wants to merge 3 commits into
nodejs:masterfrom
rexagod:createInterface-params-fix

Conversation

@rexagod

Copy link
Copy Markdown
Member

Removed excess parameters from the createInterface method,
renamed input field to options, in accordance with the docs,
and made corresponding changes in tests.

Refs: #31603 (comment)

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Removed excess parameters from the createInterface method,
renamed input field to options, in accordance with the docs,
and made corresponding changes in tests.
Refs: nodejs#31603 (comment)
@nodejs-github-botnodejs-github-bot added the readline Issues and PRs related to the built-in readline module. label Feb 27, 2020
@addaleaxaddaleax added the semver-major PRs that contain breaking changes and should be released in the next major version. label Feb 28, 2020
@BridgeAR

Copy link
Copy Markdown
Member

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

If I'm reading this correctly is completely removes the ability to pass in the multiple arguments and changes the API. We can't do it like this. While the createInterface(input, output, completer, terminal) signature does not appear to be documented, it works and has not been deprecated. It would need to go through a proper runtime deprecation cycle before we can remove it.

@rexagod

rexagod commented Mar 11, 2020 via email

Copy link
Copy Markdown
MemberAuthor

@addaleax

Copy link
Copy Markdown
Member

@rexagod For runtime-deprecating something, you can look at usages of util.deprecate() in the JS source tree – basically, something that prints a deprecation warning is considered runtime-deprecated.

We could pass warnings for multiple param usage of readline in a patch version and implement this change in a major, maybe?

Runtime-deprecating/introducing warnings and removal are all semver-major changes.

And, while I understand that this is frustrating, I would also be -1 on introducing such a warning without a good reason – I don’t consider it being undocumented a good reason, personally.

@rexagod

rexagod commented Mar 13, 2020

Copy link
Copy Markdown
MemberAuthor

Thank you for the explanation @addaleax! There is however a deprecation (DEP0094) with similar cause to this one, where multiple params were reduced to one, but I guess that was under a different scenario.

Please feel free to close this, or let me know if you have any other plans regarding this issue.

@rexagod

Copy link
Copy Markdown
MemberAuthor

Hello, @addaleax@jasnell. I was wondering since this isn't closed yet, are there any plans on deprecating this?

@jasnell

Copy link
Copy Markdown
Member

This PR cannot land in it's current state. It should either be changed to a deprecation or closed with a separate PR deprecating first. If you'd like to do that, please do :-)

@rexagod

Copy link
Copy Markdown
MemberAuthor

@jasnell The DeprecationWarning is causing 10 repl tests to fail. Running them with --no-deprecation flag seems to fix 3 of them, but for the rest, it seems to interfere with the core logic for what those tests were written for in the first place, and modifying them doesn't seem right.

Is there a way I can pass a --no-deprecation flag for a specific deprecation code?

@rexagod

Copy link
Copy Markdown
MemberAuthor

ping @jasnell

@jasnell

Copy link
Copy Markdown
Member

Is there a way I can pass a --no-deprecation flag for a specific deprecation code?

Not currently

@BridgeAR
BridgeARforce-pushed the master branch 2 times, most recently from 8ae28ff to 2935f72CompareMay 31, 2020 12:18
@rexagod

rexagod commented Jun 20, 2020

Copy link
Copy Markdown
MemberAuthor

Closing this for now. I'm focusing on getting my other not-stalled PRs merged at the moment. Will come back to this later if need be.

@rexagodrexagod closed this Jun 20, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readlineIssues and PRs related to the built-in readline module.semver-majorPRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@rexagod@BridgeAR@addaleax@jasnell@nodejs-github-bot