Fork me on GitHub
#spacemacs
<
2019-06-17
>
Andrea Imparato10:06:54

hello, anybody knows if there's a way in spacemacs to automatically refresh the browser when sending something to the clojure repl?

practicalli-johnny11:06:12

@andrea.imparato if you are using Ring to drive your server-side web application, then you can use wrap-reload around your application and it will reload the browser when changes are saved. For example https://practicalli.github.io/clojure-webapps/middleware-in-ring/wrap-reload.html

kirill.salykin11:06:48

or maybe you want something like figwheel

practicalli-johnny12:06:59

Yes, figwheel if it's client side ClojureScript that you want to reload

practicalli-johnny17:06:33

Anyone using clj-kondo in Spacemacs yet for linting their clojure code? I plan to give it a try this week. Would like to see how it compares to joker

lread17:06:27

@jr0cket I opted to enable both joker and clj-kondo so I first added these to my .spacemacs config like so:

dotspacemacs-additional-packages '(flycheck-clj-kondo flycheck-joker)
And then again in .spacemacs added the following under dotspacemacs/user-config
;; setup clojure linters
  (use-package clojure-mode
    :ensure t
    :config
    (require 'flycheck-joker)
    (require 'flycheck-clj-kondo)
    (dolist (checkers '((clj-kondo-clj . clojure-joker)
                        (clj-kondo-cljs . clojurescript-joker)
                        (clj-kondo-cljc . clojure-joker)))
      (flycheck-add-next-checker (car checkers) (cons 'error (cdr checkers)))))

👍 12
practicalli-johnny18:06:27

That's great, thank you. I will give this a try later tonight. I wonder how easy this would be to add to the Clojure layer as a pull request... Would be great to have them as options you can enable through variables (like is done with clj-refactor)

lread19:06:24

Would be awesome to have as an option in the clojure layer.

☝️ 4
jumar08:06:55

I've found this: https://github.com/borkdude/flycheck-clj-kondo/issues/2 => You might need to modify the snippet a bit

jumar09:06:08

But anyway, thanks for pointing this out. I've just given the clj-kondo a second chance and it looks great!

jumar09:06:52

this may be helpful when contemplating about the joker vs. clj-kondo differences: https://speakerdeck.com/borkdude/clj-kondo-a-linter-for-clojure-code-that-sparks-joy-dcm-may-19

lread11:06:17

@U06BE1L6T thanks for pointing out the git issue. My config is based on clj-kondo docs - seemed to work but have not tested extensively at all.

lread15:06:11

oh I see... docs are going to be updated so my snippet here will indeed change