So, @Yogthos and I started to look at why it was a bit tricky to get a fresh Luminus project working smoothly in Calva. Turned out there was a missing piece in Calva’s Jack-in. I fixed that, and also got some changes into Luminus that now makes it super easy. Check this out, please:
Once the project is connected, Calva provides the essentials for REPL powered development. I hope it will help more people discover how great Clojure and ClojureScript is.
Calva has the same Getting Started support for fresh JUXT/Edge projects, btw. If you know of other templates that should get attention, please let me know.
See also: How to use Luminus w/ Calva
Your feedback is wanted.
Exactly what I needed - thanks! I’m also looking at Duct - any plans to do a similar getting-started guide for Duct?
You are welcome, sir!
Never heard of Duct. I’ll have a look at it and see what I can figure out.
Duct is server-side only, AFAIK.
It looks like it has cljs support as well. If you are using it for only server side, just select Leiningen as project type and dev as profile and you should be good. (Not tested this, but from the looks of it, I can’t see why it wouldn’t work.)
I’ll write a guide about using Calva with Duct, as well as file a PR on the Duct template so that things are as streamlined as they are with Calva+Luminus.
Until then. These are the steps for using Calva with a fresh Duct project w/ ClojureScript frontend adding the custom cljs settings yourself (w/o frontend, it is not much to write about ):
- Create the project:
lein new duct my-duct-cljs +site +example +cljs
- Open the project in VS Code:
- Create a VS Code project folder settings file
.vscode/settings.json, and paste this:
See Calva docs about Custom Connect Sequences if you are curious about the settings.
"name": "Server only",
"afterCLJReplJackInCode": "(do (dev) (go))",
"name": "Server + Client",
"connectCode": "(do (dev) (go) (println \"Server started\") (cljs-repl))",
"isReadyToStartRegExp": "Server started",
- Issue the command Start a Project REPL and Connect (aka Jack-in),
- Wait for the Calva says output channel to say CLJS REPL ready to connect. Please, start your ClojureScript app.
- Open your web browser, pointing it to 127.0.0.1:3000/example.
- Hack away on your project!
If anyone tries this, please let me know how the instructions worked. It’ll help me get the Calva docs right.
This is amazing - thank you. I’m at work right now, but I’ll try this tonight and write-up any notes / observations and post them here.
Also, I want to thank you for Calva itself. I’m sure you’ve heard this before, but it’s worth repeating: Calva is such a valuable contribution to the Clojure world.
You are most welcome. And thanks for telling me this!
Just tried the Duct support, following your instructions - it all worked fine. Thanks again.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.