This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-17
Channels
- # announcements (3)
- # babashka (41)
- # beginners (118)
- # calva (4)
- # cider (22)
- # clj-kondo (4)
- # clj-on-windows (1)
- # clj-together (1)
- # clojure (164)
- # clojure-europe (46)
- # clojure-filipino (1)
- # clojure-indonesia (1)
- # clojure-my (1)
- # clojure-nl (3)
- # clojure-sg (1)
- # clojure-spec (13)
- # clojure-uk (16)
- # clojurescript (18)
- # cloverage (3)
- # conjure (5)
- # core-async (8)
- # cursive (21)
- # datomic (4)
- # deps-new (15)
- # emacs (12)
- # expound (4)
- # fulcro (45)
- # graalvm (32)
- # jobs (1)
- # malli (5)
- # nextjournal (63)
- # off-topic (27)
- # other-languages (3)
- # pathom (27)
- # proletarian (1)
- # rdf (24)
- # re-frame (10)
- # reagent (9)
- # releases (2)
- # shadow-cljs (72)
- # spacemacs (4)
- # timbre (4)
- # tools-deps (29)
- # xtdb (4)
Is there a library out there for only transforming a graphql edn structure into a graphql query string. Looked at Luciana, seems solid but a bit more involved than what I need
A friend found https://medium.com/@kirill.ishanov/poor-mans-graphql-client-for-clojurescript-apps-8dc4b04e8738 which worked as is aside from needing more advanced filtering support. Exactly what I was looking for!
I’m trying to play around with the self hosted ClojureScript compiler, and I’m running into some issues around cljs.core
. Whenever I call cljs.js/analyze-str
, eval-str
, or compile-str
it succeeds but things like defn
appear as variables in the analyzed/etc. namespace, rather than as from cljs.core
, so instead of getting cljs.core.defn
I’m getting e.g. test.ns.defn
. I believe that I’ve set up everything correctly (I am binding *compiler*
and passing it in as an option, and I’m not disabling dump-core
). Any ideas what might be going on?
if you use shadow-cljs you must follow this https://code.thheller.com/blog/shadow-cljs/2017/10/14/bootstrap-support.html
Thanks @U05224H0W, yeah I’m using shadow, let me try that out and I’ll reach out in the #shadow-cljs channel if I run into any issues
is there any way to make set!
work with some->
? e.g., this works:
(when-let [logo (js/document.querySelector ".logo")]
(-> logo .-style .-zIndex (set! "20")))
but this doesn't
(some-> (js/document.querySelector ".logo") .-style .-zIndex (set! "20"))
;; Can't set! local var or non-mutable field at line 1 ...
No, because some->
binds every step to a new name, which results in an expression like (set! x "20")
.
Instead, you can use
(when-some [logo (js/document.querySelector ".logo")]
(set! (.-style logo) -zIndex "20"))
ended up doing
(defmacro when-> [x & forms]
`(when-let [x# ~x] (-> x# ~@forms)))
might be a bad name but it's the behavior I want, I thinkRefactoring ideas?
(condp <= v
10E12 (str (.toPrecision (/ v 10E12) 3) "T")
10E9 (str (.toPrecision (/ v 10E9) 3) "B")
10E6 (str (.toPrecision (/ v 10E6) 3) "M")
10E3 (str (.toPrecision (/ v 10E3) 3) "k")
v)
LGTM. As an alernative:
(some (fn [[x s]]
(when (<= x v)
(str (.toPrecision (/ v x) 3) s)))
[[10E12 "T"] [10E9 "B"] [10E6 "M"] [10E3 "k"]])
Hey, can someone give a basic illustration of using resizeObserver
in cljs.
Not sure if this is too much, but https://github.com/djblue/portal/blob/37a1e186740546786bb4bb2a585a5091a526d80f/src/portal/ui/viewer/vega.cljs#L82-L96 is how I used ResizeObserver in a cljs project of mine.
If you're mostly interested in just how the interop will look, you can try plugging in js examples into https://mauricioszabo.gitlab.io/js2cljs/