-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readline: promote _getCursorPos to public api #30687
readline: promote _getCursorPos to public api #30687
Conversation
a7b3b6f
to
c6d228a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs docs and a regression test and I think I have a preference for simply renaming instead of aliasing it but perhaps other maintainers feel differently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making this public sounds good to me, but like Ben said having a test + docs is necessary here.
+1 to making this public as an alias with docs and tests added. |
can we invert the definitions so the name of the function doesn't have an underscore? |
I should have some time tomorrow to get the docs & tests done. Had already planned on writing docs for it, but as a separate PR; it does make sense to just include it in this one, though. I can also strip the underscore (and invert the alias, for backwards compatibility) since that seems to be the most desired? I see two votes for that, so far. Or maybe wait a couple more days and let more people weigh in 🤷♂️ |
I am looking into getting these tests done, but I need a bit of guidance.
Are you expecting a coverage test report of some kind for
Please advise. |
You're right, |
So basically use the alias in the tests? I had considered that, but then disregarded. I will go ahead and strip the underscore in Just committed the doc. Please let me know if it is not clear enough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update test/parallel/test-readline-interface.js
to use the public API? Thanks.
@bnoordhuis done. Sorry about that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. LGTM, thanks. There's a small conflict in readline.md but it should be trivial to resolve when rebasing.
Aliases Interface._getCursorPos to Interface.getCursorPos, for consumption as a public API. refs: nodejs#30347
Alias _getCursorPos() = getCursorPos() for backwards compatibility.
b2a800c
to
6b09369
Compare
Merged updates in readline.md |
One question: since this is going public now, should the YAML doc be "added: REPLACEME", or should I make it the version where the internal function was created? Looks like |
Co-Authored-By: Ruben Bridgewater <[email protected]>
@Js-Brecht please keep the |
Landed in a68729c |
Alias _getCursorPos() = getCursorPos() for backwards compatibility. Refs: #30347 PR-URL: #30687 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Alias _getCursorPos() = getCursorPos() for backwards compatibility. Refs: #30347 PR-URL: #30687 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Notable Changes: * cli: * add --trace-exit cli option (legendecas) #30516 * http,https: * increase server headers timeout (Tim Costa) #30071 * readline: * update ansi-regex (Ruben Bridgewater) #30907 * promote \_getCursorPos to public api (Jeremy Albright) #30687 * repl: * add completion preview (Ruben Bridgewater) #30907 * util: * add Set and map size to inspect output (Ruben Bridgewater) #30225 * wasi: * require CLI flag to require() wasi module (Colin Ihrig) #30963 PR-URL: #31010
Notable Changes: * cli: * add --trace-exit cli option (legendecas) #30516 * http,https: * increase server headers timeout (Tim Costa) #30071 * readline: * update ansi-regex (Ruben Bridgewater) #30907 * promote \_getCursorPos to public api (Jeremy Albright) #30687 * repl: * add completion preview (Ruben Bridgewater) #30907 * util: * add Set and map size to inspect output (Ruben Bridgewater) #30225 * wasi: * require CLI flag to require() wasi module (Colin Ihrig) #30963 PR-URL: #31010
Considering versions < v13 are still widely used, is it possible to merge this into v12 & v10 as well? If so, would that mean that I should submit a PR against the v10.x and v12.x branches? |
@Js-Brecht I've added an lts-watch label to this PR and we'll discuss in an upcoming LTS meeting when planning the next Semver-Minor for 12.x and 10.x It appears like this lands cleanly on 12.x with minor conflicts in the docs. As for 10.x there are more conflicts... so we may have to wait a little bit to see how feasible this change is on that release line. |
@MylesBorins Okay, sounds good. Please let me know if you'd like me to submit a new PR for 10.x. I haven't reviewed the 10.x code yet, but I imagine that these changes would be simple to implement there, too. All they really required was find/replace, and the addition of one line. Implementing it directly in the 10.x branch should resolve any conflicts, I would think. |
Alias _getCursorPos() = getCursorPos() for backwards compatibility. Refs: #30347 PR-URL: #30687 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Alias _getCursorPos() = getCursorPos() for backwards compatibility. Refs: #30347 PR-URL: #30687 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Aliases Interface._getCursorPos to Interface.getCursorPos, for consumption as a public API.
If so desired, I can replace
_getCursorPos
method calls withgetCursorPos
, and create an alias the other way around. Doing it like this was just the simplest way to accomplish exposing_getCursorPos
.refs: #30347
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes