-
Notifications
You must be signed in to change notification settings - Fork 30k
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
repl: Undocumented public methods on REPLServer.prototype #7619
Comments
I did something similar to this recently with the
|
@cjihrig how on earth do you identify overall userland usage for each method? Surely there's a tool I can use. Can you point me in the right direction? |
We have a very scientific method of pinging @ChALkeR and asking him to look it up. |
@ChALkeR would you be willing to write a document on your process? |
@mscdex the reason I added the Maybe these concerns just come out in the |
@ChALkeR ping - I'll be happy to take on the work if there's a reasonable way to do this. Noodled a few ideas with some coworkers yesterday, but nothing that was simple and straightforward jumped out. |
@ChALkeR just following up. Any chance you can lend a hand here? |
Ah, sorry, I missed this. Will be ready today =). |
Note: everything here is based on the 2016-01-28 dataset. I collected the newer one (at 2016-07-23), but didn't have enough time to upload it before traveling to another city, so it was just left there on my PC in the last moment :-). I will either rebuild a newer dataset directly on the server or will just use the old one for a few more weeks. First of all, instances of
|
@lance @thealphanerd @cjihrig |
Revisiting #7619 (comment). Could we document the process of looking up usage? If a specific dataset is needed, perhaps we could use some foundation money to host it somewhere. If @ChALkeR were to get hit by a bus, or even come down with the flu, this whole process of identifying usage currently gets blocked. |
@cjihrig I'm trying to host the scripts at https://github.com/ChALkeR/Gzemnid, but it's only slowly transitioning from a set of hacky bash scripts that require manual actions to something more sensible. Perhaps will push some updates soon. That also works as a server to allow searches using a web API. I had it running as web service some time ago at http://gzemnid.oserv.org/, but it's not ready yet, and atm it's down. Perhaps I will spend a bit more time on that in the coming days. The 2016-01-28 dataset is hosted at http://oserv.org/npm/Gzemnid/2016-01-28/ — the *.lzo files and the bash script. Anyone could download the pre-built dataset and obtain exactly the same greps. Also that repo provides the deep dependency checker (to build lists like this), pre-built files are named Perhaps we need a separate issue for that somewhere. |
Hm, maybe it's time to create a separate repo under the nodejs org. We're clearly already leaning on this functionality, and moving it under the org might get additional contributors. |
@cjihrig I will try to make that one working without any additional non-documented actions, document it a bit (at least list the commands), and then it'll be at least usable by anyone other than myself. I'm all for moving that into the org once it reaches a «usable» state. |
@ChALkeR no worries on the delay. I agree that GH's mentions need a better UI, and had assumed that you (like everyone else) has to deal with a deluge. Thanks for doing this! |
I would likely recommend doing a soft-deprecation of
|
@lance Should this issue remain open? |
@jasnell I've submitted a PR for With regard to |
This method does not need to be visible to user code. It has been undocumented since it was introduced which was perhaps v0.8.9. The motivation for this change is that the method is simply an implementation detail of the REPLServer behavior, and does not need to be exposed to user code. This change adds documentation of the method with a deprecation warning, and a test that the method is actually documented. PR-RUL: #14223 Refs: #7619 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
The internal method `REPLServer.createContext()` had unexpected side effects. When called, the value for the `underscoreAssigned` and `lines` properties were reset. This change ensures that those properties are not modified when a context is created. Fixes: #14226 Refs: #7619 PR-URL: #14331 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
The internal method `REPLServer.createContext()` had unexpected side effects. When called, the value for the `underscoreAssigned` and `lines` properties were reset. This change ensures that those properties are not modified when a context is created. Fixes: nodejs#14226 Refs: nodejs#7619 PR-URL: nodejs#14331 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
The internal method `REPLServer.createContext()` had unexpected side effects. When called, the value for the `underscoreAssigned` and `lines` properties were reset. This change ensures that those properties are not modified when a context is created. Fixes: nodejs/node#14226 Refs: nodejs/node#7619 PR-URL: nodejs/node#14331 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
I think this issue can be closed now with the following PRs landed: |
This method does not need to be visible to user code. It has been undocumented since it was introduced which was perhaps v0.8.9. The motivation for this change is that the method is simply an implementation detail of the REPLServer behavior, and does not need to be exposed to user code. This change adds documentation of the method with a deprecation warning, and a test that the method is actually documented. PR-RUL: #14223 Refs: #7619 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
There are a number of methods on
REPLServer.prototype
that are clearly available in userland but are not documented. In at least a few cases, my impression is that these methods are attached to the prototype primarily in order to facilitate testing. I think this situation is non-ideal.I have seen similar discussions as a part of various issues regarding "semi-private" properties that begin with an underscore on various other modules - though typically those conversations are tangential to the real issue.
This issue is similar - publicly accessible but undocumented properties. The pattern is not limited to
REPLServer
, but since this is where I have spent most of my time in the code base, it's the one I'm most familiar with now, so for now, this conversation is limited to that module. However, I do think this should be discussed at a higher level and some guidance created for dealing with these "leaks".As a rule, I would say that no methods should be attached to an object's
prototype
that are undocumented. But it's not clear how to best deal with existing concerns.Here is a list of the methods found on
REPLServer.prototype
that are currently undocumented, but are fully accessible in userland.I can see why
close
andsetPrompt
may not be documented. Although, I think ideally some mention of them should be made in the REPL context sinceREPLServer
provides custom implementations of these methods. In my opinion, the others, however, should be refactored in such a way that they are not accessible in userland, or they should be documented.The text was updated successfully, but these errors were encountered: