Skip to content

Conversation

@cjihrig
Copy link
Contributor

This commit moves the readline's undocumented exports into an internal module. The existing public exports are given a deprecation notice.

Refs: #3847
Fixes: #3836

R= @jasnell

@r-52r-52 added the readline Issues and PRs related to the built-in readline module. label Nov 16, 2015
@jasnell
Copy link
Member

LGTM
Technically this would likely need to be semver-major.

@ChALkeRChALkeR added the semver-major PRs that contain breaking changes and should be released in the next major version. label Nov 16, 2015
@ChALkeR
Copy link
Member

Looks like semver-major to me.

@cjihrig
Copy link
ContributorAuthor

Yes, semver-major for sure

@ChALkeR
Copy link
Member

Are four functions mentioned in #3836 the only exports removed in this commit?

@cjihrig
Copy link
ContributorAuthor

The four functions from #3836, plus emitKeys(), which is already private and needed by emitKeypressEvents().

@ChALkeR
Copy link
Member

Hm… I am not sure if those are unused. Will post greps later, probably tomorrow.
Maybe we should expose deprecated versions for a release.

@cjihrig
Copy link
ContributorAuthor

There are deprecation messages in place for all of them.

@ChALkeR
Copy link
Member

@cjihrig Ah, sorry, I missed that =), was too sleepy yesterday.
Should be good, then, I guess. I will do some greps later today.

@tejasmanohar
Copy link

👍

@cjihrig
Copy link
ContributorAuthor

@jasnell
Copy link
Member

CI is red but failures look unrelated. Do we want to go ahead and land or give it a bit?

@ChALkeR
Copy link
Member

@jasnell Give me some time, I will take a quick look at the usage of those methods.

@jasnell
Copy link
Member

@ChALkeR : +1

@jasnell
Copy link
Member

@nodejs/ctc ... a quick sanity check review on this would be appreciated

lib/readline.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should at least keep the style consistent here, preferably with each argument on a separate line (for better readability).

@mscdex
Copy link
Contributor

One minor nit, otherwise LGTM.

@ChALkeR
Copy link
Member

@ChALkeR
Copy link
Member

Out of those, emitKeypressEvents seems used by several modules. Is there a reason why it should?

@jasnell
Copy link
Member

@ChALkeR ... I'm sorry, is there a reason why it should what?

@cjihrig
Copy link
ContributorAuthor

Would there be value to leaving emitKeypressEvents() public and documenting it? the other functions seem to mostly be helpers, while emitKeypressEvents() may add real value.

@jasnell
Copy link
Member

@cjihrig ... that's definitely a good possibility. I'd be ok with that.

@ChALkeR
Copy link
Member

@jasnell Sorry, English is not my native language.

I wanted to ask if there are any specific reasons why several modules have to call emitKeypressEvents, which was meant to be an internal method. If those modules have a valid reason for calling it, we could consider adding it to the API instead.

Note: I'm not familiar with repl code, guessing that just looking at the actual usage in modules.

@jasnell
Copy link
Member

@ChALkeR ... no worries :-) There may or may not be good reasons for modules calling it but given that they are and we made the mistake of not explicitly marking those as private using the _ prefix, we may as well just go ahead and document that one and keep it as @cjihrig suggests. The other ones I think we're safe deprecating and moving .

@ChALkeR
Copy link
Member

@jasnell It's directly used by only 7 modules (plus the false negatives), so deprecating it shouldn't be such a problem. The question is — is that method a valuable addition the the API that we could want to keep?

@cjihrig
Copy link
ContributorAuthor

The ability to emit keypress events seems useful to me.

@cjihrig
Copy link
ContributorAuthor

Undid changes regarding emitKeypressEvents(). New CI: https://ci.nodejs.org/job/node-test-pull-request/791/

cjihrig added a commit that referenced this pull request Nov 19, 2015
This commit moves several of readline's undocumented functions into an internal module. Specifically, isFullWidthCodePoint, stripVTControlCharacters, getStringWidth, and emitKeys are moved to the internal module. The existing public exports of the first three functions are given a deprecation notice. Refs: #3847Fixes: #3836 PR-URL: #3862 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Brian White <[email protected]>
@cjihrigcjihrig closed this Nov 19, 2015
@cjihrigcjihrig deleted the rl branch November 19, 2015 22:02
@cjihrigcjihrig mentioned this pull request Nov 19, 2015
@jasnelljasnell mentioned this pull request Mar 17, 2016
@addaleaxaddaleax mentioned this pull request Apr 27, 2016
2 tasks
cjihrig added a commit to cjihrig/node that referenced this pull request May 2, 2016
This commit removes the deprecated exports getStringWidth(), stripVTControlCharacters(), and isFullWidthCodePoint(). It also removes codePointAt() in its entirety, as it was deprecated and not being used by core. Refs: nodejs#3862 PR-URL: nodejs#6423 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
joelostrowski pushed a commit to joelostrowski/node that referenced this pull request May 4, 2016
This commit removes the deprecated exports getStringWidth(), stripVTControlCharacters(), and isFullWidthCodePoint(). It also removes codePointAt() in its entirety, as it was deprecated and not being used by core. Refs: nodejs#3862 PR-URL: nodejs#6423 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
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.

6 participants

@cjihrig@jasnell@ChALkeR@tejasmanohar@mscdex@r-52