This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-09
Channels
- # announcements (6)
- # babashka (17)
- # beginners (70)
- # calva (6)
- # chlorine-clover (88)
- # cider (9)
- # cljs-dev (9)
- # clojure (66)
- # clojure-australia (3)
- # clojure-czech (5)
- # clojure-europe (73)
- # clojure-nl (5)
- # clojure-spec (62)
- # clojure-uk (38)
- # clojurescript (30)
- # cursive (10)
- # datomic (16)
- # events (1)
- # figwheel-main (1)
- # fulcro (6)
- # graphql (21)
- # helix (4)
- # jackdaw (1)
- # jobs-rus (1)
- # kaocha (3)
- # luminus (11)
- # malli (28)
- # pedestal (3)
- # re-frame (2)
- # reagent (3)
- # sci (2)
- # shadow-cljs (21)
- # spacemacs (2)
- # sql (25)
- # timbre (2)
- # tools-deps (9)
- # tree-sitter (1)
- # xtdb (21)
That doesn't sound right to me... inc
is pure, isn't it? https://clojuredocs.org/clojure.core/inc
I know, but it's going to be (set! (-> x .-y .-z .-w) (inc (-> x .-y .-z .-w)))
which seems kind of mouthful
Mutating properties is probably supposed to be ugly. 😄 I guess that’s what you have. :thinking_face: If you need to do that often, perhaps you could write your own helper macro or function
can you grab the reference to .w
(or .z
) in a let binding and set!
that?
@lasse.maatta Seems it would suffice for my case
@zhuxun2 if you are ok with using a library, js-interop has an update-in!
macro that would look like (j/update-in! x [.-y .-z .-w] inc)
or if the keys are static, (j/update-in! x [:y :z :w] inc)
(https://github.com/applied-science/js-interop)
We have a very strange bug in our advanced CLJS compiled front-end app. We have some specs referring to other specs:
(s/def :foo/foo string?)
(s/def :bar/bar :foo/foo)
All of a sudden this breaks our app:
alpha.cljs:121 Uncaught Error: Unable to resolve spec: :foo/foo
at u2a (alpha.cljs:121)
at RY (alpha.cljs:518)
at tY (alpha.cljs:513)
at BY (alpha.cljs:314)
at query.cljs:41
I don't see this release on github btw: https://github.com/clojure/clojurescript/releases
Repro or it didn't happen, I know. It was introduced by a non-related commit in our codebase, so hard to reproduce probably.
with pseudo names, you should be able to debug it in chrome devtools even without source maps, just step through formatted js code
just by chance, aren’t you using multiple javascript contexts? e.g. a webworker and the main page?
I think we might have hit some heissenbug. Requiring this namespace earlier in our app seems to get rid of this issue. But still very weird, since these specs are in the same file...
we're not using webworkers. anyway, we're getting rid of these specs anyway (in production at least)