Fork me on GitHub
#untangled
<
2017-06-30
>
cjmurphy09:06:46

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

currentoor13:06:36

@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?

tony.kay14:06:39

@currentoor the only testing video that comes to mind was the talk I gave at clj west.

tony.kay14:06:04

I reference two other talks in it as well

currentoor14:06:43

well I just found this lol

tony.kay14:06:52

@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.

tony.kay14:06:33

(ns some-long-ns)

(defmutation boo [params] ...)
(ns y (:require [some-long-ns :as s]))
(transact! this `[(s/boo)])

tony.kay14:06:16

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.

cjmurphy14:06:16

Yeah great, cntl+B and Alt+F7 now work with all my defmutations.

tony.kay14:06:23

surprising where the best gains are, eh? So far two of my favorite usability adds are defmutation with that trick, and InitialAppState

tony.kay14:06:42

which technically don’t do hardly anything, but they sure make life easier

cjmurphy14:06:41

Yes InitialAppState more useful in practice than I thought it would be. Like when you have one-ofs it all composes well together.

tony.kay14:06:38

well, it also enables really easy refactoring, since things just re-compose, and unions for UI concerns without hand-coding the graph.

cjmurphy14:06:55

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.

tony.kay14:06:48

yeah, but load is most of the story 😉 I was referring to “trivial” things that added a lot.

tony.kay14:06:22

InitialAppState was life-changing, but almost stupid simple.

claudiu20:06:14

wow, untangled-spec is pretty awesome 🙂

tony.kay20:06:07

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

tony.kay23:06:47

@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.

tony.kay23:06:48

I pushed a SNAPSHOT on clojars 1.0.0-SNAPSHOT.