calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
Tero Matinlassi 2021-06-17T04:09:44.267500Z

I should have same versions… if I type that into a file and evaluate it, it shows it correctly.

pez 2021-06-17T16:24:56.270Z

Dear Calva friends. This upstream issue (on VS Code) is causing confusion for new Calva users. The VS Code team is very driven by votes (thumbs up) on issues, so please throw yourself at this one and give it thumbs up:https://github.com/microsoft/vscode/issues/126306

👍 3
Alexis Schad 2021-06-17T17:05:05.273100Z

Hi, is it normal that I can't compile functions in debug mode, or use breakpoint, inside an cljs app? Using cljc files it works. Got a failed compiling constant: #'cider.nrepl.middleware.debug/breakpoint-if-interesting; clojure.lang.Var is not a valid ClojureScript constant. Thanks!

pez 2021-06-17T17:25:18.276Z

Hello @schad.alexis , I’m not completely sure I understand the problem, but if it is about the debugger, it only works in Clojure. That makes it work for cljc files if you are backing those with a Clojure REPL. You can toggle if they should be backed by a Clojure or ClojureScript REPL using a command, and also with the cljc/clj button in the statusbar.

👍 1
Alexis Schad 2021-06-18T10:21:04.277800Z

I tested it a bit more, with two REPL (one cljs and one clojure). I can switch as expected within a .cljc file, but in a .cljs, it is forced to the cljs REPL. I would have expected to be able to debug functions of "pure clojure" (without any JS dependency). Is it possible to force the clojure REPL in an cljs file?

Alexis Schad 2021-06-18T10:24:00.278Z

(For the initial question of the debugger in cljs, I've juste noticed the Note in the doc, I was just scrolling without reading it...)

pez 2021-06-18T10:35:03.278200Z

That’s perfectly fine. 😃

pez 2021-06-18T10:40:39.278400Z

I try to factor things so that I can cljc files for cross platform code, but I haven’t entertained this use of a Clojure REPL for ClojureScript files… I think it might often come down to that you still have some ns things you need to load and if it is a cljs file chances are that the Clojure REPL will not be able to load the file.

pez 2021-06-18T10:42:20.278600Z

The output/REPL window is treated as a cljc file, however, so you can try debugging things there…

Alexis Schad 2021-06-18T11:50:00.278800Z

yes the clojure cant parse the whole file, for sure, espacially the ns with JS requirements. I also have cljc files for the logic but my cljs are for reagent components (I'm making a web app). Thanks for the answer, now I understand well the why, I will find a solution (maybe putting the maximum code in cljc files, or just using console.log to debug cljs functions).

pez 2021-06-18T12:24:04.280700Z

If you find a good way to do it, maybe you can write about it somewhere? Either off you have a blog, out it could fit in the Calva docs too

Alexis Schad 2021-06-17T17:26:17.276700Z

Thanks, yes it was about using the debugger in cljs.

👍 1
pez 2021-06-17T17:27:53.276900Z

Note to self: We should mention that in the Getting Started REPL.

bringe 2021-06-17T20:29:48.277200Z

I was going to share this as well 😄. You beat me to it.

1