This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # babashka (3)
- # beginners (70)
- # calva (15)
- # cider (34)
- # clara (10)
- # cljsrn (2)
- # clojure (28)
- # clojure-europe (21)
- # clojure-france (1)
- # clojure-uk (17)
- # clojuredesign-podcast (4)
- # clojurescript (51)
- # cursive (21)
- # data-science (1)
- # datalog (2)
- # datascript (2)
- # datomic (10)
- # emacs (5)
- # esprit (24)
- # expound (9)
- # figwheel-main (15)
- # fulcro (31)
- # graphql (3)
- # jobs-discuss (27)
- # keechma (2)
- # luminus (2)
- # malli (2)
- # minimallist (14)
- # nrepl (1)
- # off-topic (4)
- # pathom (1)
- # pedestal (8)
- # re-frame (10)
- # reagent (5)
- # reitit (2)
- # rewrite-clj (54)
- # sci (1)
- # shadow-cljs (34)
- # spacemacs (12)
- # sql (17)
- # vim (16)
- # web-security (1)
I somehow got shadow-cljs into a state where running
shadow-cljs release raises a NPE. My CIDER repl hot reloading is also broken. known bug?
I don't think I have anything fancy going on. I think CIDER just runs the default command,
shadow-cljs server. I think this may have been a race condition from hot reload + release at the same time, but anyway it went away after a restart
Q: I’ve reached the stage where using tap> and the inspector would be really helpful. I’m using 2.8.94. Should it be working in the browser app? I can’t see any runtimes even though I have a nodejs server running. and when I (tap> ) from the cljs repl, nothing happens
@steveb8n that version is too old for inspect. it is enabled by default in newer versions.
Following examples to make a testing namespace and shadow is telling me
node-test is an invalid target:
Should I just be using
Target "node-test" for build :test was not found. The built-in targets are: - :browser - :browser-test - :node-script - :node-library - :npm-module - :karma - :bootstrap
I think it's a problem with my namespace directories actually - error seems to be coming from https://github.com/thheller/shadow-cljs/blob/bfdda1d472198a8f352468eafc2a1080e855b747/src/main/shadow/cljs/devtools/errors.clj#L82. Looks like it's just an outdated error message 🙂.
I'm trying to run
shadow watch for
:node-script on a different (docker) host, than
:devtools-url " yields
remote-error Error: Unexpected server response: 200.
What's the best way to do this?
@mail985 looks like you might be using
:target node-test. note that it must be a keyword, otherwise it'll look for
(ns node-test) which indeed does not exist.
@bendlas assuming that calling
actually results in the shadow-cljs UI that should be fine? did you verify that the http connect actually works?
@U05224H0W it turns out, it does that, when a stale
app.js tries to connect during shadow's boot up (docker volume, for sharing build results). removing
app.js (and waiting for it to be re-generated) before connecting node, fixed it. thanks!
Is it currently possible to add a dependency while
shadow watch is running? If not, are there any barriers for that feature to be added? I can take a look at it 🙂
not possible currently and not trivial to add given that it must be supported via shadow-cljs.edn, project.clj and deps.edn. I may add a shadow-cljs.edn solution some day but it is low priority. restarting occasionally is not that bad.
Thanks for the quick response! Yeah, doing some research over the past week it doesn't look trivial 😞
yeah manipulating the classloader at runtime is full of footguns. its easy for just .cljs files but macros and other resources is where it gets tricky
Hi, there's a thing with Shadow-CLJS that I really don't understand, that's almost reproducible all time. On my project: https://github.com/mauricioszabo/repl-tooling, if I try to watch
:integration target, most of the time I get the following error:
File: /home/mauricio/.atom/packages/chlorine/repl-tooling/test/repl_tooling/repl_client/textual_representation_test.cljs:18:3 -------------------------------------------------------------------------------- 15 | render/txt-for-result)) 16 | 17 | (cards/deftest evaluate-to-text 18 | (async-with-clj-repl "text repr" ---------^---------------------------------------------------------------------- Encountered error when macroexpanding cljs.core/aset. StackOverflowError: cljs.analyzer/compiler-options (analyzer.cljc:168) cljs.analyzer/checked-arrays (analyzer.cljc:178) cljs.analyzer/checked-arrays (analyzer.cljc:174) cljs.core/aset (core.cljc:1043) cljs.core/aset (core.cljc:1041) clojure.core/apply (core.clj:669) ....big stacktrace
the file looks rather macro heavy and no clue what they do. might expand to a bazillion forms for all I know 😛
Right you are, but not that heavier than other test files that don't cause trouble 😄
Hello all! need some help on :optimizations. I am working on an app using shadow/reagent/expo/react-native and the app works fine upon shadow-cljs release with :optimizations :simple but with :optimizations :advanced it looses some symbols names from google closure optimizations.
The reference for this.refs.drawer.openDrawer is lost on advanced optimization. Some thoughts on how to circunvent this??
(defn root  (let [this (r/current-component) open-drawer #(this.refs.drawer.openDrawer)] ....
This is a pretty common problem and there are a lot of options. https://github.com/appliedsciencestudio/js-interop is my favorite, https://github.com/mfikes/cljs-bean/ is another option people seem to like. Going a bit more extreme there is https://github.com/binaryage/cljs-oops which was built specifically to address this problem. Finally you can drop down into https://clojureverse.org/t/cljs-hidden-google-closure-library-gems/2321/2
The point is that "dot access" breaks because the variable names change on advanced optimization and your CLJS code doesn't
(defn root  (let [^js this (r/current-component) open-drawer #(.. this -refs -drawer -openDrawer)]
this should be all you need. don't need a library or anything. if you have externs inference turned on you should be getting a warning https://shadow-cljs.github.io/docs/UsersGuide.html#externs
@U0S3YK6HK using those libraries to fix externs issues is pretty much an anti-pattern these days and should not be used for that