Fork me on GitHub
#shadow-cljs
<
2018-12-21
>
reaysawa02:12:05

sup! when I switched to Lein following the user guide, I noticed I also had to manually include the same clojure/script jars as shadow-cljs in the dependencies did I do something wrong?

reaysawa02:12:47

after specifying them directly, the scripts began working again

ouvasam07:12:23

Hi, Is there a way to get an env var define in the console (e.g. export URI=http://uri) in the shadow-cljs.edn for compilation ? I use it closure-defines to pass it to cljs code Thanks

ouvasam07:12:05

If possible i would like something like that

thheller08:12:32

@ouvasam it is not recommended to use env vars during compilation since that suggests that you actually want to do runtime configuration during compilation

thheller08:12:11

you could instead call your.app.init("") to initialize your app

thheller08:12:21

that means you can change the URI without actually recompiling your code

thheller08:12:52

other than that you can use :closure-defines {foo.bar/uri #shadow/env "URI"} so use env vars in the config

thheller08:12:05

but that is not recommended

thheller08:12:05

@joao.paulo.silvasouza it is sometimes required to pin clojure/script versions when using lein yes. not doing it wrong as you are otherwise relaying on a bit of randomness when it comes to the deps

aisamu14:12:26

Good morning! What is the recommended approach for testing CLJ files with shadow-cljs? (The reason is testing a macro's helper functions)

thheller16:12:54

@aisamu I typically do this with the clj REPL. not actually writing tests just evaling stuff until it looks right

👍 4
thheller16:12:10

otherwise you can use the clj-run stuff to call your own main function to run the tests

aisamu16:12:39

Great, thanks!

Logan Powell16:12:35

👋 hi everyone! Has anyone used shadow-cljs to publish something to clojars or do I need to use leiningen for this and dup the shadow-cljs.edn file -> project.clj?

thheller16:12:13

@loganpowell publishing with shadow-cljs is not currently supported. project.clj + lein is easier currently IMHO

Logan Powell16:12:57

should it be a 1:1 setup for the project.clj (i.e., can I just copy the shadow.cljs.edn file)?

Logan Powell16:12:25

I only used lein for like a week before finding shadow-cljs

Logan Powell16:12:40

(I have very little lein experience)

thheller16:12:23

only need to copy your :dependencies (don't include clojurescript or shadow-cljs itself)

Logan Powell16:12:45

sweet! thank you 🙂 and thank you so much for all your work with shadow

Logan Powell16:12:10

and all your help on Slack

thheller16:12:49

very welcome

Logan Powell18:12:14

are reader conditionals allowed in shadow? I'm getting an error trying to use them and just want to make sure I'm not barking up the wrong tree

lilactown18:12:32

yes, they are

lilactown18:12:38

what’s the error you’re receiving?

lilactown18:12:35

reader conditionals only are allowed inside of .cljc files

Logan Powell18:12:42

fuck, thank you!

lilactown18:12:09

there’s actually some much cooler things shadow-cljs can do with reader conditionals

lilactown18:12:27

it’s non-standard though

richiardiandrea19:12:12

Hello folks! question about tooling! So say I am working against a node-script target

richiardiandrea19:12:27

and I do yarn shadow-cljs watch dev

richiardiandrea19:12:50

am I also unnecessarily starting the web server machinery?

richiardiandrea19:12:18

(I would expect that is started in :browser targets only

richiardiandrea19:12:42

if that's the case I am interested in knowing if I can save some time in startup by contributing some tweak

lilactown19:12:35

shadow-cljs starts a webserver for administrivia things

lilactown19:12:18

you probably see the log output where it’s starting it on port 9630

lilactown19:12:52

unless you’re also seeing something like:

shadow-cljs - HTTP server for :workshop available at 
in which case I would expect that to not appear if you’re not configured your build to use the dev HTTP server options

richiardiandrea19:12:13

well I do not see it so that's probably already good then

Dec 21, 2018 11:39:24 AM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
Dec 21, 2018 11:39:24 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
shadow-cljs - server version: 2.7.9
shadow-cljs - server running at 
shadow-cljs - socket REPL running on port 44729
shadow-cljs - nREPL server started on port 45909
shadow-cljs - watching build :repl

lilactown19:12:47

yep. the server at 9630 is a kind of admin UI for your builds

richiardiandrea20:12:42

opened a PR against shadow but I think I need some help

ahungry20:12:17

hmm the solution to my jack in issue was to set this in Emacs: `

ahungry20:12:24

(add-to-list
          'cider-cljs-repl-types
          '(my-cljs-node-repl "(do (shadow.cljs.devtools.api/node-repl :dev))"))

ahungry20:12:42

(for shadow + nodejs repl without needing to start it via the CLI each time)