Fork me on GitHub
#shadow-cljs
<
2020-04-03
>
beders02:04:55

(note to self: read the very good shadow-cljs manual)

☝️ 12
teodorlu07:04:53

It's so nice to have a manual that reads from the user's perspective, in an order that makes sense to the user.

tony.kay16:04:51

@thheller thanks for the improved builds screen…much easier to control builds now in .94

👍 12
David Pham18:04:38

Just a small trick for anyone interested: you can combine deps.edn aliases and shadow-cljs.devtools.cli to have different paths and dependencies between you dev and release builds! I find it it really useful for environment variables for different process and you can have Clojure files instead of using the :closure-defines in shadow-cljs.edn. There is also the debugging library that forces to have different version between dev/prod for re-frame.

David Pham18:04:33

@thheller thanks a lot for shadow-cljs. It made my journey into CLJS and front end extremely enjoyable :)

David Pham18:04:15

Thanks to you, I convinced the hire up in my unit to use CLJS as our default front end tool :)

👍 4
Felipe Marques21:04:08

Hi, I'm trying to init a repl on a specific namespace using the :repl-init-ns , but it does not seem to work. I'm connecting with the command (shadow.api/nrepl-select :app)

Felipe Marques21:04:16

Anyone has any idea?

dpsutton21:04:03

> You may configure the namespace you start in when connecting by setting `:init-ns` in the `:nrepl` options. It defaults to `shadow.user`.

dpsutton21:04:29

did you try this?

Felipe Marques21:04:14

this is for the clojure repl right?

Felipe Marques21:04:31

In this case I want to set the initial namespace for the cljs repl

dpsutton21:04:49

i believe that's for the cljs repl

Felipe Marques21:04:10

ok, let me try this

Felipe Marques21:04:38

it didn't work either 😞

dpsutton21:04:46

{:builds
 {:app {:asset-path "/js"
        :modules {:main {:init-fn app.main/init}}
        :output-dir "public/js"
        :target :browser
        :devtools {:repl-init-ns app.main}}}
 :dependencies [[reagent "0.8.1"]]
 :dev-http {3000 "public"}
 :http {:port 9631}
 :source-paths ["src"]}

dpsutton21:04:02

make sure its under devtools

dpsutton21:04:31

the docs don't mention these should be under :devtools key in the build map. but the example shows it there

Felipe Marques22:04:57

yes, I'm following exactly this example. Everything seems right

dpsutton22:04:07

that works for me

dpsutton22:04:25

~/p/c/asg-ignite-app ❯❯❯ shadow-cljs cljs-repl app
shadow-cljs - config: /Users/dan/projects/clojure/asg-ignite-app/shadow-cljs.edn  cli version: 2.8.83  node: v12.1.0
shadow-cljs - HTTP server available at 
shadow-cljs - server version: 2.8.83 running at 
shadow-cljs - nREPL server started on port 63308
app.main=>

Felipe Marques22:04:22

This is the function that I run at Clojure REPL to start the ClojureScript repl

(defn start! []
  (shadow.server/start!)
  (shadow.api/watch :workspaces)
  (watch-with-profile :app :dev)
  (shadow.api/nrepl-select :app))

Felipe Marques22:04:31

Is it different from running cljs-repl?

Felipe Marques22:04:24

Yeah, it is definilty they way I'm starting. WIth command-line it starts in the correct ns.

Felipe Marques22:04:04

Humm, yeah, I imagine I might be doing something wrong

Felipe Marques22:04:37

I'll try to figure it out. Thanks for the help.