untangled

NEW CHANNEL: #fulcro
wilkerlucio 2016-11-10T00:30:02.004218Z

@tony.kay thanks for the release! I sent a new PR with a few adjusts

tony.kay 2016-11-10T00:31:38.004219Z

ok.

tony.kay 2016-11-10T00:32:58.004220Z

on clojars at 0.7.0-SNAPSHOT of server

👍 1
mitchelkuijpers 2016-11-10T15:42:23.004245Z

Is this incorrect?

(defui ^:once Speaker
  static om/IQuery
  (query [_]
    [:id
     :name
     {:job (om/get-query Job)}])
  static om/Ident
  (ident [_ {:keys [id] :as args}]
    [:speaker/by-id id]))

  (df/load
   (:reconciler @app)
   [:speaker/by-id 1]
   Speaker
   {:marker false})
My server returns:
(defn api-read [{:keys [query request] :as env} disp-key params]
  (case disp-key
    :speaker/by-id {:value{:id 1 :name "foo"}}
    (throw (ex-info "Invalid request" {:query query :key disp-key}))))
This results in:
:speaker/by-id {1 nil},

mitchelkuijpers 2016-11-10T15:43:09.004246Z

And in the network tab of chrome I see:

["~#cmap",[["~:speaker/by-id",1],["^ ","~:id",1,"~:name","foo"]]]
which indicates that it actually returns a name and a id

tony.kay 2016-11-10T16:22:25.004247Z

Hm. That looks right @mitchelkuijpers

tony.kay 2016-11-10T16:24:59.004248Z

I found a bug in load yesterday I've not reported. Could be a bug.

tony.kay 2016-11-10T16:25:09.004249Z

but that is how it is intended to work 🙂

tony.kay 2016-11-10T16:25:44.004250Z

it's intended to work with just app, is the bug I noticed. My precondition fails though

mitchelkuijpers 2016-11-10T16:26:38.004251Z

Hmm do you mean with app instead of the reconciler?

tony.kay 2016-11-10T16:26:52.004252Z

any: app, reconciler, or component

tony.kay 2016-11-10T16:27:04.004253Z

but it fails with app right now

mitchelkuijpers 2016-11-10T16:27:08.004254Z

Ah ok

tony.kay 2016-11-10T16:27:34.004255Z

make sure you've cleaned/recompiled, but I don't see an obvious problem in your code

tony.kay 2016-11-10T16:28:04.004256Z

I have to do a bunch this morning, but might have tiem to look at it this afternoon

mitchelkuijpers 2016-11-10T16:28:57.004257Z

We hit the same bug in our application. This is a reproduction. I'll see if I can pinpoint the problem

mitchelkuijpers 2016-11-10T16:29:33.004258Z

It works with load-data so we use that for now

tony.kay 2016-11-10T16:31:04.004259Z

ok, yeah load isn't officially released yet

tony.kay 2016-11-10T16:31:15.004260Z

but it was supposed to be bug-free 😉

wilkerlucio 2016-11-10T23:47:22.004272Z

@tony.kay I may had found a bug on load as well, today I was trying to load an ident and couldn't make it work with load, seems some problem on merging, but I didn't had the chance to verify yet

tony.kay 2016-11-10T23:47:38.004273Z

@mitchelkuijpers Fixed the load bug on idents. On clojars (0.6.0-SNAPSHOT)

tony.kay 2016-11-10T23:47:59.004274Z

that was timely @wilkerlucio Just pushed the fix

wilkerlucio 2016-11-10T23:48:05.004275Z

🙂

wilkerlucio 2016-11-10T23:49:21.004276Z

@tony.kay are you thinking on removing the old load-data entirely? I can still see it being useful, but I don't mind using untangled/load directly (I had to use that to load ident and pass :post-mutation-params, which currently doesn't work with load-data)

tony.kay 2016-11-10T23:51:54.004277Z

I was just debating that

tony.kay 2016-11-10T23:52:04.004278Z

there are some use-cases where load-data is more flexible

tony.kay 2016-11-10T23:52:20.004279Z

sort-of

tony.kay 2016-11-10T23:54:07.004280Z

I'm kinda considering it a trial period. We've already found two cases where load requires a refactor. The flexibility of specifying the query without a nested join is a nice aspect to load-data

tony.kay 2016-11-10T23:55:39.004283Z

I may leave it and just document it as a more flexible, but more bit-twiddly way to do loads. Perhaps if I remove the bits that load supports cleanly, then leaving load-data for the other cases will be nicer. It is a breaking change, though.

tony.kay 2016-11-10T23:55:52.004284Z

I don't like breaking changes 🙂

tony.kay 2016-11-10T23:56:27.004285Z

I think just dropping the :ident parameter would make it cleaner

tony.kay 2016-11-10T23:56:41.004286Z

and the new load does that really well (now)

tony.kay 2016-11-10T23:58:50.004287Z

I think I'll do it that way: Deprecate :ident as a parameter, and support both. load is generally cleaner, but load-data is more general purpose.