This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-10
Channels
- # admin-announcements (7)
- # announcements (3)
- # avi (1)
- # beginners (222)
- # boot (184)
- # braid-chat (75)
- # business (7)
- # cljs-dev (3)
- # cljsrn (9)
- # clojars (17)
- # clojure (131)
- # clojure-dev (1)
- # clojure-portugal (4)
- # clojure-russia (39)
- # clojure-sg (1)
- # clojurescript (140)
- # community-development (563)
- # datomic (5)
- # editors (1)
- # emacs (3)
- # events (3)
- # leiningen (4)
- # off-topic (31)
- # om (84)
- # omnext (1)
- # slack-help (3)
- # yada (5)
@donmullen: thanks
UPD: Downgrading om
version to one om-sync
uses solved the problem
@anmonteiro: good stuff
@octo221: lazy seqs can be in the app state provided they aren’t a part of the query structure (joins etc.)
there’s already a ticket for it https://github.com/omcljs/om/issues/556
i'm getting up to speed on the clojurescript & surrounding ecosystem. I would to prototype a webapp that is kept up to date in real-time as new events come in that are stored in a datomic database (flexible here) , any suggestions on what route to take for this that's simple/reliable/etc, which framework (reagent, om next, etc), which database if not datomic, presumbly using websockets to stream updates (?)
so far i've been reading/playing with reagent which seems fairly straight forward, and om next which i somewhat understand now
i would like to put it into production if the prototype is well received, so reliability is important
@jasonjckn: If you want, like you said, educate yourself, so I highly recommend to start from https://github.com/omcljs/om/wiki/Basic-Tutorial on Om. Trying to learn Om Next before Om isn't likely possible (I tried to do so).
@jasonjckn: I think the question is whether you’re OK with just rolling your solutions over Reagent or piggieback on Om Next patterns
dnolen: suggested something along the lines of using merge! in om next to merge in novelty that is streamed over the websocket
I think also a question of whether it’s just you or several other people on the project
dnolen: sorry didn't quite follow, if I'm okay with using om next design patterns but using reagent?
well, as far as team dynamics, om next probably won't work with the team, as they don't even know clojurescript besides 1 guy
@jasonjckn: yes - just use the same patterns with reagent
it only simplifies it insofar as the real-time and request/response model is exactly the same
normal Om Next apps use merge!
too - the whole thing is intentionally dog-fooded on itself
with datomic you need to do some extra work to get the subscription of events to look like your datomic query results right?
@jasonjckn: You might also try Hoplon framework (find the corresponding channel and "Web programming with Hoplon" Clojure/conj video). It's one alternative for React-based family of CLJS frameworks (I'm currently switching to Om though). It doesn't handle real-time too, but it's update model is somewhat interesting — each transaction just updates state of the whole page.
thanks andrew, I did look at that briefly, the api looked not so different from reagent (cell vs atom), although I understand they're built on different stacks
Is om-sync
actual? I'm trying to go through this section of the tutorial https://github.com/omcljs/om/wiki/Intermediate-Tutorial#modularity but adding [om-sync "0.1.1"]
seems to provide problems, e.g. this: http://dpaste.com/23YFZZ9 (this is together with om
version 0.8.8
). When I switch Om to 0.5.0
, lein figwheel
compiles but then I got "React not found" (not literally, but the sense is this) in my browser console.
@jasonjckn: If you completed the tutorials, haven't you had problems like mine above?
ah, and only that ones. got it!
@iwankaramazow: I see, my project has very static data. So haven't run into those problems. Netflix apps seem pretty static too, so that might explain why they use it, doesn't go much further than -user favorites thing- (on the front-end anyway).
@andrewboltachev: That om-sync thing is for old om.
@tomc: Hey, I stumbled across your route example gist and trying to add it to my app. The child query seems to execute correctly, but in my case the matching read will return {:remote true} to indicate that data should be fetched, however the :send function of the reconciler isn't being executed as a consequence, and thus the target components render function is called without the data it needs. Any ideas? I'll see if I can whip up a minimal test for you.
@tomc: If I add the target component directly via add-root, its query is being executed correctly, with the following :send's data fetching before render.
@dnolen: I'd love to see defui
support react's displayName
. Willing to accept a patch that adds this?
@dnolen: cool! submitting later today
@jasonjckn: if you include db/id with all joins in a pull, and you have set up the db.type/ref on the datascript side you can transact the pulls directly. You still need to do your subscription logic but that will take care of the db part without extra work.
In Om Next, would implementation of tabs-like thing (i.e. few components, from which only one is currently visible) be trivial? Might I easily implement sth like "postponed query" (i.e. fetch only on display)? Would I need to fetch data for all tabs anyway?
@andrewboltachev: i've done something like that by having the tab as a queryParam on the component, then passing it to the relevant queries, the readers then check if the param is equal to what we want and return {:remote true} if the data is not there
@rafd: Got it. Thanks!
@rafd i've been trying that but the child components remote fetching doesnt run, it does run if it's added as root though.
The read of the child components ends up inte :remote case though, just that the :send doesnt happen.
@nano: I can imagine that child components must depend on key you use (sth like :app/route
) to react on it's change?
@nano: Do you have this on GitHub as well?
No not yet, it's a battle field right now, trying to get this working. Should clean it up and push even if it's slightly broken.
i.e. add :app/route
to your (query [_] ...)
I followed this example here, https://gist.github.com/tomconnors/c1cceaae84fd059e37a3, and my child component's query is: '[({:grid-items ?item} {:section ?section :view ?view})]) do you mean just prepending :session/route there to the outer list?
@nano: let me check the gist
@andrewboltachev: i currently have all the params in my root view
Will github this as soon as I get routing working, after that it should be mostly downhill. Working on a Swedish Television Tizen app for my new Samsung TV.
here's some of my code: https://gist.github.com/rafd/c0aca82e0b1f9a32c5d9
thanks @rafd ! I certainly like this more than huge gist from above
@andrewboltachev: note, i am using datascript for storing data + secretary for routing
I wonder... if om/set-query!
is aware of reconciler (and none of the code from inside components it) as in this example https://github.com/omcljs/om/wiki/Quick-Start-(om.next)#change-the-query , where should I put it? Inside :action
of mutatef
or somewhere else?
Though it isn't. One might pass component also: https://github.com/omcljs/om/blob/master/src/main/om/next.cljs#L646