om-next

2016-10-01T14:47:01.000211Z

from the getting start guide: "The reconciler accepts novelty, merges it into the application state, finds all affected components based on their declared queries, and schedules a re-render."

2016-10-01T14:47:19.000212Z

i believe i understand this sentence, but haven't seen "novelty" used in this context

2016-10-01T14:47:39.000213Z

is there a computer science paradigm that makes use of that term that i might look up?

levitanong 2016-10-01T15:00:22.000214Z

@machty “novelty” doesn’t really refer to any specific concept. It means what it is: Something new 🙂

levitanong 2016-10-01T15:00:37.000215Z

Basically it refers to whatever new data you have.

levitanong 2016-10-01T15:01:20.000216Z

Under the hood, it’s a merge, but you can change that function to anything you like, if ever you need to.

2016-10-01T15:08:11.000217Z

@levitanong thanks

2016-10-01T15:08:21.000218Z

another question, i'm reading this excellent article https://circleci.com/blog/why-we-use-om-and-why-were-excited-for-om-next/

levitanong 2016-10-01T15:08:33.000221Z

go on

2016-10-01T15:08:41.000222Z

>But in the UI, the “Delete” button should really be part of the grocery item component. Just as our data doesn’t map perfectly to our UI, neither do our mutation operations. >The usual solution to this problem in Om is core.async channels. The grocery list component would set up a channel and pass it to each list item. To delete itself, an item component would put a message on that channel. Meanwhile, the list component would run a go block to listen for the message, and when it got it, it would om/update! its cursor.

levitanong 2016-10-01T15:08:41.000223Z

Also, sho thang, brah

2016-10-01T15:08:55.000224Z

?

levitanong 2016-10-01T15:08:59.000225Z

“sure thing, bro"

levitanong 2016-10-01T15:09:00.000226Z

😛

2016-10-01T15:09:28.000227Z

yeah i just didn't know if inadvertently did a bro-y thing

levitanong 2016-10-01T15:09:33.000228Z

I’m not sure why they’d use a channel for that

2016-10-01T15:10:00.000229Z

that was my question... why not just have the list component pass in a callback?

levitanong 2016-10-01T15:10:14.000230Z

lemme take a look at their code

levitanong 2016-10-01T15:11:23.000233Z

@machty i think that section you’re reading is the part where they’re talking about how to do it in om.now

2016-10-01T15:11:43.000234Z

confirm, i'm just trying to understand why core.async would even be used for om.now

levitanong 2016-10-01T15:11:51.000235Z

In om.next, you wouldn’t even pass a callback. You’d just have the component use om/transact!

levitanong 2016-10-01T15:11:56.000236Z

ah, well

levitanong 2016-10-01T15:12:08.000237Z

i think it’s a matter of taste.

levitanong 2016-10-01T15:12:15.000238Z

you could use callbacks all you like, but other people prefer channels

2016-10-01T15:12:18.000239Z

yeah

2016-10-01T15:12:31.000240Z

i've heard a lot of recent backlash in the go community against channel-overuse where callbacks suffice

levitanong 2016-10-01T15:12:38.000241Z

Hahaha

2016-10-01T15:12:47.000242Z

presumably the same disagreements apply to core.async discussions

levitanong 2016-10-01T15:13:24.000243Z

There are some patterns we use in my company (and i’m sure we’re not alone)

levitanong 2016-10-01T15:13:47.000244Z

wherein you have some central go-loop that handles events, and matches on event types. Think pub-sub.

levitanong 2016-10-01T15:14:41.000245Z

so instead of some deeply nested component having to pass an action through several levels of callbacks, it can just get the channel from (:pub-chan (om/get-shared owner)) and put! the action in there

levitanong 2016-10-01T15:15:00.000246Z

and it can just skip all the way up to that central go-loop, and perform the actions there.

2016-10-01T15:15:25.000247Z

hmm is get-shared like context in react?

2016-10-01T15:16:31.000248Z

i guess it's like context but scoped to a specific owner

2016-10-01T15:16:35.000249Z

so you'd still have to pass the through the owner to all the leaf components

levitanong 2016-10-01T15:17:45.000251Z

not at all

levitanong 2016-10-01T15:19:09.000252Z

in om.now, you can pass :shared to the root function, and any component down the line will be able to access those values via om/get-shared

levitanong 2016-10-01T15:19:20.000253Z

almost like global vars but scoped within your om app.

2016-10-01T15:19:32.000254Z

how is that different from context in React?

levitanong 2016-10-01T15:19:35.000255Z

in om.next, you can pass a map to :shared in the reconciler configuration

levitanong 2016-10-01T15:20:00.000256Z

context is defined by a component, not by an app

levitanong 2016-10-01T15:20:14.000257Z

and context requires you to specify proptypes.

levitanong 2016-10-01T15:20:52.000258Z

they’re similar in that they provide deeply nested children some data, skipping the middlemen

levitanong 2016-10-01T15:21:08.000259Z

but context is appropriate for library authors, and i don’t think shared is

2016-10-01T16:06:22.000260Z

so what is the status of Om.Next? Is it still alpha/beta? (also where do I go to answer this question myself next time?)

levitanong 2016-10-01T16:10:07.000261Z

Currently alpha. You can check the om release tags, and see the latest version

2016-10-01T16:11:14.000262Z

are there some big picture problems that remain to be solved? is there an area of om.next that's particularly volatile?

levitanong 2016-10-01T16:12:08.000263Z

you might like to ask that question on the om channel. That’s where david nolen and antonio monteiro hang out

👍 1