Fork me on GitHub
#untangled
<
2016-04-15
>
ethangracer00:04:26

if anybody is interested in a relatively simple PR, that would be a good one. the keys that we use in the default reconciler config should definitely not be overwritten

wilkerlucio00:04:47

@ethangracer: thanks for the reply, actually I found out that my problem wasn't related to that, I fixed with something else

wilkerlucio00:04:08

although, I agree with you about the reconciler options, having then being configurable is a must

jimmy06:04:17

@tony.kay: I notice nice Untangled T-shirt 😄

tony.kay06:04:26

@wilkerlucio: There is no problem, in principle, with letting you send extra args, but realize we've provided stuff for: - Parser - Merging - Networking

tony.kay06:04:27

and none of that should be touched. If you have specific configuration options you want access to, would be willing to make them available if they make sense. It is important to understand that a lot of the stuff you can configure in Om is configured to "just work" correctly...e.g. tempid remapping is fixed...deep merge and attribute stomping....lots of stuff.

tony.kay06:04:39

We're writing big stuff, and have not needed overrides

tony.kay06:04:57

@nxqd: Thanks! I'll be wearing some additional colors here and clj west simple_smile

tony.kay06:04:00

@wilkerlucio: You don't need to set id-key. Tempids "just work". We've fixed them. Just return a {:tempids {}} remap from you server-side action...which is a touch-up from Om as well...they'll automatically get sent back and merged properly

tony.kay06:04:30

The whole point of Untangled is that you should not have to configure things like the id-key, merge behavior, etc.

wilkerlucio12:04:25

@tony.kay: thanks, one case that I'm still missing configuration options is about the logger, I would like to disable it

ethangracer14:04:36

@wilkerlucio: it is currently broken on the public repo, but the untangled.client.logging namespace has a set-level function that you can use to turn the logging off. Right now it it'll change the logging level appropriately for every level except for off

ethangracer14:04:17

Call it in your dev user namespace before mounting the app

wilkerlucio14:04:49

@ethangracer: cool, but what about the Om itself logging (that happens on transactions), is that going to be disabled as well?

ethangracer14:04:30

Yes, we just hijack om's logger and use it ourselves 😄

ethangracer14:04:56

So if you turn logging off, om stops logging too

wilkerlucio14:04:11

thanks for the clarification

joshg18:04:22

I’m watching Tony Kay’s presentation but don’t understand how you can eliminate query params. If I want to load the fifth page of comments, how is that accomplished without a query param?

ethangracer18:04:55

@joshg let’s say you have a list of 25 items, and you want to show them 5 at a time

ethangracer18:04:27

your database will have idents that look like [:item/by-id 1] [:item/by-id 2] …

ethangracer18:04:49

so you set up your UI to load initially and only use the first 5 idents

ethangracer18:04:09

then when the user clicks the link to switch to page 5, you just swap out the idents in the app state that belong on page 5

joshg18:04:32

What if I don’t know those idents yet?

ethangracer18:04:42

then you load them from the server

joshg18:04:59

So it takes two trips to load the next page?

ethangracer18:04:00

if they don’t exist at all, i guess don’t show a link to page 5?

ethangracer18:04:29

or you could load the first page as one load, and immediately load all the other pages. just don’t show them immediately

ethangracer18:04:06

e.g. (app/load page-1) — render page 1 — (app/load remaining-pages)

ethangracer18:04:40

also, changing pages is just a UI concern, so that doesn’t require a trip to the server

ethangracer18:04:57

so even if you load each page one at a time, it’s only one trip per page

joshg18:04:53

What if the user clicks on page 20? Would I have pre-loaded all idents for each page?

ethangracer18:04:41

totally depends on your implementation

ethangracer18:04:49

you get to decide how you want to do that

joshg18:04:04

Assuming that the cost to preload all results is too high, the way to load page 20 would be to request the idents from the server and then swap them, which will load those idents?

joshg18:04:43

Or would it make sense to actually put pages in the app database?

wilkerlucio18:04:04

@joshg you could load a map like this: {:list/page 1 :list/total-pages 3 :list/items [...]}

wilkerlucio18:04:54

since Untangled use explicitly commands to load the data, you can send the current page to load via a param, the first load would always use page 1, and the others would be sent

joshg18:04:54

and then have a page mutation to increment the page?

wilkerlucio18:04:14

with the info on that map you can figure if there is a next page

wilkerlucio18:04:51

then you could use something like: (df/load-data reconciler [{:some-list [:list/page :list/total-pages {:list/items (om/get-query ItemsComp)} ]}] :params {:list/page 2})

wilkerlucio18:04:25

that makes sense?

joshg18:04:58

Yes, I think so. That seems like cleaner solution that would support more traditional paging queries.

joshg18:04:19

Thanks @ethangracer and @wilkerlucio for your help