This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-25
Channels
- # announcements (1)
- # babashka (15)
- # biff (15)
- # calva (9)
- # cherry (18)
- # cider (43)
- # cljs-dev (1)
- # cljsrn (10)
- # clojure (14)
- # clojure-europe (47)
- # clojurescript (29)
- # clr (5)
- # conjure (1)
- # core-logic (17)
- # datomic (8)
- # emacs (22)
- # fulcro (3)
- # gratitude (1)
- # hoplon (23)
- # humor (1)
- # hyperfiddle (34)
- # jobs (1)
- # kaocha (1)
- # malli (3)
- # nrepl (4)
- # off-topic (18)
- # pathom (12)
- # pedestal (1)
- # polylith (1)
- # portal (17)
- # practicalli (1)
- # re-frame (19)
- # reitit (8)
- # releases (1)
- # rewrite-clj (4)
- # shadow-cljs (15)
- # sql (23)
- # tools-build (4)
I'm using re-frame, shadowcljs and chrome. I have source-maps working but the stacktraces are littered of (anonymous) core.cljs:NNN
because of so many #(...)
and (fn [...] ...)
. If I turn them to (fn my-fn ...)
then stack traces are more understandable and come as (app$core$some$context$my-fn) core.cljs:NNN
but that looks quite verbose.
Is there a way to make anonymous fns
already put whatever the context is in the reported fn
name for stack traces?
With shadow-cljs, source maps work out of the box. Unless you have them disabled in your browser.
@U02SLLZ1STE I've bumped in all the guard-rail errors and it worked. Shadowjs emits .map files next to your .js files, ensure you can GET them from the browser you use to test your app and then they should work if your browser has them enabled.
A bit of a beginner question: I want to log values to the browser console, works fine with primitives but with objects what I get is a complex JavaScript representation of the ClojureScript value. I know that there's (pr-str)
which gives me a string (but then I lose my ability to traverse nested structures etc) and I have (clj->js)
(but then it's a JS object and not strictly the CLJS object I want).
Is there a more idiomatic way to do this? I'm using figwheel-main if that makes a difference.
The custom formatter provided by cljs-devtools https://github.com/binaryage/cljs-devtools/blob/master/docs/faq.md#what-is-the-formatters-feature
Well clearly that doesn't work for me.
Clearly not working for Firefox @ Ubuntu 😂
no clue what the state of them is for firefox. there was a ticket for years, not sure if that went anywhere
I don't have that option in my devtools settings lol
Just tested - they work in Firefox as well, but for whatever reason at the moment you have to enable them via flags and not via the config UI.
Better than before
Interestingly it still gives off the warning
Ah, I was on 1.0.6 and apparently exactly this was fixed in 1.0.7, upgrading makes it look like chromium
Now to figure out dark theme 😂
Alright, on a totally different topic. I saw that you can use <p!
to transform a promise (or a promise chain) into a go-block (and subsequently, a channel) - is there an easy way to do the opposite? (-> (magic some-chan) (.then #(do-thing %))
(defn chan->p [chan]
(js/Promise.
(fn [resolve reject]
(go (if-some [msg (<! chan)]
(resolve msg)
(reject nil))))))
something like that should work, although I wouldn't recommend it since chans and promises are fundamentally different
Thank you! How do you do things like make fetch
requests etc idiomatically? I can imagine a sort of async/await-esque using (go
and (<p!
but is that how "you do it"? What's the idiomatic way to do "async web development things"