This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-02
Channels
- # aleph (3)
- # announcements (2)
- # babashka (4)
- # beginners (74)
- # calva (21)
- # clj-kondo (30)
- # cljs-dev (7)
- # cljsrn (42)
- # clojure (121)
- # clojure-dev (13)
- # clojure-europe (23)
- # clojure-losangeles (2)
- # clojure-nl (2)
- # clojure-norway (7)
- # clojure-spec (140)
- # clojure-uk (58)
- # clojuredesign-podcast (9)
- # clojurescript (49)
- # clojutre (2)
- # cursive (32)
- # datascript (2)
- # datomic (59)
- # duct (7)
- # figwheel-main (6)
- # fulcro (18)
- # graphql (5)
- # jackdaw (1)
- # joker (6)
- # juxt (7)
- # leiningen (9)
- # off-topic (1)
- # pedestal (14)
- # quil (2)
- # re-frame (3)
- # reitit (8)
- # shadow-cljs (78)
- # sql (8)
- # timbre (3)
- # vim (69)
I trying to get the values of a protocol definition from another namespace and there is no success. Can someone help me with this? (edited) How does one accomplish this? (edited) I am using clojurescript by the way.
@iha2 define "get the values of the protocol definition"? there are only functions defined by the protocol you can call? no values to get?
(defrecord Nav [text link nav]) (def articles (map-indexed #(Nav. (->> % second :title) ’(::article {:id (->> % first)}) nil) (:articles @app-state)))
When I import the value with the record, if I want to get the text property (as defined above), I get null.
the entire (def articles ..)
looks very strange to me. so I would check if that outputs what you expect first
Our cljs-project has 702 CLJS files and some 16 dependencies as well. It seems that when a source file changes, and figwheel-main recompiles it, it is sending everything to the CLJS compiler to do its thing. The performance with lein-figwheel is better, almost 3 times faster, which means 10 seconds in comparison to 30 seconds of compilation after a file has been saved. How one should react to this? Should modularization help? The project we are doing will be getting bigger in size, and I started transitioning from lein-cljsbuild+lein-figwheel to figwheel main to modernize the build tools at the same time. My workflow has always been to evaluate stuff from the editor directly, and not relying on the figwheel’s reload functionality that much. However the rest of the team are used to just let figwheel compile the stuff, and see the changes in the browser.
I don't have any advice regarding figwheel but others have told me that shadow-cljs is substantially faster in bigger projects
Thanks for pointing this out. Actually I was going to give shadow-cljs a spin too at this point for some benchmarking. I really like it – thanks a lot for making it! I’ve used it in many smaller proof-of-concept and other short lived projects and it has worked very well.
For what it's worth, at Nextjournal we disabled the auto reload from fogwheel, instead just using a repl workflow where you reevaluate the forms you change. Can't get much faster than that.
@U07FP7QJ0 yes. That’s what I’ve been saying. Maybe that’s what I’ll start enforcing 😄 Thanks!
@U07FP7QJ0 So just so I understand the approach correctly. I would change a reagent component function, send the function to the repl. But I guess I would also need some mechanism to render the UI again to run the updated code?
maybe I’m missing the obvious. Maybe creating my own shortcut in the REPL for running my render-fn
@U21QNFC5C, exactly. Just provide a shorthand for doing the re-mount after a change in a view function.
Tried it yesterday evening in Cursive, worked beautifully after a couple of tweaks. Really great!
there probably is an easy fix for figwheel though. it shouldn't take that long unless you are changing a file that literally every other file depends on somehow
can I get a field value out of a deftype
object?
I have a value which is an instance of
(deftype Reconciler [controllers effect-handlers co-effects state queue scheduled? batched-updates chunked-updates meta watch-fns]
...
I was hoping I could use a keyword lookup, like (:state reconciler)
; but it keeps coming back as nil
Is there some javascriptt accessor that I have to use?it should be (.-state reconciler)
oh square bracket work: reconciler["state"]
ah perfect; thanks @roman01la
js dot notation too reconciler.state
agree that .-
is more idiomatic
@ben.hammond be careful with accessing internal things like that, it might not be safe in :advanced
compilation
I expect this particular thing to remain constant, it get sets once at :init
time and then I'm only reading from it
thanks for the warning though
@thheller or do you mean that it might not be readable in :advanced
?
given a short name
ah good to know, thanks
Does someone have experience with cljsjs.ag-grid-react? I managed to get it going, but now I want to upgrade to cljsjs/ag-grid-enterprise. It seems that ag-grid-react is putting some wrapper on ag-grid-community, but this wrapper is missing in ag-grid-enterprise. There is also an cljsjs/ag-grid which uses ag-enterprise, but it is outdated as it uses the version 17 and not the current 21.
You can depends on enterprise, just make sure to require it after the community edition and it will upgrade the community edition
@thheller I wonder if you know the reason why shadow can be faster than figwheel main? Looking at figwheel through JVM profiler it looks like 99% of the time goes into cljs compiler
@roman01la I suspect figwheel-main is just doing more work than it should. one common reason is the over eager :recompile-dependents
where shadow-cljs uses a "different" strategy leading to less recompiled files overall