Updates from the Repl.it team about the product

← Back to all posts
New Node.js implementation (ansi terminal, no project mode, etc)
amasad (1718)

If you're a longtime repl.it user you've probably noticed that some languages start behaving differently (or weirdly) when you add the first additional file. That's what we called "project vs eval" modes. Many users -- including me -- resorted to adding an empty file (e.g. _.js) just to make it behave as expected (which is gross and ugly).

But after you added any additional files you lose some interactive functionality:

  • it doesn't have access to the project scope
  • if you start a server the console stop working altogether

Also, in Node.js things like chalk or colors didn't work by default (you had to force it or open it in repl.run).

Well, all this is now fixed. Node.js now ships with:

This should solve a lot of problems people reported in the past. Let me know if you have any feedback!

Commentshotnewtop
TheDrone7 (650)

Please, upgrade from v10 to at v12.

PaoloAmoroso (100)

Is a similar fix for eval mode vs project mode planned for Python or other languages? And what's the reationale for the separation between eval and project mode anyway?

amasad (1718)

@PaoloAmoroso It's been fixed for Python for a while now. Are you seeing any issues?

Original reason for the distinction is that the way we wrote our repls where basically just running eval inside the language interpreter. When we added files that makes it hard to eval (eval doesn't have the concept of files) so we had to just run the code as is.

The new behavior is unlocked by https://github.com/replit/prybar, which for the most part operates on an internal level (either via C binding or something similar)

PaoloAmoroso (100)

@amasad I'm not having any issues and I seemed to remember the distinction had already been removed for Python. Thanks for the context.

amasad (1718)

cc @Kognise I know you hated project/eval mode

Kognise (347)

@amasad this is amazing, thanks for the pingo ❤️
Speeds up development, eliminates inconsistencies, and even adds features in a roundabout way!