Fork me on GitHub
#emacs
<
2019-02-06
>
theeternalpulse04:02:25

When loading an emacs lib using (use-package .... :load-path does it copy the file into melpa

narendraj906:02:14

To have the package downloaded from melpa, you have to add (use-package package-name :ensure t) :ensure like this.

theeternalpulse06:02:56

ooh I worded that completely wrong. I meant in cases where I have the plugin in a local directory and use that , does it copy the plugin folder into the .emacs.d/elpa cache

mgrbyte18:02:57

i think you can do describes-package and it'll show you where it's being used from

narendraj919:02:58

@U1CUUKHDL. For that I think you can use :pin local with :load-path "./" in your use-package declaration.

theeternalpulse19:02:47

Ah cool let me use that

vemv18:02:28

anyone using clojurescript + CIDER + figwheel + one of [component, integrant]? I'm interested in the Component part, never tried such a setup. I suspect it could be more robust. does it work fine? any rough edges? I would imagine reconnection can be an issue as you reset your Component system

vemv18:02:26

Maybe resetting the sockets on every reset would be a recipe for disaster... so my Component could just not do that an useful thing that could be done on reset is clearing the cljs compiler cache and such... it can get unrecoverably corrupt as one switches Git branches

andrea.crotti19:02:04

I use figwheel main cider and integrant

andrea.crotti19:02:42

And to be fair I rarely restart anything integrant just brings the system up

andrea.crotti19:02:58

But everything works pretty well anyway

vemv19:02:12

is it a full-stack or frontend-only project?

andrea.crotti20:02:06

you just need things like

(defmethod ig/init-key :server/figwheel [_ {:keys [build] :as opts}]
  (log/info "Running figwheel build " build)
  (figwheel/start {:mode :serve} build))

andrea.crotti20:02:23

and something like

(defmethod ig/init-key :server/jetty [_ {:keys [port host reload?]}]
  (let [handler
        (if reload?
          (wrap-reload #'server/app-handler)
          server/app-handler)]

    (log/info "Running Jetty with auto reloading = " reload?)
    (jetty/run-jetty handler {:join? false
                              :host (or host "127.0.0.1")
                              :port port})))

(defmethod ig/halt-key! :server/jetty [_ server]
  (.stop server))

andrea.crotti20:02:26

for jetty for example

andrea.crotti20:02:30

it's quite easy to do

andrea.crotti20:02:47

we also have nrepl and sass compilation there

vemv20:02:54

thanks so far! does emacs connect to your figwheel or nrepl component?

vemv20:02:02

(for the clojurescript part)

andrea.crotti20:02:17

no actually the figwheel in integrant bit is only used when running outside of Emacs

andrea.crotti20:02:36

inside Emacs we still use the rest of the stuff, but figwheel main is started by Cider itself

andrea.crotti20:02:08

there is just some code in user.clj to start the rest of the integrant shebang

vemv20:02:06

ah damn... that was the part that interested me the most 🙂

andrea.crotti20:02:54

well it's one line

andrea.crotti20:02:55

(ig.repl/set-prep! (constantly dev-config))

andrea.crotti20:02:21

and then if you import this [integrant.repl :as ig.repl :refer [clear go halt init reset reset-all]]

andrea.crotti20:02:30

you just have to type (go) in your Clj repl

andrea.crotti20:02:56

I can't share the actual code because it's from work but I'll add something similar now to my own OSS project which I can instead share

andrea.crotti21:02:53

just got it working on one of my personal projects

andrea.crotti21:02:25

integrant is really just handling jetty when you start with Emacs

vemv21:02:40

hey! hmmm, let me make sure... I was talking about figwheel main is started by Cider itself... that's the part I'm trying to avoid the goal is having all the "server side" (figwheel, nrepl etc) inside Integrant. So emacs becomes a thin client

andrea.crotti21:02:30

well you can probably do that but don't want you want a cljs repl?

andrea.crotti21:02:28

you can start everything with integrant and do cider-connect into a running nrepl

andrea.crotti21:02:43

but I'm not sure if cljs would work though

vemv21:02:50

yeah that's what I'm curious about... particularly when the "figwheel component" is subject to restarts