jasongilman / proto-repl

A Clojure Development Environment package for the Atom editor
https://atom.io/packages/proto-repl
MIT License
565 stars 50 forks source link

Add lumo repl #276

Closed dundalek closed 3 years ago

dundalek commented 6 years ago

Implements support for lumo repl for ClojureScript development (#263). Currently it replaces the existing self-hosted repl process.

So there is a question @jasongilman. Woud you prefer to 1) Replace the self-hosted repl with lumo and add lumo to npm dependencies so it is installed automatically? 2) Or keep the existing self-hosted repl, and add a new command to trigger lumo repl?

Example session, iterating with React.js which is not possible in JVM based repls:

image

jasongilman commented 6 years ago

I don't know much about Lumo related to your question. If Lumo seems like a good built in REPL (like the self hosted REPL) I'd be ok with replacing it. I doubt many people use the existing one.

Would you mind updating the pull request if there are any changes required (such as updating the README)?

dundalek commented 6 years ago

Lumo is the general go to REPL for ClojureScript (it runs on node which makes it great to play with existing ecosystem). The other one is Planck which is more lightweight (plain JS runtime). Now that I think about it, this code should run with Planck as well. So maybe we want to make it more general and user would choose which REPL they prefer.

The question was about self-hosting nature. Lumo can be added into npm dependencies so that it is automatically fetched when proto-repl atom package is installed. Thus it would act as a built-in self-hosted repl. The disadvantage is that it would fetch 60MB of dependency which might not be needed (for example if you only use the nREPL lein repl).

The other way is for users to install it via npm install -g lumo-cljs and then call the global binary. I am now leaning towards this solution. The advantage is people could specify the binary meaning they could configure it to run Planck or other repls as well.

Also I have one question I was not able to figure out. Where in the lifecycle do startCallback / stopCallback fit in? I thought that stopCallback might need to be called when repl stops, but it sometimes gives me an exception that the callback is no longer available.

whitecoop commented 6 years ago

Hello, just wanted to pop in here as someone who'd like to see Lumo used for proto-repl's self-hosted CLJS REPL. I just recently started using proto-repl for a CLJS project, but the project isn't a standard browser setup and it'd be great to be able to use a self-hosted CLJS REPL rather than having to run the JVM with something like Figwheel.

I've used Lumo in the past (great project, IMO) but primarily on its own from the command line. When I was looking into being able to eval forms from Atom, it led me here. (When trying the self-hosted REPL as it now stands in proto-repl I also got a TypeError -- I can open an issue if you like, but if this PR goes through, I figure it'll be irrelevant.)

dundalek commented 3 years ago

Both Atom and Lumo turned out dead. Fortunately, there are many working alternatives these days. Closing the PR to get rid of it from the new Github pull request view.