You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Integrate prototype REPL into primary NodeJS #52510
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.
Replacing chalk with util.inspect.colors seems feasible (I already have a completed local copy for this). We could substitute ws with WebSocket (native implementation) and strip-ansi with native or built-in methods.
acorn and acorn-loose are already in the /deps folder, leaving only emphasize.
emphasize has 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.
i 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...
Activity
avivkeller commentedon 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.
devsnek commentedon Apr 13, 2024
i 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...
avivkeller commentedon Apr 13, 2024
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)
avivkeller commentedon Apr 13, 2024
See nodejs/repl#54 for the drop of a few deps
avivkeller commentedon Apr 13, 2024
If we were to merge the REPL into main, we would still need to drop the WS and replace it with the internal inspector.
avivkeller commentedon Apr 13, 2024
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 emphasizeDrop
strip-ansi(Replace with basic implementation)Drop
ws(Replace with inspector) Note that this change changes a lot, and may be unstableDrop
child_process(Replace with inspector)Little Fixes
These just came up when I was updating the codebase
avivkeller commentedon Apr 20, 2024
Closing in favor of my PR