Fork me on GitHub

I found a possibly connected issue. After I jack in, at some point CIDER send artifact-list message which gets back a loooooot of stuff. Emacs becomes completely very slow after that. I assume this is related to, but why does this happen unprompted (I'm not using add-dependency or anything)?


cider used to add a proper namespace when creating files through projectile, but it does not do that anymore. How can I turn that behavior back on?


@alexyakushev That’s clj-refactor.el, not CIDER. I’ve never used it, that’s why I also never notice issues with it.


@achikin CIDER never added ns forms to empty source files. I think this is something that clj-refactor.el did.


@bozhidar probably I had it in lein profiles on previous machine... does refactor work for clojurescript?


Yes, it does.


Turns out that clj-refactor should have been "enabled" in .spacemacs config....


I figured as much. It used to be enabled by default in Spacemacs, but a lot of newcomers were very confused by some of the problems they’d encounter when it’s on (e.g. something like the issue @alexyakushev mentioned), and it was often out of sync with CIDER, so in the end we decided it was best to disable it by default. If someone needs it they’ll know how to enable it.

👍 12

@bozhidar I found a flag to disable clj-refactor artifact fetching, and it became slightly better. However, I still see occsaionally that track-state is responsible for 50% of what my application is doing. Can I disable it somehow?


Currently you can’t - if you disable it dynamic font-locking would stop working, and so will the tracking of the REPL type.


I’m guessing the issue is the ns state that can be quite big in some cases, so potentially we can drop only it.


File some ticket about this and we can discuss options there further.


But I really wonder what has changed for you, as the track-state middleware has been almost the same since its initial version 5 years ago.


I'm working on a really big project right now.


This could be the reason


I will try to monkey-patch the function to disable it. Dynamic font-locking is not so important when every REPL command takes 5 seconds.


Yeah, I totally get it. It was just never a performance issue so far.


(at least not on the server side)


currently my cljs workflow is to lein repl in a terminal, then within emacs, to cider-connect, and in the repl that appears, (use 'figwheel-sidecar.repl-api) and then (start-fighwheel!), followed by (start-repl) to get a cljs repl; at this point I've completely lost track of what I've done to my system and environment to make that all work (although a, say, 'lein new luminus <appname> works out of the box for those commands); my question is what I need to do differently in that workflow to get shadow-cljs to work, and also if I should be doing something different to use figwheel-main, the benefits of which I'm still unaware (but very possibly would like); I realize I should rtfm, but in trying to do that I am a bit confused now about the options and permutations between figwheel and shadow-cljs.


if i were you i would just set up a shadow-cljs project. and learn how to use the repl from the command line


once that works, then just run cider-jack-in-cljs and it will just work


@dpsutton sounds good (and you had told me that in the past!)... I actually did that so that works, and I'll carry forward with that approach...


I did also find the cider-jack-in-clj&cljs command as well, which is handy.


old habits die hard.


although I guess I've always felt a bit enhanced by having my lein repl separate from my running emacs so that I can restart emacs and reconnect to a running lein repl, much like I prefer tmux or screen to just a terminal... but I really don't hardly restart emacs, so it's a bit of a moot point.


and reading 'Hard CIDER: Understanding the Jack-in Process' now to understand it all more.


no matter what, these tools are all awesome, something I continually reflect on.


sure. if you choose to go the route of starting from the command line, look at what command CIDER issues and then just run that exact command from the command line. In fact, a nice addition to CIDER would be for it to generate and put that in the kill ring for you


i think i made that once locally but not sure


You can also use the prefix argument C-u M-x cider-jack-in-cljs (or equivalently C-u C-c M-J) and cider will let you see and edit the command it’s using to launch the repl.


ok, that sounds helpful.