In IntelliJ I can Cntl+B 'into' a function to see its code from where it is called. IIRC in one of Tony's video's he shows how 'going into' can be setup to work for mutations as well. Does anyone know how, or what video?? Thanks
@tony.kay I think you might have shared a good video property based testing a while back? If by chance you recall, can you please share again?
@currentoor the only testing video that comes to mind was the talk I gave at clj west.
I reference two other talks in it as well
well I just found this lol
thanks
@cjmurphy it is one of the Untangled in the Large, but here’s the trick: Use defmutation
to make your mutation. This macro sorta looks like a defn
. Then, in IntelliJ, click on the defmutation
itself and wait for the light bulb to appear (must not be in low power mode). Click on it. Choose “Resolve defmutation as…” and pick defn. Cursive will now recognize the symbols it “defines” as something that can be jumped to, and you can use syntax quoting to get the right namespace.
(ns some-long-ns)
(defmutation boo [params] ...)
(ns y (:require [some-long-ns :as s]))
(transact! this `[(s/boo)])
I’ve recently (in the new combo lib) added a server-side parser and more macros for making server-side reads and mutations (see the new GettingStarted.adoc, look for untangled-parser
). The latter looks just like the client defmutation, and therefore supports the same trick for the server.
Yeah great, cntl+B and Alt+F7 now work with all my defmutations.
surprising where the best gains are, eh? So far two of my favorite usability adds are defmutation
with that trick, and InitialAppState
which technically don’t do hardly anything, but they sure make life easier
Yes InitialAppState
more useful in practice than I thought it would be. Like when you have one-ofs it all composes well together.
well, it also enables really easy refactoring, since things just re-compose, and unions for UI concerns without hand-coding the graph.
I'm writing quite a complicated UI and there's very little 'involved' mucking around with the state. Different from when I remember picking up Om Next at first. load
is obviously a big deal too.
yeah, but load
is most of the story 😉 I was referring to “trivial” things that added a lot.
InitialAppState
was life-changing, but almost stupid simple.
So 👍
wow, untangled-spec is pretty awesome 🙂
glad you like it. the latest alpha has a few bugs with server rendering on a browser, but I think Anthony is looking at those
@claudiu So, I got merge alt unions passing server-side tests. I pushed that on develop. I have not actually tried it with SSR yet, but I think it should work.
I pushed a SNAPSHOT on clojars 1.0.0-SNAPSHOT.