Fork me on GitHub
#cursive
<
2022-04-02
>
jeffmk14:04:00

Was told I may have better luck here, so x-posting: > Anyone know of good no-frills guides for getting a minimalist ClojureScript project up and running from scratch, that integrates well with IntelliJ/Cursive? I've been out of the CLJS game for a while and frankly what's out there from my searches is pretty confusing to me. I'd prefer to take a deps.edn and/or shadow-cljs route if feasible. Ultimate goal is to get a Reagent site going, if that changes anything

cfleming22:04:28

I’d recommend just using the Shadow documentation for the initial project setup, it’s what I use for my CLJS projects and it works well. I just use plain Shadow but it’s easy to combine with deps as well if you want to. Thomas is a Cursive user and is super responsive in the #shadow-cljs if you get stuck. Once you have the basic project set up then any Reagent tutorial should do, I think.

jeffmk05:04:58

Thanks! I like that approach (avoiding deps.edn), since my current goal is to minimize complexity. I think shadow-cljs pom did the trick for getting Cursive to see Reagent properly

SK17:04:28

hi! how can I profile Clojure code via Intellij? I've tried to start a REPL using the intellij profiler, but it pops up a red window saying cannot patch configuration, as described in this ticket: https://github.com/cursive-ide/cursive/issues/2514 . Any hints/tips how to do profiling? thanks! (sorry for the repeated question, but got absolutely no reaction a week ago)

Ivar Refsdal19:04:41

Hi. My advice does not specifically address your question, but may be helpful nonetheless: I recommend clj-async-profiler: https://github.com/clojure-goes-fast/clj-async-profiler Works great, very little hassle. There is also tufte, though you need to manually tell what to profile: https://github.com/ptaoussanis/tufte. Neither is specific to Cursive.

👍 1
Ivar Refsdal19:04:07

One small note: "Our" Clojure JVM containers running in the cloud (Azure Container Instances) are not able to use clj-async-profiler due to some kernel restrictions... So there profiling something "live" in production/stage we need to use tufte.

👍 1
cfleming22:04:11

Cursive doesn’t have any explicit functionality for profiling, and I haven’t had a chance to look at that issue, sorry.

👍 2
SK10:04:12

@U0567Q30W the issue is about allowing the intellij built-in profiler to cooperate with Clojure. Maybe there is only some small issue preventing the start of a cursive REPL with profiling and if that would work, cursive would gain profiling "for free"

SK10:04:09

@UGJE0MM0W thanks! Tufte I've tried but - as you say - manually adding all relevant functions is kind of a hassle. The clj-async-profiler looks good, I'll give it a try! thx

cfleming22:04:56

Sure, I understand, I’ll try to look at that to see if it’s an easy fix.

Benjamin C20:04:20

Curious if it is possible to use Cursive and Cider at the same time. In particular, is there a way to use the nrepl-refactor middleware with Cursive?

cfleming22:04:51

No, there isn’t, sorry. Cursive does allow you to define REPL commands which you might be able to hook up to refactor-nrepl, but I’m not aware of anyone having done it, and it’s likely tricky since it expects you to be using middleware.

Benjamin C01:04:29

Ah okay. I think I've got most of what I was after by starting the nrepl first with Cursive, and then connecting to that repl with Cider. Doesn't have the refactor middeware of course, but by hooking up clojure-lsp I get most of that functionality at the cost of ~ 2GB more RAM. Thank you for Cursive by the way, it has been very helpful! I learned both Clojure and Emacs at the same time. Took a bit to get everything going. I am very impressed with how much Cursive does for you out of the box. Great UX.

cfleming09:04:47

Thanks, I’m glad it’s helping!