Fork me on GitHub
#shadow-cljs
<
2019-01-31
>
knubie01:01:53

does clojure.test.check.clojure-test/defspec work with shadow-cljs’s built-in test runner?

thheller06:01:56

@steedman87 if you use the latest version yes. older versions didn't.

👍 5
knubie12:01:15

Oh, wow I was several versions behind. They new in-browser test runner looks amazing!

knubie12:01:14

And of course defspec works now 😁

aisamu13:01:16

Hey! Are requires outside of nss supported in shadow (or cljs, for that matter) This (admittedly old) blog indicates that it would be possible https://anmonteiro.com/2016/10/clojurescript-require-outside-ns/. When trying it on a cljc file, it fails with:

CompilerException: java.lang.RuntimeException: Feature should be a keyword: (require (quote [clojure.spec.alpha])), compiling:(.../spec.cljc:12:35)
regardless of it being wrapped in a #?:clj, #?:cljsor nothing

thheller14:01:39

no they are not supported since it doesn't provide any feature you wouldn't get by putting in in the ns in the first place

thheller14:01:55

you can't do conditional includes that way if that is what you were trying to do

👌 5
aisamu14:01:37

Ok, thanks! That is precisely what I'm trying to achieve... is it possible with some other technique?

Pavel Klavík20:01:51

Hi, I am trying to get shadow-cljs setup running. I am using Cursive and would like to connect its REPL to the browser session. After starting shadow-cljs watch app, I get: shadow-cljs - nREPL server started on port 9000 When I connect to it, it is a Clojure REPL instead, not connected to browser. (Things like (js/console.log "Test") fail with RuntimeException.)

thheller20:01:22

that is normal and intended

thheller20:01:07

you need to switch the CLJ repl to the CLJS repl of your build

thheller20:01:18

so (shadow/repl :app)

knubie20:01:03

@thheller did that change from (shadow/nrepl-select :build-id)?

thheller20:01:04

(shadow.cljs.devtools.api/repl :app) in case the alias isn't setup correctly

thheller20:01:37

@steedman87 no. repl automatically calls nrepl-select when in nrepl context

knubie20:01:46

ah good to know

Pavel Klavík20:01:07

I see, that is little bit confusing.

Pavel Klavík20:01:51

Any way to automate this, so I don't have to type it on every start?

lilactown20:01:24

I'm not sure if Cursive has this built in, but in Emacs/CIDER when I run my ClojureScript jack-in command in a shadow-cljs project, it asks me which build I want to select and runs that command for me

thheller20:01:24

@pavel.klavik you can create a custom REPL command and bind it to a key

thheller20:01:38

or just use the REPL history

Pavel Klavík20:01:47

ok, that solution is good enough

Pavel Klavík20:01:29

btw. the tool looks great, it is good that I finally can easily add JS libraries to the project 🙂