This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-12
Channels
- # announcements (76)
- # babashka (10)
- # beginners (39)
- # biff (2)
- # calva (51)
- # chlorine-clover (8)
- # cider (6)
- # clj-kondo (15)
- # clj-on-windows (13)
- # cljdoc (26)
- # cljs-dev (8)
- # clojure (196)
- # clojure-austin (17)
- # clojure-europe (36)
- # clojure-nl (4)
- # clojure-spec (8)
- # clojure-uk (2)
- # clojurescript (18)
- # community-development (4)
- # conjure (1)
- # core-typed (38)
- # cursive (5)
- # datalevin (17)
- # datomic (25)
- # docker (1)
- # events (2)
- # interop (2)
- # jobs (4)
- # kaocha (28)
- # lsp (22)
- # nyc (1)
- # off-topic (10)
- # pedestal (1)
- # portal (22)
- # re-frame (22)
- # react (10)
- # shadow-cljs (19)
- # spacemacs (7)
- # tools-deps (11)
- # vim (14)
- # xtdb (7)
Any thoughts on what might be going on here? I figure this is somehow related to the AOT-compiled data.json in the ClojureScript JAR, but I can't see how as both ClojureScript versions come with the same data.json version (0.2.6).
To clarify a bit: the -write
method takes three args in data.json 2.4.0, but two in 0.2.6 (which is what ClojureScript comes with). I don't know why the 0.2.6 version gets picked up with CLJS .891 but not with .861.
Not sure what's going on, but if you need it fixed, you can try adding $slim
to the end of the CLJS artifact name to get rid of AOT'ed thirdparty files within the CLJS jar.
@U050B88UR @U064X3EF3 Seems like another case for, as you said, "hiding" those AOT dependencies inside the CLJS jar that doesn't have the $slim
qualifier.
What needs to be done to move this forward?
On another (but related) note, I was somewhat surprised to find that there's been a breaking change to data.json (in 2.2.0, I believe, when options to write
functions were added).
No change to public api, but we did change the extension protocol, probably should have thought about that more (does not affect most users)
I guess I'd also consider the extension protocol to be a part of the public API (seeing as it's also listed here: https://clojure.github.io/data.json/#clojure.data.json/-write). But yeah, probably not a whole lot of people use that protocol.
yeah, I'm not disagreeing with you. honestly, we did not think about it enough
Yeah, no worries. The strangeness around the AOT-compiled deps in the CLJS JAR seems like a bigger issue to me.
agreed, @U050B88UR is there some way to agenda-ize shading these deps in the compiled cljs build? data.json is particularly trivial as it is a single namespace - you could easily just copy the source in and s/clojure.data.json/cljsvendor.data.json/ or something
I know tools.reader is harder, but maybe not much
Hello, I have a question about reagent's render function. Suppose I have a very simple component:
(defn simple-comp []
[:div
[:p "This is a short paragraph"]])
;; I understand I can use it like this:
(defn simple-section []
[:section
[simple-comp]])
(simple-section)
;; But I found if I pass an argument to that simple-comp, nothing seems wrong
(defn simple-section []
[:section
[simple-comp "hello"]])
;; it seems the "hello" string will just be ignored
Even when a component (or render function?) is not supposed to receive any parameters, I can still pass arbitrary ones to it and in such cases they will be ignored. Am i right? I haven't found explanation on this.The parameters will be ignored, but if such a parameter changes then the component will be re-rendered anyway - because internally, that value is a part of the props.
Thank you. I didn't know that the change to such a parameter will also result in re-rendering of the component. Really helpful tips:clap:
The explanation is that the environment the ClojureScript code is compiled to (JavaScript) does not do any arity checking. ClojureScript could wrap every function definition or invocation to add that, but it would have a big runtime cost, so it doesn't. If you had done the same in Clojure, you'd get an error, because the JVM does check the arity.