btw I missed this. you can set :js-options {:entry-keys ["module" "browser" "main"]}
to make it use module
by default. it isn't in the list by default since mixing commonjs and ESM is PITA. in the next release it'll use module
last just in case neither browser
or main
are set.
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
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?
todo what exactly?
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") "<https://bat.com/>")}},
...
}
#shadow/env ["FOO_BAR_URL" "<https://bat.com/>"]
second value is default if env var is not set
https://shadow-cljs.github.io/docs/UsersGuide.html#shadow-env
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"}`
foolish of me not to try, thanks for the help and love the tool!
yeah works everywhere. not specific to :closure-defines
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?
https://shadow-cljs.github.io/docs/UsersGuide.html#repl-troubleshooting
many cider operations don't actually require eval so they'll work. everything that does eval will need a runtime.
Ah, ok. Turns out I figured out the issue. Gotta load the right page 🙂
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.
just needs to be on the classpath normally
no extra option required afterwards
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)
hmm? whats the full stacktrace?
and src/sjcl/hmac.js
exists
this is a file with goog.provide
?
yes
then it should be (:require [sjcl.hmac :as hmac])
ah ok
does the FS path need to match the goog.provide value?
i.e. goog.provide("foo.bar.baz")
need to be in src/foo/bar/baz.js
or similar?
ideally yes but it doesn't have to
got it, thanks!
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?