-
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
repl: simplify internal repl #33461
repl: simplify internal repl #33461
Conversation
b608255
to
f524d2d
Compare
f524d2d
to
9a7c81e
Compare
@nodejs/repl this could use some reviews. PTAL. |
This could use some reviews. I am not sure whom to ping though. |
This generally LGTM. Maybe @addaleax since she had an opinion on the older repl PR? I'll try checking this out and reviewing it today/tomorrow. |
Yeah idk, I’ve seen this PR but I don’t really know how to feel about it? The commit message says what this PR does, but not why, and that might be helpful here. To be honest, I think that’s mostly because I don’t know if this would be more helpful to – the probably very low number of – external REPL module users or not. For other modules I would consider relying on environment variables for config an antipattern, but given that the REPL is probably more often used as the main application than as part of a larger application, it might make sense here? |
@addaleax my main goal here is to unify the behavior of our "internal" (standalone) REPL instances and instances created otherwise. The improved color detection could theoretically be handled separately. |
This makes sure all REPL instances check for the NODE_REPL_MODE environment variable in case the `replMode` is not passed through as option. At the same time this simplifies the internal REPL code significantly. Signed-off-by: Ruben Bridgewater <[email protected]>
284f0d7
to
c0e034c
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.
Actual code LGTM, not sure I understand the use case well enough but I trust you on this
8ae28ff
to
2935f72
Compare
Running CI again since the last one was 27 days ago |
This makes sure all REPL instances check for the NODE_REPL_MODE environment variable in case the `replMode` is not passed through as option. At the same time this simplifies the internal REPL code significantly. Signed-off-by: Ruben Bridgewater <[email protected]> PR-URL: #33461 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in b831b08 |
Revert PR because this breaks the github actions build: #34058 |
repl: always check for NODE_REPL_MODE environment variable
This makes sure all REPL instances check for the NODE_REPL_MODE
environment variable in case the
replMode
is not passed throughas option.
At the same time this simplifies the internal REPL code significantly
and color detection is improved.
##### doc: document the--use-strict
flag for the REPLAdd information that this flag is going to evaluate all code in strictmode. Also use the regular
default
description as it's used in otheroptions.
@nodejs/repl @nodejs/documentation PTAL
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes