Fork me on GitHub
#calva
<
2022-09-28
>
Jakub Holý (HolyJak)14:09:02

I have an interesting problem with a custom repl sequence in https://github.com/holyjak/fulcro-intro-wshop/blob/main/.vscode/settings.json#L12, namely its afterCLJReplJackInCode. It seems to work fine locally but fails in Gitpod (see the button https://github.com/holyjak/fulcro-intro-wshop#running-the-app-with-in-browser-vs-code-and-backend-via-gitpod). I don't see any details other then a line that the afterCLJReplJackInCode failed. Any tips on troubleshooting? 🙏

pez20:09:49

It is quite strange... As a ways of troubleshooting, what I usually do is to try the commands at the REPL prompt, or in a rich comment. Doing that with this project, I notice something super weird. The REPL prompt is a ClojureScript REPL, regardless if I toggle it to be a Clojure REPL. I am guessing that that is why the evaluation fails. If I load server.clj, the REPL window prompt gets to be a proper Clojure REPL, and then I can evaluate the afterCLJReplJackInCode forms. I can't figure out why this would happen on Gitpod... For now I think the workaround could be to put the forms in a Rich comment in server.clj and instruct users to load that file and then evaluate the forms from there. This is notoriously hard to debug. And now when I tried it a second time the afterCLJReplJackInCode evaluation succeeded... Smells like a race condition.

pez20:09:02

Something is wrong with the REPL session management when on Gitpod, for sure.

Jakub Holý (HolyJak)20:09:32

Thank you very much for looking into this! I have the impression that 1st time it worked for me so a race condition sounds very plausible.

Jakub Holý (HolyJak)16:09:18

Question two: what is the "defun" in "Calva: Evaluate Top Level Form (defun)"?

seancorfield17:09:23

I've always thought it's weird to have (defun) in there. Just ignore it (it's a Lisp-ism). The command is just "Evaluate Top Level Form".

👍 1
🙏 1
pez19:09:01

Yes, a Lisp-ism. It's so that Emacs folks should find it when they search the command palette.

emacs 1
Eugen17:09:57

@pez: I am loking at rich4clojure and planning to go through the exercise. I noticed some PR's there that I can review for you to merge (if you like). I woul also made a PR to upgrade RCF library to a release + I think we should add the user ns for that to work OOTB: https://github.com/hyperfiddle/rcf#usage > >

(ns user ; user ns is loaded by REPL startup
>   (:require [hyperfiddle.rcf]))
> 
> (hyperfiddle.rcf/enable!)

pez19:09:23

PR welcome!

pez19:09:14

As for the other PRs. I have been a bad maintainer... And thing is that I generate the problems from another repo, so it needs to be fixed there. I think that repo might still be private, because very untidy... Let me come back about it when I have checked it out some.

Eugen20:09:46

I reviewed all of them and I think they are ok to merge, except the fibo PR, which I am not sure

Eugen20:09:07

made a PR for RCF upgrade and will do another for the user ns one

Eugen20:09:43

PR for user ns is up

pez20:09:02

Yeah. it is not that they are not good to merge. It is that the changes will be overwritten when I regenerate the problems.

pez20:09:35

Merged your first PR. Had a question about the other one.

👀 1
Eugen21:09:48

replied. short version: repl does not work for me in Calva (at leaset how I use it)

pez06:09:37

For the record, I like the change a lot. Just that it will be confusing if we leave the repl.clj file, and the. instructions to use it, in there.

Eugen06:09:47

yeah, I tried it now and evaluated repl and it enabled tests. I can move repl.clj -> user.cljC and mybe it will work. WDYT?

pez06:09:35

I think that if it works with the user.clj in the PR. Then just removing dev/repl.clj (together with the instructions to load it), should do.

pez06:09:58

There might be something needed to be done with the Gitpod setup as well, but probably not. I haven't checked, so testing your PR with Gitpod is probably a good idea.

Eugen06:09:13

I am not familiar with gitpod

Eugen06:09:40

repl.clj has some CLJS stuff. do we need to keep that ?!

pez06:09:22

Gitpod is basically VS Code running in the browser. Try the URL: https://gitpod.io/#https://github.com/PEZ/Rich4Clojure (Then that needs to be adjusted to run from your PR, not completely sure how to do it.)

Eugen07:09:05

thanks. I have it opened locally so not an issue. I can remove it and commit

pez07:09:18

> repl.clj has some CLJS stuff. do we need to keep that ?! I don't think so. I still think just removing the file should work. (Afaiu the PR)

Eugen07:09:15

it failed to load for me but I have poor internet

Eugen07:09:24

I am on vacation, hotel

pez07:09:19

Might be a bit heavy for that. But you should try when you're on a better wifi. It is amazing.

Eugen08:09:02

resolved last PR issue