Repository navigation
Integrate prototype REPL into primary NodeJS #52510
Description
Activity
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Apr 13, 2024 This change will take a while to implement, but it would be good to get the ball rolling and start the discussion.
/cc @devsnek as they were the primary contributor to the REPL repo (sorry)
/cc @nodejs/repl for obvious reasonsi still use the prototype as my daily driver. there are still some interesting bugs in it though. for example if the child process (which runs all the code) becomes frozen it will not be killed after the parent exits. also if an input spans multiple lines, the highlighting can break cursor positioning. there are probably more I'm not thinking of...
Well, maybe it's not ready to be merged just yet, but this issue is meant to start that conversation, so that it can be merged eventually.
In regards to the little bugs with child_process, if we integrate this NodeJS internals (while new bugs will occur), we may resolve some old ones.
(P.S. sorry for using the wrong pronouns! I'd hate it if someone did that to me)
- addedreplIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.
on Apr 13, 2024 See nodejs/repl#54 for the drop of a few deps
If we were to merge the REPL into main, we would still need to drop the WS and replace it with the internal inspector.
After some hard work, I managed to (in my PR):
Drop Dependencies (The main goal)
-
Drop
chalk(Replace withutil.inspect.colors) Note that chalk is still pre-installed with emphasize -
Drop
strip-ansi(Replace with basic implementation) -
Drop
ws(Replace with inspector) Note that this change changes a lot, and may be unstable -
Drop
child_process(Replace with inspector)Fixes "if the child process (which runs all the code) becomes frozen it will not be killed after the parent exits."
Little Fixes
These just came up when I was updating the codebase
- Fix multi-line preview
-
Closing in favor of my PR
What is the problem this feature will solve?
It might be worth considering upgrading the REPL, given the stability of the work happening at https://github.com/nodejs/repl. However, we would need to (probably) reduce its dependencies before proceeding.
Currently, it relies on the following packages:
Replacing
chalkwithutil.inspect.colorsseems feasible (I already have a completed local copy for this). We could substitutewswithWebSocket(native implementation) andstrip-ansiwith native or built-in methods.acornandacorn-looseare already in the/depsfolder, leaving onlyemphasize.emphasizehas ten dependencies, so I'm unsure what we would do to reduce its size.In summary, I think it's time to revisit the discussion around upgrading the REPL.