Fork me on GitHub
#calva
<
2020-04-05
>
hindol14:04:42

In Calva, what does Clojure CLI + Shadow CLJS do?

hindol14:04:29

What I was looking for is support for starting a backend and frontend REPL at the same time. Is that possible?

pez14:04:07

It might be what that provides... I don't recall atm. If it doesn't do what you want and you are fine using Leiningen, then you can use the lein-shadow plugin.

sogaiu22:04:13

fwiw, i believe thheller does not recommend lein-shadow

pez14:04:02

(And the lein-shadow jack-in.)

hindol14:04:35

It might probably start shadow via Clojure CLI.

hindol14:04:56

I tried it, it just hangs for me.

pez14:04:23

You tried Clojure CLI + shadow?

hindol14:04:56

Yeah, that's what hangs.

hindol14:04:09

It might just be my setup.

pez14:04:28

It might be that it is not really working.... Generally what I recommend is to use two separate windows. https://calva.readthedocs.io/en/dev/workspace-layouts.html#one-folder-two-windows

hindol14:04:37

Oh cool. Will go through the docs immediately.

pez14:04:40

And there is also lein-shadow, for which Calva does have support.

hindol14:04:37

Yeah, Lein has many cool things. Current project I started using clj-new, so that's deps.edn. Will try lein some other time.

hindol14:04:51

The two window workflow should work.

hindol15:04:23

Seems something is wrong with my VSCode terminal setup. Will fix it and try Clojure CLI + Shadow again to see what it does.

pez16:04:03

It probably won't work as you'd want it (with the cli + shadow Jack-in). I think that option is ill thought trough.

markaddleman17:04:08

I'm trying to set up Calva on Gitpod/Eclipse Theia and I get this message Aborting Jack-in, since no project type was selected. What does this mean?

pez18:04:23

@markaddleman give us some more details and steps on what you do to reach that message.

markaddleman18:04:53

(sorry, my post was a bit of a useless !)

markaddleman18:04:58

I get the message when trying to jack in

markaddleman18:04:13

I should clarify a couple of things:

markaddleman18:04:53

First, this is Eclipse Theia environment and not VSCode so I only barely expect Calva to work (would love it if it did)

markaddleman18:04:20

Also Gitpod is a hosted IDE and I'm not entirely sure I'm setting up the hosted Docker image correctly

markaddleman18:04:14

So, mainly I'm trying to understand the conditions which would cause Calva to generate that message so I can debug

pez18:04:53

I think it is a message you get if you cancel out of some picker menu, during jack-in.

pez18:04:32

Never heard of Theia. Looks cool.

pez18:04:12

I also get the Aborting Jack-in message now. Interesting.

pez18:04:30

Paredit and rainbows and stuff work. Amazing.

markaddleman19:04:26

Yeah, it would be awesome if Calva would work.

pez08:04:21

I don't even understand if this is running in my browser, on my machine somehow, or in the cloud. 😃 Java will need to be there and also lein or clojure or shadow. And I need to figure out how to run Calva in dev mode there.

pez08:04:17

Also still trying to cope with my blown mind.

🙂 4
markaddleman13:04:46

This page was helpful setting up a proper dockerfile: https://www.gitpod.io/docs/config-docker/

markaddleman13:04:06

If it's helpful, my .gitpod.Dockerfile is

FROM gitpod/workspace-full

USER root
                    
USER gitpod
RUN echo "`date`" >> /tmp/test.log

# Install custom tools, runtime, etc. using apt-get
# For example, the command below would install "bastet" - a command line tetris clone:
#
# RUN sudo apt-get -q update && #     sudo apt-get install -yq bastet && #     sudo rm -rf /var/lib/apt/lists/*
#
# More information: 
RUN brew install clojure/tools/clojure
RUN brew install leiningen
RUN yarn add --dev shadow-cljs
RUN yarn global add shadow-cljs
RUN echo "`date`" >> /tmp/test.log

markaddleman13:04:51

The only issue I have is shadow-cljs musts be executed by npx shadow-cljs . Not sure why that is

pez14:04:15

Why is it a problem?

markaddleman15:04:11

Not sure it's a problem. I don't know how calva invokes shadow

pez15:04:43

It invokes it using npx 😃

pez15:04:42

Is that the problem?

pez16:04:50

Have you tried connecting to a running REPL?

markaddleman21:04:25

No, I have not. I'll give it a try and let you know

pez21:04:29

I'll try see how this can be debugged. Very similar errors from jack-in and connect. Hopefully something minor.

pez21:04:38

You can start the repl from a terminal with

clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.23.0"}}}'  -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"

pez21:04:19

But not connect... yet... we'll figure it out! I am super grateful for you bringing this to my attention!

pez22:04:07

(I've added the start-repl command to the gitpud now. But it doesn't matter much since connect doesn't work. lol)

markaddleman23:04:21

Thanks for looking at this.

markaddleman23:04:49

Like I said, Theia / Gitpod looks super interesting and I'd love to have a first-class Clojure IDE on the web

markaddleman22:04:42

fyi - I thought it might be some kind of networking issue but it's not. I can start an nrepl server and telnet to the port

pez12:04:09

Yeah, it seems to be in the Calva code things go wrong. (Or some incompatibility in Theia). I've tried to summarize where we're at here: https://github.com/PEZ/pirate-lang

👍 4
hindol18:04:29

Found a (very minor) formatting issue, probably cljfmt related.

(def service
  {:env                    :prod ;; <<<<<< One less space after align associative
   ::http/type              :jetty
   ::http/container-options {:context-configurator #(ws/add-ws-endpoints % ws-paths)}})