untangled

NEW CHANNEL: #fulcro
2016-10-10T00:18:20.002133Z

@tony.kay: will do, thanks!

wilkerlucio 2016-10-10T19:52:17.002144Z

hello people, about the case when you want a partial query that isn't on any component and also need an ident with it. the docs for untangled recommend that we create a class just for the query. I'm have being toying with a different approach, in my case at least, most of my idents follow a common pattern, that is: [(:db/table props) (:db/id props)]

wilkerlucio 2016-10-10T19:52:23.002145Z

so I created a helper like this:

wilkerlucio 2016-10-10T19:52:52.002147Z

then I can just write: (untangled/load {:query [{:app/me ~(with-ident [:db/table :db/id :user/score])}]})

wilkerlucio 2016-10-10T19:53:04.002148Z

what you think about this approach?

tony.kay 2016-10-10T19:54:25.002149Z

@wilkerlucio Well, the plus is you don't generate unneeded code. I really think this is a problem in core Om as well. So, I would not want to integrate a solution in Untangled...but I would advocate for something like it in Om. The thing is, it is possible they could hcange the implementation (e.g. the keyword :component could get namespaced) in a way that breaks this function....so they should evolve together.

tony.kay 2016-10-10T19:54:48.002150Z

I got the idea of using defui to make queries from David Nolen....it is an accepted and recommended technique for Om

wilkerlucio 2016-10-10T19:55:33.002151Z

yeah, I guess making it explicit also gives more information later if you wanna track it

tony.kay 2016-10-10T19:56:13.002152Z

and get-query might eventually add other metadata....just too fragile this way without being part of Om

tony.kay 2016-10-10T19:56:26.002153Z

then again, easy to fix as Om evolves....well, I think

tony.kay 2016-10-10T19:57:06.002154Z

could be that it starts adding metadata related to something else on the component, in which case you're better off with defui overall. I'd be happy with an alias for defui...like defquery

tony.kay 2016-10-10T19:57:26.002155Z

well, maybe not an alias, but something that assumes you might want a query + ident.

wilkerlucio 2016-10-10T19:59:41.002156Z

umhum, gotcha, the stability seems reason enough to use the query component, I'll refactor to use that on my code, thanks @tony.kay for your input

anmonteiro 2016-10-10T19:59:49.002157Z

@tony.kay @wilkerlucio IMO you should just use defui for the reasons Tony mentioned and also because of future enhancements like better error messages and stuff

anmonteiro 2016-10-10T20:00:11.002158Z

also, I don’t think Om is going to add any sugary stuff, so defquery would probably need to be in user land

tony.kay 2016-10-10T20:00:33.002159Z

Yes, I understand that. David has refused all manner of sugar πŸ™‚

tony.kay 2016-10-10T20:01:45.002160Z

no hyper-glycemia happening in that library

anmonteiro 2016-10-10T20:03:30.002161Z

:simple_smile:

2016-10-10T21:53:31.002164Z

thanks for the docs!

tony.kay 2016-10-10T22:01:46.002165Z

Welcome, @jasonjckn. Be glad to hear feedback or accept PRs. Really trying to make this stuff easy to learn.

2016-10-10T22:39:17.002166Z

I recall some roll back mechanism for optimistic updates you were talking about ? docs? examples?

tony.kay 2016-10-10T22:39:32.002167Z

for optimistic updates? No

tony.kay 2016-10-10T22:39:39.002168Z

server errors

tony.kay 2016-10-10T22:39:54.002169Z

optimistic is local and deterministic within your mutation

2016-10-10T22:43:15.002179Z

maybe I should read those docs you wrote πŸ™‚

2016-10-10T22:44:37.002180Z

there's a doc typo I think s/defmutation/defmethod http://untangled-web.github.io/untangled/tutorial.html#!/untangled_tutorial.H_Server_Interactions

2016-10-10T22:46:39.002183Z

what was the rollback thing you guys were talking about? this was server side? docs?

2016-10-10T22:46:49.002184Z

was this specific to datomic?

tony.kay 2016-10-10T23:14:10.002185Z

should totally be defmethod

tony.kay 2016-10-10T23:19:33.002186Z

fixed