This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-25
Channels
- # announcements (22)
- # architecture (6)
- # beginners (76)
- # cider (44)
- # clara (6)
- # clj-kondo (34)
- # cljdoc (4)
- # cljs-dev (8)
- # clojure (162)
- # clojure-brasil (4)
- # clojure-dev (32)
- # clojure-europe (3)
- # clojure-italy (16)
- # clojure-japan (4)
- # clojure-nl (3)
- # clojure-poland (1)
- # clojure-spec (25)
- # clojure-uk (45)
- # clojuredesign-podcast (5)
- # clojurescript (91)
- # clojutre (3)
- # core-async (19)
- # core-logic (8)
- # cursive (60)
- # data-science (3)
- # datomic (7)
- # defnpodcast (2)
- # duct (5)
- # emacs (7)
- # fulcro (1)
- # graalvm (9)
- # graphql (1)
- # jackdaw (12)
- # jobs (1)
- # jobs-discuss (1)
- # kaocha (3)
- # leiningen (3)
- # luminus (2)
- # off-topic (44)
- # onyx (17)
- # pathom (6)
- # planck (15)
- # re-frame (1)
- # reagent (13)
- # rum (2)
- # shadow-cljs (43)
- # spacemacs (3)
- # sql (43)
- # tools-deps (3)
- # vim (43)
- # xtdb (13)
The commnd clj
how to get it’s version?
clj -Sdescribe
the most recent is 1.10.1.466
Hi folks, My first Q on here. So pardon if I don't get the format of asking correct. I have a small project that uses hugsql to get rows of data from a DB table. Now my problem is not being able to test my code repl, I am using IntelliJ + Cursive. Here is how my code partial looks
(defprotocol ETLJob
(exec [this])
)
(defrecord ETLJobImpl [big-query dw-db]
ETLJob
(exec [this]
(f/attempt-all [_ (println "Getting DB records")
dw-records (oracle-db/get-debtor-profile-records dw-db)
(prn dw-records)]
)))
;calling the get-debtor-profile-records from my comment
(comment
(let [dw-db (:boundary/dw-db integrant.repl.state/system)]
(oracle-db/get-debtor-profile-records dw-db)) *;; Running this line gives me dev=> (let [dw-db (:boundary/dw-db integrant.repl.state/system)] (oracle-db/get-debtor-profile-records dw-db))
dev=> CompilerException java.lang.IllegalArgumentException: No implementation of method: :get-debtor-profile-records of protocol:*
(exec (:job/etl integrant.repl.state/system)) *;RUnning this line alone doesn't work gives me dev=> (exec (:job/etl integrant.repl.state/system)) CompilerException java.lang.IllegalArgumentException: No implementation of method: :exec of protocol: #'scg.job.etl/ETLJob found for class: nil, compiling:*
)
Any idea how I can test my code within repl. I am just in the dev ns right now that should load all my duct config.
PS: Since this is my unit test I have setup all the values needed for the duct config in my ENV variables.It returns CompilerException java.lang.IllegalArgumentException: No implementation of method: :exec of protocol:
That looks like
(defmethod ig/init-key :job/etl
[_ deps]
(log-begin-end
(map->ETLJobImpl deps)
::initialise))
dev=> (go)
dev=> IllegalArgumentException No method in multimethod 'init-key' for dispatch value: :boundary/big-query clojure.lang.MultiFn.getFn (MultiFn.java:156)
Well, that's another problem. Does (:job/etl integrant.repl.state/system)
return something now?
Thx, cleaned up my dev.edn of :boundary/big-query and now (:job/etl integrant.repl.state/system) works
dev=> (exec (:job/etl integrant.repl.state/system))
dev=> CompilerException java.lang.IllegalArgumentException: No implementation of method: :exec of protocol: #'scg.job.etl/ETLJob found for class: scg.job.etl.ETLJobImpl, compiling:
Yes...seems like I can just run the line
(oracle-db/get-debtor-profile-records dw-db)
So there needs to be a (defmethod ig/init-key....) for every :boundary/abc inside the *.edns?
Yep think so; I guess you could (defmethod init-key :default)
if you want to allow configuration of components you don't have. Can't see a reason to though
bear in mind (reset)
reloads from disk, so if you've eval'd stuff in from an editor session, that will get overwritten
Thx...I thought duct & integrant are used together...but seems I am using mostly IG only.
Good morning everyone. I posted something in #figwheel-main but I didn't get any answers so I was wondering if anyone could help.
I have a deps.edn
file that looks like this:
{ :deps { org.clojure/clojure {:mvn/version "1.9.0"}
org.clojure/clojurescript {:mvn/version "1.10.339"}
ring/ring-core {:mvn/version "1.7.1"}
ring/ring-jetty-adapter {:mvn/version "1.7.1"}
compojure {:mvn/version "1.6.1"}
reagent {:mvn/version "0.8.1"}
re-frame {:mvn/version "0.10.8"}}
:paths ["src" "resources"]
:aliases { :depstar
{ :extra-deps
{seancorfield/depstar {:mvn/version "0.2.4"}}}
:fig
{ :extra-deps
{ com.bhauman/figwheel-main {:mvn/version "0.1.9"}
com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}}
:extra-paths ["target" "test" "resources"]}
:build {
:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]}}}
I've got a front end and a back end in the same project. I had the front end working well with figwheel-main, and the backend was undeveloped. I've done some work on the backend and added the ring
dependencies and compojure
, and all of a sudden my CLJS front end will not compile. If I comment out ring/ring-jetty-adapter
everything compiles, so I was wondering why simply listing a dependency causes things to stop compiling and if there's some way of separating these dependencies?oh wow! Nice find!
Specify jetty dependencies as the same version.. okay
hmm I don't really know which deps to set the same version to, I only have one jetty dependency?
Front end is working
lets check if the backend is
It's working!! ❤️
thank you!!!!!
no I haven't. I'm not currently using lein either by the way 🙂
:on-change #(swap! values assoc id (.. % -target -value))
i have a code but i don't udners this part do you know where can i find the related documentation of (.. % -target -value)
Could someone explain why re-frame is considered great? Seems to me like I'm writing a lot of boilerplate still
Check Fulcro too.
What kind of app are you working on?
I've tried keechma
, re-frame
and fulcro
.
I liked Fulcro
more than others.
What I like about re-frame: 1) It’s simple, 2) it’s explicit, 3) it’s functionally very pure, and 4) it separates concerns.
It’s simple: components don’t have to worry about digging through the app-db to find data; they just subscribe to the values they want. They don’t have to worry about updating a complex app-db, they just fire events. Subscriptions, done right, are often just looking up a value in a map.
It’s explicit: by which I mean, there’s not a lot of “magic” involved, like you get in things like Ruby on Rails. It may be a bit like boilerplate, but when you’re debugging, it helps to have everything laid out right in front of you, no mysterious “action at a distance” or behind-the-scenes black-box actions. (Yes, it does do some abstracting away of implementation details, but that’s fairly minimal, well-documented, and fairly easy to predict).
Functionally very pure: Side effects are restricted to event handlers and effects, and even then event handlers take in a state and return a state, so it’s still pretty functional and easy to test.
Separates concerns: It’s really nice that components don’t need to do complicated things in response to user interactions. Just dispatch an event reporting what the user did. The event handlers will take care of updating the app-db, or whatever else you need. And the event handlers don’t need to worry about layout or CSS styles or any of the things components do.
Also I love how you can make subscriptions that do form validation for you automatically, even complicated things like making sure the Total
field equals the sum of the line item prices. No more worrying about “This field changed, now I have to trigger a validation on that other field, which depends on it.” Just take advantage of the built-in subscription functionality.
@U06CM8C3V it's very detailed and structured reply. you may consider to publish it on medium or somewhere
@shin From my personal point of view, re-frame is nice because it gives you structure.. it does not simplify your code, but it organizes it. By channeling all actions via dispatch
and subscribe
I think re-frame also tries to prevent you from doing something horribly wrong.. For example, you can access the db solely from your handlers and update it solely from events.. If you are absolutely impeccable, you could go without it and you would probably do very well.. but you still need to think of how you want the data to flow.. and that could take not a trivial amount of time.. go with re-frame and it's all already figured out for you...
Personally (just my opinion) I'm not a fan. I like reagent. But re-frame is difficult to test. Has "global" state. And doesn't work with devcards.
@crispin Keechma
is great alternative to re-frame
.
@here do have any spell check in clojure
Since I’m from ruby background In Ruby we uses rubycop gem
Pls let me know
@jeevarajmvsvg If you have any questions on how to use clj-kondo, just let me know in #clj-kondo
Okay thank you
Let me check
:thumbsup::skin-tone-2: