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`.
vncz 2021-06-11T15:13:01.238Z

Is there any specific requirement that I need to get Jack in Running? I’m trying to start a project whose deps.edn file is not in the root directory but nothing happens. It works if I open VSCode in a way that deps.edn is in the root. Is there a way to change this?

pez 2021-06-13T09:38:17.250100Z

I don’t know what is going on. Despite that note in the docs, you are supposed to be able to have a structure like:

- foo
  - bar
    - deps.edn
    - src
      - baz.clj
And having baz.clj open jack-in should work. It does when I try it. Can you create a minimal repro of the problem? That will make it easier to figure out.

vncz 2021-06-13T13:37:21.250900Z

Yes, I think I can try to make it happen!

bringe 2021-06-14T01:50:21.251100Z

@pez Should we update the docs to mention that?

pez 2021-06-14T05:51:52.251300Z

Yes, we should probably try to describe how the project root is determined on this page https://calva.io/workspace-layouts/ and link to it from the connect page.

👍 1
bringe 2021-06-14T17:47:42.255600Z

Made an issue to track it for later

bringe 2021-06-11T15:52:14.238400Z

A believe a deps.edn file is required at the root of the opened project. CC @pez

vncz 2021-06-11T15:52:40.238600Z

That seems to be the case; I was wondering if there’s a workaround for this

bringe 2021-06-11T15:53:57.238800Z

I don't think so. There's a note about that requirement here: https://calva.io/connect/#jack-in-let-calva-start-the-repl-for-you

👍 1
cjsauer 2021-06-11T16:58:28.242200Z

Quick question: is there a way to specify a namespace to be auto-loaded on jack-in? I’ve been having to manually eval my user.clj file and can’t seem to find a setting for that. Maybe it’s deps.edn specific?

cjsauer 2021-06-14T16:39:44.255Z

Doh! I hadn’t added src/dev to my :extra-paths key of the :dev alias! Thanks for pointing this out, it’s working now!

bringe 2021-06-14T17:41:32.255300Z

No problem!

Ryan Jerue 2021-06-11T19:38:45.243100Z

You could specify with afterCLJReplJackInCode

Ryan Jerue 2021-06-11T19:45:09.243800Z

Yeah, just tested it and it would work. Inside of settings.json 👉 calva.replConnectSequences create/edit a sequence and in the object add: "afterCLJReplJackInCode": "(ns my-ns.core)"

Ryan Jerue 2021-06-11T19:46:23.244Z

Full object was…

{
            "name": "Leiningen Ex",
            "projectType": "Leiningen",
            "cljsType": "none",
            "afterCLJReplJackInCode": "(ns my-ns.core)",
            "menuSelections": {
                "leinAlias": null,
                "leinProfiles": [
                    "dev",
                    "repl",
                    "user"
                ]
            }
        }

cjsauer 2021-06-11T20:25:02.244300Z

Hm that doesn’t seem to work for my deps.edn project. I see (ns user) get evaluated resulting in nil, but it doesn’t seem to actually load the namespace (all of the symbols are still unresolved)

2021-06-11T20:44:46.246200Z

I keep having trouble with shadow-cljs — I start my shadow app with: npx shadow-cljs watch frontend and connect to an existing repl and use the :frontend option — When I try to evaluate something I get: No available JS runtime.

pez 2021-06-11T22:22:02.247600Z

Try having a Clojure file from the project opened when you Jack in.

vncz 2021-06-11T22:24:11.247900Z

I tried that already, but it did not make any difference

vncz 2021-06-11T22:24:28.248100Z

It’s not a big deal — I have essentially some openfaas functions and each of them has its own directory and deps.end file

bringe 2021-06-11T22:58:49.248800Z

If I have a file, dev/user.clj, and in my deps.edn I have {:paths ["src" "dev"]}, after I jack-in the vars I define in the user namespace exist.

bringe 2021-06-11T23:00:32.249Z

By default, tools.deps includes the "src" path, so if you have src/user.clj that file will be loaded even if your deps.edn is just {}

bringe 2021-06-11T23:01:25.249200Z

So, you don't need to use a repl connect sequence, this is built in to tools.deps and I think leiningen. The file just needs to be on your classpath.

bringe 2021-06-11T23:02:55.249400Z

I'm guessing it's a browser app. Do you have the app loaded in the browser?

bringe 2021-06-11T23:03:50.249600Z

If it's a browser app, the browser is used as the runtime, so it needs to be loaded in order for evaluations to work in the editor/repl.

bringe 2021-06-11T23:05:10.249900Z

At least, I think I'm understanding that correctly 😄 . I've had a similar issue in the past when doing browser-based cljs dev.