Fork me on GitHub
#om
<
2015-12-05
>
dnolen16:12:47

everyone working on routing should read this and provide feedback

dnolen16:12:42

based on the various solutions I’ve heard about - revisiting some assumptions and thinking a little bit differently about the problem should allow people to build robust and sophisticated routing solutions that don’t have the over-rendering problem

jdubie17:12:10

@dnolen: thanks for posting about routing - it’s something very important to me and i’m still don’t feel like i have a handle on how to do routing in a clean way in om next. "Questions like how to propagate or modify parameters from the top-level means users have not yet seriously considered the various tools around query - the simple AST”. what are you suggesting here? read-time interpretation of the ast? like using a union query and subselecting the interesting pieces based on the db state?

dnolen17:12:49

no separate everything I’m saying from storage or parsing

dnolen17:12:54

not relevant to this conversation

dnolen17:12:13

A) routing must happen from above at the root

dnolen17:12:20

B) what’s needed to make this tractable

dnolen17:12:31

that’s the only thing I’m interested in

jdubie17:12:03

do you think it should happen from the root and involve om/set-query!

dnolen17:12:14

it doesn’t matter how it happens

dnolen17:12:22

it could happen via the reconciler

dnolen17:12:38

basically I’m trying to get people to stop thinking about concrete stuff

dnolen17:12:42

only the actual problem

jdubie17:12:23

is there any notion of routing in relay or falcor that we could emulate?

dnolen17:12:05

but again I’m not interested in routing

dnolen17:12:21

I’m interested in making it possible to do clean routing

jdubie17:12:45

got it. why concretely is that not possible with om next right now?

dnolen17:12:47

you can do it but not optimally

dnolen17:12:07

for example the router wants to parameterize

dnolen17:12:38

but the way query params on components works means people make the wrong assumptions

dnolen17:12:42

and over-render

dnolen17:12:55

instead people should be propagating params via the router

dnolen17:12:46

also rendering at the root whether via reconciler or root component means re-rendering everything

dnolen17:12:56

even if some nested child is just switching views

dnolen17:12:59

note that these are the fundamental concerns and problems - I don’t care about what high level solution people come up with. If the fundamentals get sorted people can build exactly what they want how they want simple_smile

noonian20:12:41

Re: routing, one thing I like about using joins for routing is that you can still get the root query of the application and know the entire demand for the application across all of it’s logical “pages”. This puts the burden on the programmer to give him or herself the correct semantics for when to fetch data through the parser implementation, but with set-query! you are kind of back to reasoning about objects changing over time.

dnolen20:12:09

@noonian: I’m not suggesting set-query! is what people will ever use directly

dnolen20:12:36

I’m only talking about people who want to build some generic router thing and the hooks they need

noonian20:12:31

Ah, I see. So you could ship a routing component with no ties to application specific code and ship it as a library?

dnolen20:12:51

well it would be tied to application code but yes it could be a library

dnolen20:12:57

so some routing library might support

dnolen20:12:22

(set-view! [:main :login])

dnolen20:12:34

and this generically works with queries etc.

noonian20:12:34

Yeah, you might ship both a component and a function to drop into your parser for one of the keys or something

dnolen20:12:14

also for for making urls maps to queries etc.

noonian20:12:19

@dnolen: thanks for you thoughts. I have to meet some people for lunch but will be thinking about this

jgdavey23:12:58

Is there any reason why this here https://github.com/omcljs/om/blob/master/src/main/om/next.cljs#L955 says must be “ref or keyword”, but the condition is only (if (keyword? k))

jgdavey23:12:51

I’m getting an error when a remote returns an ident rather than a keyword at the top level of the map