om

Please ask the channel first, not @dnolen directly!
sova-soars-the-sora 2017-04-10T01:29:01.416275Z

@carter.andrewj would you be happy to post a gist of some of your working code? i'm still tinkering with recursive queries myself

sova-soars-the-sora 2017-04-10T01:29:26.418768Z

like, how do i insert into my atom in a way that makes it easy to recurse over? that's been my question lately

jduenas 2017-04-10T05:12:54.654776Z

hi, is there a way to access the state history or to get the uuids produced by a transaction in om.next?

rgm 2017-04-10T05:38:55.797567Z

In thanks for all my learning here, I thought I'd contribute this gist in case it helps anyone wire up a component to D3 using refs: https://gist.github.com/rgm/7f2771a605956c17e5fb8c7409a7098a

rgm 2017-04-10T05:40:31.807020Z

I'll do approach two (just using D3 for data transformation and doing the DOM manipulation through React) sometime soon.

rgm 2017-04-10T05:41:46.814428Z

though that does seem easier to figure out given that from that approach the boundary between D3 and React is cleaner ... they're not invading each other's territory.

anmonteiro 2017-04-10T05:54:30.890977Z

@jduenas not directly for now, but work is planned. you can use :tx-listen though, which will give you the "old state" and store that yourself

jduenas 2017-04-10T07:49:22.913343Z

@anmonteiro thanks! will do

carter.andrewj 2017-04-10T12:47:11.709901Z

@sova Would be happy to (but currently snowed under fixing a newly-uncovered bug in our analytics pipeline) - Will hopefully get around to it later today, but in case I don't, please do remind me about it tomorrow 🙂

ul 2017-04-10T13:29:02.439926Z

folks, a little bit strange question, but I'm exploring that space now, so the question is: after years of Om and other React/virtual-dom/etc. based ClojureScript frameworks being here, do you think Om's decision to represent component as a type implementing Om interfaces is good one?

ul 2017-04-10T13:29:53.456333Z

from the point of view of leveraging language features and composability and extensibility

ul 2017-04-10T13:30:39.472571Z

in comparison with other solutions, i.e. Reagents function form-1 and form-2 and metadata

ul 2017-04-10T13:32:12.503687Z

do you had any profit from this decision in real-world projects? Like implementing for component other interfaces and having clean code as result

wilkerlucio 2017-04-10T14:24:20.637733Z

@ul that decision was dropped on Om.next, so for the React interfaces itself this is not the case anymore, in Om.next we still support other interfaces (like IQuery and Ident, and others) and for that I find it useful to have, one example is the Untangled framework that adds IInitialState, and I personally had created some interfaces myself and I find it useful when you need some specialized behavior

gardnervickers 2017-04-10T14:41:23.032715Z

@ul We’ve benefited from Om.Next’s static protocols quite a bit. We further extend our components with a protocol that looks like

(defprotocol Routing
  (url->state [this props])
  (state->url [this url]))
Which our root component uses to build up a URL or app-state by calling it’s children.

gardnervickers 2017-04-10T14:43:33.082243Z

We use this protocol to ensure our URL is in-sync with our app-state, and to provide the initial app-state on page load.

👍 1
2017-04-10T14:53:03.309657Z

Hi, are there plans to extract the om.next parser from om? I think it could be useful for other frameworks

ul 2017-04-10T15:22:22.016471Z

Thanks for response! So, having component as a type is good because we could extend it without using HOCs and all that ceremony with wrapping and re-wrapping component and proper passing through of props?

ul 2017-04-10T15:23:47.048980Z

Because I feel that for example Reagent components being functions doesn't compose in such nice ways as functions do (if I want full-blown component composition, of course, pure rendering functions are pure rendering functions and compose nice).

carter.andrewj 2017-04-10T15:54:53.774344Z

@gardnervickers That's a pretty nifty solution there - is the code available somewhere for me to peruse (and, with permission, imitate)?

gardnervickers 2017-04-10T15:55:23.786429Z

@carter.andrewj The code is just the protocol 😄

gardnervickers 2017-04-10T15:56:02.801925Z

I’ll see if I can make a sample devcard soon.

wilkerlucio 2017-04-10T17:14:44.486320Z

@jeroenvandijk any reason for not including Om.next just for that?

carter.andrewj 2017-04-10T17:15:54.510487Z

@gardnervickers Cheers 🙂

peeja 2017-04-10T20:53:02.892221Z

I'm trying to build a recursive parser, and it's a bit of a pain that the parser can't accept a query of [*]. Would the project be open to a PR that would make that query work?

anmonteiro 2017-04-10T20:55:36.941100Z

@peeja what would the parser dispatch key be in that case?

peeja 2017-04-10T20:55:55.947015Z

Probably '*

anmonteiro 2017-04-10T20:56:11.952108Z

that’s not a valid key according to the spec though

peeja 2017-04-10T20:56:23.956245Z

(parser/query->ast '[{:foo [*]}]) ;; => {:type :root, :children [{:type :join, :dispatch-key :foo, :key :foo, :query [*], :children [{:dispatch-key *, :key *}]}]}

peeja 2017-04-10T20:56:29.957904Z

That's what happens today

peeja 2017-04-10T20:56:55.965985Z

symbol->ast turns a symbol into an AST node with no :type

peeja 2017-04-10T20:57:42.980693Z

A symbol should be a valid dispatch key: https://github.com/omcljs/om/blob/master/src/main/om/next/impl/parser.cljc#L34

peeja 2017-04-10T20:58:10.989272Z

Of course, that's currently meant for :calls, but still, it's valid

peeja 2017-04-10T20:59:09.008112Z

Oh, and for ..., but ... never hits the read because the parser handles the recursion