Fork me on GitHub
#cider
<
2019-11-07
>
alexyakushev00:11:07

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 https://github.com/clojure-emacs/refactor-nrepl/pull/268, but why does this happen unprompted (I'm not using add-dependency or anything)?

achikin07:11:52

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?

bozhidar07:11:56

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

bozhidar07:11:45

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

achikin07:11:36

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

achikin07:11:36

Yes, it does.

achikin07:11:14

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

bozhidar08:11:20

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.

👍 3
alexyakushev13:11:38

@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?

bozhidar13:11:43

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

bozhidar13:11:28

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

bozhidar13:11:39

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

bozhidar13:11:20

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.

alexyakushev13:11:57

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

alexyakushev13:11:01

This could be the reason

alexyakushev13:11:12

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.

bozhidar14:11:24

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

bozhidar14:11:38

(at least not on the server side)

macrobartfast18:11:29

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.

dpsutton18:11:36

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

dpsutton18:11:50

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

macrobartfast19:11:09

@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...

macrobartfast19:11:07

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

macrobartfast19:11:20

old habits die hard.

macrobartfast19:11:32

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.

macrobartfast19:11:01

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

macrobartfast19:11:10

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

dpsutton20:11:46

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

dpsutton20:11:11

i think i made that once locally but not sure

gonewest81820:11:02

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.

macrobartfast23:11:57

ok, that sounds helpful.