Fork me on GitHub
#shadow-cljs
<
2020-11-13
>
thheller12:11:34

did anyone upgrade to big sur yet? I'd be curious if this issue still exist in the final release. https://github.com/thheller/shadow-cljs/issues/767

rkiouak14:11:07

apologies if theres an easy reachable answer to this (I wasn’t able to find it) — is there a way to reference an environment variable in the dev-http block of shadow-cljs.edn?

thheller14:11:03

todo what exactly?

rkiouak14:11:05

e.g. i want to be able to do something like:

{:nrepl    {:port 8777},
 :dev-http {8280 {:root             "resources/public",
                  :proxy-predicate  foo.bar/proxy-predicate,
                  :push-state/index "baz/index.html",
                  :proxy-url        (or (System/getenv "FOO_BAR_URL") "")}},
...
}
 

thheller14:11:38

#shadow/env ["FOO_BAR_URL" ""] second value is default if env var is not set

rkiouak14:11:20

ah, thank you… i did see that form in your docs, but i thought it had to occur in this block :closure-defines {http://your.app/URL #shadow/env "APP_URL"}`

rkiouak14:11:34

foolish of me not to try, thanks for the help and love the tool!

thheller14:11:13

yeah works everywhere. not specific to :closure-defines

jmckitrick17:11:32

So if I have cider connected to a shadow project and the repl is warning me `No available JS runtime.` yet jump-to-definition is working, what functionality will I be missing?

thheller17:11:08

many cider operations don't actually require eval so they'll work. everything that does eval will need a runtime.

jmckitrick19:11:29

Ah, ok. Turns out I figured out the issue. Gotta load the right page 🙂

cap10morgan20:11:33

How can I use a local closure-compatible JS lib? Specifying :libs ["../path/to/lib"] and then requiring it as a namespace doesn't seem to work.

thheller20:11:04

just needs to be on the classpath normally

thheller20:11:23

no extra option required afterwards

cap10morgan20:11:52

With (:require ["sjcl/hmac" :as hmac]) I'm getting:

Execution error (AssertionError) at shadow.build.data/add-string-lookup (data.clj:119).
Assert failed: (symbol? sym)

thheller20:11:28

hmm? whats the full stacktrace?

cap10morgan20:11:32

and src/sjcl/hmac.js exists

thheller20:11:50

this is a file with goog.provide?

thheller20:11:06

then it should be (:require [sjcl.hmac :as hmac])

cap10morgan20:11:24

does the FS path need to match the goog.provide value?

cap10morgan20:11:57

i.e. goog.provide("foo.bar.baz") need to be in src/foo/bar/baz.js or similar?

thheller20:11:12

ideally yes but it doesn't have to

cap10morgan20:11:31

got it, thanks!

Ronny Li22:11:15

Hi everyone, I just stumbled on shadow.markup (https://github.com/thheller/shadow/wiki/shadow.markup) and thought it looked interesting but it hasn't been updated in 2 years. Is anyone here using it in production and would like to share their experience?