Fork me on GitHub
#calva
<
2023-08-28
>
Dustin Getz12:08:39

Pez in this ticket i opened – https://github.com/BetterThanTomorrow/calva/issues/2291 you replied: > In the meantime, I can recommend using the shadow-cljs jack-in/connect sequence instead, because it will keep these warning in the jack-in terminal instead of printing them to the REPL/Output window.

Dustin Getz12:08:44

1. I was using the `deps + shadow-cljs" connect sequence, is that insufficient?

Dustin Getz12:08:12

2. TIL that I can launch my server and connect browser successfully even after the timeout warning:

; Please start your ClojureScript app so that Calva can connect to its REPL...
; Waiting for Shadow CLJS runtimes, start your CLJS app...
; Waiting for Shadow CLJS runtimes, start your CLJS app...
...
; Waiting for Shadow CLJS runtimes, start your CLJS app...
; Timed out waiting for Shadow CLJS runtimes, pretending we are connected.
Since a delayed browser runtime connection will still succeed, can we just ... print once and not print the waiting messges and timeout? That might solve the issue, which is that the log spam is scrolling the repl out from under me

Dustin Getz12:08:37

What even is the timeout, is it a timeout on Calva trying to reach the browser? Why does that matter? The connection will come when it comes, just leave the repl in CLJ mode until I ask for CLJS

Dustin Getz13:08:50

3. What does the shadow-cljs boot sequence actually do (as compared to deps + shadow-cljs? How is shadow invoked?

pez14:08:42

1. The only practical difference is that it shadow will print the repl process output in the terminal rather than them being sent back as repl messages and printed in the REPL window. It might matter in your case because the warning messages that the scroll reset is preventing you from reading would be printed in the terminal instead. 2. The Waiting messages solves a Ux problem we had with users missing that step to complete the connection. I’m a bit reluctant to change this right now, because of a lack of ideas how to address the problem instead. We’re probably going to change the REPL/Output window implementation quite a lot soon, and will have more UI/Ux tools at our disposal then. 3. As long as shadow-cljs is set to use deps for its dependencies, the two sequences are pretty similar. With deps + shadow-cljs, Calva will start the clojure process, and shadow-cljs will be started from the repl via the shadow-cljs api. With shadow-cljs Calva will start a shadow-cljs process and shadow-cljs will start clojure. Afaiu the only practical difference is the one mentioned in 1. I’m elaborating a bit on how these things are wired here: https://blog.agical.se/en/posts/shadow-cljs-clojure-cljurescript-calva-nrepl-basics/ Me, I prefer to have shadow-cljs printing its output in the terminal, so I always use the shadow-cljs sequence.

🙏 2
Dustin Getz14:08:48

so that means with standalone shadow-cljs process you'll get two jvms right? That won't work with Electric

janezj12:08:37

Is it possible to edit a readonly file in calva? (I don't want to save changes,) I would like to change some functions just for a moment - add a print statement or (def env env) because I am chasing a bug in a 3rd party library. I haven't found a reference of readOnly property in the vscode api docs

pez14:08:41

I don’t think VS Code allows it. What I do is that I evaluate the file (the command Calva: Load/Evaluate Current File, ctrl+alt+c ctrl+alt+c) and then use the command Calva: Send Current Top Level Form to Output/REPL Window, ctrl+alt+c ctrl+alt+space, to get the function over to the REPL window and edit and evaluate it there.

👑 2
Ksenia Busquet18:08:59

Guys, need some help with calva test runner: I am using some external classes and getting this message when trying to run the tests using calva test runner. The class is imported in the test file namespace ; Execution error (ClassNotFoundException) at java.net.URLClassLoader/findClass (URLClassLoader.java:445). ; org.apache.kafka.streams.TopologyTestDriver

seancorfield18:08:59

Is the dependency in your main deps or only your test deps? If the latter, did you tell Calva to include test deps when you jacked-in?

Ksenia Busquet18:08:56

Hi Sean, so the dependency is in the main deps, and I'm not sure how to include it in the test deps :thinking_face:

seancorfield18:08:04

Hmm, if it is specified in the main deps then it should be available in the REPL with no special ceremony. Is this a project.clj or deps.edn project? Can you share that file? Or link to this project if it's on GitHub?

seancorfield19:08:34

You have this dependency?

(~/clojure)-(!2010)-> clj -Sdeps '{:deps {org.apache.kafka/kafka-streams-test-utils {:mvn/version "RELEASE"}}}'
Clojure 1.12.0-alpha4
user=> (import '(org.apache.kafka.streams TopologyTestDriver))
org.apache.kafka.streams.TopologyTestDriver
user=>

seancorfield19:08:50

(perhaps with a specific version?)

Ksenia Busquet19:08:02

So, we are using repl profile from project.clj in order to use repl and calva, and I've added the kafka-streams-test-utils to :dependencies of this profile and it worked! Thanks so much for the tip! :star-struck:

2
Steven Lombardi22:08:01

I work on an app that spits out a ton of logging; its job is to poll a system for changes and sync the records with another system. The logging is intense enough that if sent to output.calva-repl it will reduce its performance to a snail's crawl. So I went looking for a solution and this is what I came up with: https://clojurians.slack.com/archives/C17JYSA3H/p1693259716721609?thread_ts=1683660740.358509&amp;cid=C17JYSA3H Are there any alternative takes on tackling this? Does Calva have settings that I'm missing?

pez05:08:00

Thanks for sharing! There are no settings in Calva for this, but there’s at least one issue around adding options for output. See if you find it and add any input you have, please.

👍 2