This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-02
Channels
- # announcements (7)
- # aws (3)
- # babashka (132)
- # beginners (38)
- # calva (3)
- # chlorine-clover (6)
- # clara (1)
- # clj-kondo (20)
- # cljs-dev (24)
- # cljsrn (9)
- # clojure (76)
- # clojure-dev (1)
- # clojure-germany (4)
- # clojure-india (2)
- # clojure-uk (24)
- # clojurescript (15)
- # conf-proposals (1)
- # conjure (114)
- # cursive (3)
- # fulcro (63)
- # graalvm (1)
- # helix (2)
- # joker (10)
- # juxt (1)
- # local-first-clojure (2)
- # meander (9)
- # off-topic (97)
- # rdf (4)
- # re-frame (7)
- # reagent (16)
- # reitit (1)
- # rum (9)
- # shadow-cljs (48)
- # spacemacs (3)
- # tools-deps (3)
- # vim (30)
- # xtdb (10)
if you’re doing something like:
(ns config
(:require a))
(def values
{:a a/value})
and a/value
relies on something in namespace b
, then editing b
will not update the value you’ve saved a reference to in your config namespacethe trick is to use a var (at least if while you’re developing):
(def values
{:a #'a/value})
or, a function:
(defn values []
{:a a/value})
hmm, changing values into fn helped, but what is the difference? that the value is recomputed everytime values is called?
@pavel.klavik it depends how you use it. If you use it like def config {:a (a/values)}
then it's only recomputed everytime the ns is reloaded, which is prob. exactly what you want.
@pavel.klavik holding values from other namespaces is not a good idea since it hinders hot-reloading. you can use :devtools {:reload-strategy :full}
in your build config to always reload all dependent namespaces but that can get a lot slower
Thx. In this particular case, probably both solutions are ok since the project is tiny. But it is good to understand how it works.
hi, is there a way to listen to compiling errors in the app? i would like to indicate it somehow in the react native app, thanks
you can copy this file into your src path and modify it however you like https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/devtools/client/react_native.cljs
is there an easy way to show a warning or something that doesn't require knowing anything about other components on the page?
im not sure about expo, but at least would be useful to have an option so shadow throws a warning, how figwheel does
I don't do react-native so someone actually knowing how it works can probably build something nice
I have question: shadow-cljs is getting transient npm dependencies and writes them to package.json. So far so good. But now I also use npm dependencies in the app I am building. And now I have a package.json that is somehow changed by transient dependencies, and partially by the npm dependencies of my app. Now this can get confusing.. as package.json does not allow comments inside. Is it possible to define npm dependencies for my app somewhere else, so that the package.json can become a pure build-artefact do shadow-cljs ?
While installing dependencies for a new shadow-cljs project, I get this error: shadow-cljs - dependency update failed - Could not transfer artifact thheller:shadow-cljs:jar:aot:2.8.109 from/to clojars (
Any ideas on how I can resolve this?
Seems like a Java related issue. But this does not come up in a Clojure Lein project that I have.
@amalantony what java version do you use? maybe its too old?
@thheller I have OpenJDK 10.
the error is about missing SSL certs, so if you use an OS installed version you might need to update that
yeah jdk10 isn't officially supported anymore. either use jdk11 for long-term-support or use the newest jdk14 and keep updating with every new version
@thheller thank you, I’ll try with the latest version.
it might be enough to update the ssl certs on your system but I don't know how to do that 😛
@thheller Updating the JDK version seems to have done the trick! I suppose it’s easier than updating the ssl certs since it’s a simple brew install
command on Mac 🙂.
Hi, is it possible to run watch on multiple builds at the same time? My shadow-cljs.edn looks like this:
{:source-paths ["src"]
:dependencies [...]
:nrepl {:port 9000}
:builds {:client {:target :browser
:output-dir "resources/public/js/compiled"
:asset-path "/js/compiled"
:modules {:main {:init-fn orgpad.client.core/init}}
:devtools {:after-load orgpad.client.core/mount-root
:watch-dir "resources/public"
:browser-inject :main
:loader-mode :script}}
:landing {:target :browser
:output-dir "landing/resources/js"
:asset-path "/js"
:modules {:main {:init-fn orgpad.landing.dev/init}}
:devtools {:http-root "landing/resources"
:http-port 3500
:after-load orgpad.landing.dev/mount-root
:watch-dir "landing/resources"
:browser-inject :main}}}}
I see
or shadow-cljs server
and start the builds from the ui (URL printed on startup, usually http://localhost:9630)
Cool, thx.
Everytime I reload the page, the whole test namespace seems to disappear from shadow, and if I evaluate anything with cider in the test namespace, I get the following:
TypeError: Cannot read property 'address_input_bar_suggestions_QMARK_' of undefined
at eval (eval at shadow$cljs$devtools$client$browser$global_eval (), <anonymous>:1:22)
at eval (<anonymous>)
at Object.shadow$cljs$devtools$client$browser$global_eval [as global_eval] ()
at eval ()
at Object.shadow$cljs$devtools$client$env$repl_call [as repl_call] ()
at Object.shadow$cljs$devtools$client$browser$repl_invoke [as repl_invoke] ()
at shadow$cljs$devtools$client$browser$handle_message ()
at eval ()
at Object.shadow$cljs$devtools$client$env$process_next_BANG_ [as process_next_BANG_] ()
at Object.shadow$cljs$devtools$client$env$process_ws_msg [as process_ws_msg] (: Cannot read property 'p__GT_c' of undefined
at eval (eval at shadow$cljs$devtools$client$browser$global_eval (), <anonymous>:1:98)
at eval (eval at shadow$cljs$devtools$client$browser$global_eval (), <anonymous>:7:3)
at eval (<anonymous>)
at Object.shadow$cljs$devtools$client$browser$global_eval [as global_eval] ()
at eval ()
at Object.shadow$cljs$devtools$client$env$repl_call [as repl_call] ()
at Object.shadow$cljs$devtools$client$browser$repl_invoke [as repl_invoke] ()
at shadow$cljs$devtools$client$browser$handle_message ()
at eval ()
at Object.shadow$cljs$devtools$client$env$process_next_BANG_ [as process_next_BANG_] ()
ERROR in () (TypeError:NaN:NaN)
expected: (some? (<p! (js/Promise.resolve (dom/mount-landing!))))
actual: #object[TypeError TypeError: Cannot read property 'p__GT_c' of undefined]
How do I fix this?just having something on the classpath means nothing. the files need to be actually required by your build.