This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-18
Channels
- # announcements (31)
- # asami (11)
- # aws (33)
- # babashka (30)
- # beginners (69)
- # calva (1)
- # chlorine-clover (10)
- # cider (3)
- # clj-kondo (24)
- # cljdoc (19)
- # cljs-dev (1)
- # cljsrn (2)
- # clojure (104)
- # clojure-australia (4)
- # clojure-dev (29)
- # clojure-europe (202)
- # clojure-germany (36)
- # clojure-nl (6)
- # clojure-poland (3)
- # clojure-serbia (6)
- # clojure-spec (18)
- # clojure-uk (32)
- # clojurescript (36)
- # conjure (1)
- # core-async (6)
- # datomic (15)
- # duct (1)
- # emacs (11)
- # fulcro (24)
- # graalvm (12)
- # jobs (3)
- # juxt (1)
- # kaocha (2)
- # keechma (4)
- # lsp (1)
- # malli (102)
- # meander (17)
- # off-topic (16)
- # pathom (8)
- # re-frame (12)
- # remote-jobs (7)
- # rewrite-clj (72)
- # shadow-cljs (27)
- # sql (26)
- # tools-deps (8)
- # vim (3)
- # xtdb (28)
- # yada (5)
is there any part of the techno wizardry that went in to that which can be used with a deps.edn project?
right now I am working on a project that is using figwheel.main to launch the dev environment, but compared to shadow it is taking forever on refreshes just due to the number of files
@emccue figwheel or cljs.main do not support this feature no. you can just use shadow-cljs with deps.edn if you want.
Hello. I’m writing a library containing just two macros. It’s supposed to work in both CLJS and CLJ (I am having troubles making it work, but that’s a separate issue). It’s a tools/deps project and I have added a shadow-cljs.edn
file to it with a :test
build that runs my (failing) tests. Now I want to connect my REPL to it. I get No JS runtime
if I try to eveluate anything towards the :test
build. Is there a way I could make that work? Guessing not, so next question is how do I create a build that I can connect to and use for REPL-ing? I could make a small webapp, I guess, but it still seems a bit heavier than what I really need. Anyone know of a library project out there I could have a look at?
:test
builds (assuming that is actually :browser-test or :node-test) do not support REPLs
It’s a :node-test
. I’m trying to make it using CLJC, so same tests for Clojure as for ClojureScript. They run, but all fail utterly. I want to be able to load the test file and the tested file in the repl. Tried node-repl
which also gave me No JS runtime
, but I am testing it via Calva, which I haven’t done in a while, so that might be broken. Will try from the prompt now and see what that gives me.
node-repl will ALWAYS have a JS runtime so if you get the no JS runtime error you likely are not actually using that
Yes, Calva has a specific option. But it runs shadow-cljs using npx so my mistake was that I didn’t hava package.json with shadow dev deps. Now it works. I can load my files and my library (that let>
macro stuff you helped me with over at ClojureVerse) also works. That’s great. But the tests are not passing in the :test build. I’ll see if I can figure that out.
So running the tests taps what I expect them to tap in the shadow-cljs inspector. But the tests add a tap of their own that are then inspected. Works for CLJ, but for CLJS the atom is not updated. The tests all look like this:
(testing "Taps the binding box"
(let [tapped (atom nil)
save-tap (fn [v] (reset! tapped v))]
(add-tap save-tap)
(is (= [:foo :bar]
(sut/let> [foo :foo
bar :bar]
[foo bar])))
(is (= '[[foo :foo]
[bar :bar]]
@tapped))
(remove-tap save-tap)))
Failing like this:
FAIL in (let>) (pez/taplet_test.cljc:20:11)
Taps the binding box
expected: (= (quote [[foo :foo] [bar :bar]]) (clojure.core/deref tapped))
actual: (not (= [[foo :foo] [bar :bar]] nil))
you can bind your own tap-fn so it stays sync https://github.com/clojure/clojurescript/blob/715cdc07dbb1d595af91ea12affb6faf0b615d4b/src/main/cljs/cljs/core.cljs#L79-L86
Thanks. I know this is not the CLJS support, but anyway, does this look sane enough to your eyes?
(defn sync-fn [f] (f))
(def ^:dynamic *dummy* nil)
(deftest let>
(testing "Evaluates as `let`"
(is (= [:foo :bar] (sut/let> [foo :foo
bar :bar]
[foo bar]))))
(testing "Taps the binding box"
(let [tapped (atom nil)
save-tap (fn [v] (reset! tapped v))]
(add-tap save-tap)
(is (= [:foo :bar]
(binding [#?(:clj *dummy*
:cljs *exec-tap-fn*) sync-fn]
(sut/let> [foo :foo
bar :bar]
[foo bar]))))
(is (= '[[foo :foo]
[bar :bar]]
@tapped))
(remove-tap save-tap)))
...
It works, but ¯\(ツ)/¯What is going on here? Getting this error/warning when starting an app of mine.
error when calling lifecycle function app.core/reload! #error {:message "Unexpected compile spec type", :data {:given nil, :type nil}}
eval @ env.cljs:198
shadow$cljs$devtools$client$env$do_js_reload_STAR_ @ env.cljs:204
G__73437 @ env.cljs:204
eval @ env.cljs:196
shadow$cljs$devtools$client$env$do_js_reload_STAR_ @ env.cljs:204
G__73437 @ env.cljs:204
eval @ env.cljs:233
shadow$cljs$devtools$client$env$do_js_reload_STAR_ @ env.cljs:204
eval @ env.cljs:240
shadow$cljs$devtools$client$browser$do_js_reload @ browser.cljs:49
eval @ browser.cljs:93
eval @ shared.cljs:32
shadow$remote$runtime$shared$process @ shared.cljc:164
eval @ shared.cljs:284
shadow$cljs$devtools$client$shared$remote_msg @ shared.cljs:16
eval @ websocket.cljs:16