Fork me on GitHub
#cursive
<
2019-08-14
>
Lone Ranger10:08:10

Curious if anyone has any suggestions for the following clojurescript heavy REPL workflow. In order to get REPL workflow working correctly, 1. Run clj -R:nREPL -m nrepl.cmdline --middleware "[cider.piggieback/wrap-cljs-repl]" where

{:aliases {:nREPL {:extra-deps
                 {nrepl/nrepl                     {:mvn/version "0.6.0"}
                  cider/piggieback                {:mvn/version "0.4.0"}
                  com.bhauman/figwheel-main       {:mvn/version "0.2.0"}
                  com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
                  } ... }
2. Start a remote repl session connecting to the leiningen port 3. Run (do (use 'figwheel.main.api) (start "dev")) to kickstart the REPL session. it all works flawlessly except for the fact that if I screwed up my compilation, need to redo my webpack, or whatever, I need to restart all three steps. Does anyone have a cleaner clojurescript workflow for Cursive?

kenny18:08:34

Could REPLs be named based on the Run Configuration name instead of the namespace you are in? I have several different REPLs with different context modules and have no idea which REPL was started within which project.

cfleming23:08:20

@kenny Yes, I’m actually working on a large bunch of REPL improvements, and that’s one of them. Now the current ns is shown in an overlay over the input pane:

😍 4
cfleming23:08:02

I haven’t changed the tab title yet, but I’m planning to have a Title field in the Run Config itself, since you might want a shorter name in the tab.

kenny23:08:31

Woo, that's great!

cfleming23:08:07

@goomba As part of those REPL changes I’m also working on CLJS REPLs, so that should get easier soon.

cfleming23:08:37

I have socket REPL support working, and I’m hoping to have native support for CLJS REPLs that won’t require piggieback.

kenny23:08:48

Not sure if this fits in those changes but being able to select text in the REPL output panel using "extend selection" action would be great.

cfleming23:08:15

Hmm, yeah, that’s trickier since that is just text, it’s not structured like the input pane.

Lone Ranger23:08:38

Wooooo!! That would be great. If you don't mind me scope creeping you, it would be really fantastic if you could put in some shortcut keys or something to make switching between multiple simultaneous REPL sessions easier as well. You know, while you're in there.

cfleming23:08:40

I’m planning an action to copy the last command result to the clipboard, though.

Lone Ranger23:08:17

(preferably can view them side by side). Ok I'm done.

cfleming23:08:23

Yeah, that’s on the list. There will also be dual clj/cljs REPLs, so it’ll send things to one or the other (or both) depending on the file type.

cfleming23:08:13

Do you mean you’d like the CLJ and CLJS REPLs side by side?

cfleming23:08:01

I’ve thought about that, and was considering reusing the debugger UI, but it’s finicky and complicated, and needs a lot of screen space.

Lone Ranger23:08:30

That would be very helpful, personally, when I'm doing simultaneous server/front end development, especially for websocket work. It's a lot of ping pong. That being said I'd settle for good keyboard shortcuts to switch if making the REPL tabs into breakout windows is too irritating

cfleming23:08:25

What about interleaving them in the same REPL? So you could switch in the input pane which REPL you’re sending to, and the output would be marked somehow with the REPL it came from.

cfleming23:08:10

I’d need to try that to see if it’s confusing or not.

Lone Ranger23:08:30

As in the output of server and client goes to same REPL output area? Hell yeah that would be even better.

cfleming23:08:13

Ok, I’ll try that and see how it works, and maybe get a dev build so that people can try it.

Lone Ranger23:08:43

Yasss. You spoil us.

cfleming23:08:48

I’ve had to park the REPL stuff for a bit to work on a Deps change, but I’ll be back on it soon.

Lone Ranger23:08:34

I'm amazed you can keep up with all the tooling changes. And somehow answer slack

cfleming23:08:27

Well, I’m just adding support for Socket REPL which came out, what, 2 years ago? And I’m also planning to add support for the NPM requires for CLJS which must be about the same, so…

cfleming23:08:50

There’s a lot to keep up with these days, for sure.

Lone Ranger23:08:58

You're supporting the npm? Audacious. Even the docs itself say it's unstable in advanced.

cfleming23:08:45

Yeah, but lots of people use Shadow these days.

cfleming23:08:06

I’d like to add proper support for that too, which should be easier after this round of Deps fixes.

Lone Ranger23:08:00

Yeah. This is probably why clojure is such a hard language to get into. Fortunately you've done a lot to make it approachable. Thanks again!

cfleming23:08:39

No worries, glad it’s helping! Making Clojure accessible is one of my main goals.

16