Fork me on GitHub
Jason Bullers03:03:07

Hi all, just trying out duct for the first time and trying to get a +cljs project working in vscode with calva (really enjoy developing in this environment!). @pez I found a conversation from a few years ago where you were trying to get it running and James suggested adding something to lein-duct. I can't find any follow up information, though. Anyone have any suggestions or recommendations?


Hi! I don’t remember how my attempts ended with this, unfortunately.

Jason Bullers13:03:21

One of the things you mentioned trying was these settings:

    "calva.replConnectSequences": [
            "name": "Server only",
            "projectType": "Leiningen",
            "afterCLJReplJackInCode": "(do (dev) (go))",
            "cljsType": "none"
            "name": "Server + Client",
            "projectType": "Leiningen",
            "cljsType": {
                "dependsOn": "lein-figwheel",
                "connectCode": "(do (dev) (go) (println \"Server started\") (cljs-repl))",
                "isReadyToStartRegExp": "Server started",
                "printThisLineRegExp": ":duct.server.http.jetty/starting-server"
I can give it a try later, but where do I put this? I haven't checked the Calva website yet. Is there a guide for this configuration?


It goes into .vscode/settings.json. Guide, idk. 😃 But there is some documentation:

👍 1
Jason Bullers03:03:57

On a related note, is duct still alive and well? It doesn't seem like there's been much activity lately and it hasn't reached 1.0.0 yet despite being a few years old. It's a really neat little framework


I'm still around at least, though I haven't worked on Duct for a little while. I went through a period of burnout for a year or two where I had minimal open source involvement (basically just reviewing and merging PRs), and now that I'm more active I'm working my way through the backlog.

👍 2
Jason Bullers02:05:25

Ah, I see. I hope you've had the time needed to recover. I've seen your name attached to quite a lot (and I'm sure you've got more going beyond that), so I'm sure it's not easy to stay on top of everything. Much appreciated though: your repos and talks around transparency through data and DI have been illuminating


We are using it in all of our projects. The only thing we were missing was figwheel-main support, as the Duct included lein-figwheel option is no longer an option for us. We simply created a figwheel-main Duct library implementing a duct/server.figwheel compatible[1] solution: [1] As compatible as possible, as figwheel-main configuration is not 100% compatible with the old lein-figwheel solution.

👏 1
👍 1
Jason Bullers17:03:57

Cool, I'll check it out, thanks. What was it about lein-figwheel that didn't work? Did you switch to tools.deps or something?


We are still using Leiningen in our projects (both because it suits us well, and because using Duct with deps.edn is more work and a bit of a hassle). But the main reasons was that we wanted to have ClojureScript hot-reloading on file saving, without having to execute (reset) in the REPL, and also that lein-figwheel was considered "the old choice" by its author, and recommends that you switch to figwheel-main (if you can). So we suspect lein-figwheel is going to go in "not actively supported mode" in the short term. As a side-effect we got another benefit. We had a lot or weird issues with protocols when we run (reset) (we use protocols a lot, to define the boundaries of our system with the external subsystems, as we are using the hexagonal architecture for our apps). We were not able to get to the bottom of the issue with lein-figwheel, but switching to figwheel-main made those weird issues totally disappear.

👍 1