This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-03
Channels
- # admin-announcements (8)
- # beginners (99)
- # boot (60)
- # cider (44)
- # cljs-dev (47)
- # cljsrn (68)
- # clojure (223)
- # clojure-art (1)
- # clojure-russia (190)
- # clojure-sg (9)
- # clojure-uk (2)
- # clojurecup (1)
- # clojurescript (59)
- # clojurex (3)
- # core-async (43)
- # core-typed (2)
- # cursive (18)
- # datavis (7)
- # datomic (16)
- # events (2)
- # funcool (3)
- # hoplon (3)
- # jobs (1)
- # lein-figwheel (10)
- # leiningen (6)
- # off-topic (1)
- # om (123)
- # onyx (57)
- # parinfer (16)
- # portland-or (2)
- # random (1)
- # re-frame (4)
- # reagent (7)
- # remote-jobs (1)
- # spacemacs (12)
Anyone have any thoughts on why a Om Next app would enter an infinite read/render loop? Using DataScript. Thanks.
Not sure, but if you have a read impl that always tries to remote you could get something like that , read, remote, merge, read, remote etc.
In om.next, what’s the idiomatic way to specify both the query and a filter? In the AnimalList
example with a start and end, how would you specify a query in addition?
Is there any info in the env (for example) that has a pointer as to why a read was called?
I mean, if your parser is recursive and you have a bug, then the recursion could be causing the infinite loop
are you allowed to refer to state like this ?
(init-state [_]
{:info (chan)
:publisher (chan)
:publication (:publisher #(:topic %))})
I’m trying to do this but it doesn’t work (init-state [_] {:info (chan) :publisher (chan) :publication (pub (om/get-state owner :publisher) #(:topic %))})
I get Uncaught TypeError: Cannot read property 'om_pending_state' of null(anonymous function) @
@tmtwd: what are you trying to do with those channels on state? if you wanna get a message out, I believe placing then on shared
and calling from the parser mutations would be more recommendable
@tmtwd: I think you got that error because you are trying to get the state of the component before the state has been initialized since that is the function that initialize it
Hi everyone. I’m a bit lost about optimistic updates - I know how to do it (change local state and send remote command at the same time), but what if remote command failed? Does Om can help in this case somehow? I cannot simply go back in the history as during remote command user could change something else
Maybe somebody have an example? Things I saw doesn’t have error handling unfortunately
Actually the more I think about it the more I realise that I have to handle those errors manually as there could be different business logic for each case. No general solution could be created I guess… but I will be happy if somebody can point me to the right direction, thanks!
@artemyarulin: Did you see this issue https://github.com/omcljs/om/issues/486. Is that the sort of functionality you are looking for?
@griffio: well… kinda not. This is just a way how to pass errors to the user (actually I don’t understand why state is bad for such thing) and my question is more about what to do with already changed state
@artemyarulin: Yes, I see. The optimistic state is temporary until confirmed by the server.
@artemyarulin: An example I found is from https://optimizely.github.io/nuclear-js/docs/06-async-actions-and-optimistic-updates.html. NuclearJs which is similar to om.next. You can see that the shopping cart data is temporary until successfully commited.
@griffio: Ah I see, basically they have a pending abstraction… hm… this may work. I guess I should check how other frameworks solves this problem. Thank you, I guess I found a right direction
@artemyarulin: Errors are transient in that they usually come from bad user input which is already in the state.
So I suppose you don't want them adding noise to the app state if you want to time travel back and forward, the error will appear anyway once you travel back to an erroneous state
oh, makes sense. I’m now putting everything to the app state, but I completely forgot about time-travel and undo. I should think about it
You should be able to take the state, copy it to another user, and get back the same UI...You don't need the actual error for that, it will appear naturally from the state
Errors are sort of side-effects of the state
Well my issue is a bit different currently. In general optimistic UI changes the local state without confirmation from the server side. What if user made a set of cchanges already and during syncronization server replied with error on first event? What could be done?
I guess it has nothing related to the om. At least for me it looks like more general issue
Whatever state triggered the error, whether locally or remotely, should trigger the same error each time it is 'loaded' without the error itself being in the state
well, it could be that backend was down for a while - next time if I apply the same state it will work just fine
Could be, I suppose it depends if you want to keep that in the history
It's your choice whether it goes in app state or not
I know, I know. I was hoping that maybe there are some general patterns for such problems exists
but it looks like a lot of things depends on app
on requirements I mean
@hmadelaine: Dude, that would be awesome
@dnolen: the more I build with this, the more giddy I'm getting...not enough hours in the day. I'm so excited about building out the tutorial, but also have to get work work done...fortunately both get to use Om!
@hmadelaine: One request if you integrate parinfer: a toggle switch to turn it on/off and a link to what it is so ppl know it is "doing stuff for them" instead of "doing crap to them"
@tony.kay: Ok, I am going to clean as much as possible before submitting the PR. I have to dig a little deeper for Parinfer
@tony.kay: @hmadelaine: super cool stuff!
@dnolen: thanks, OmNext deserves the best tool to learn. @tony.kay keep up the good work !
@hmadelaine: Wow, that looks amazingly helpful!
@jamiei thanks but @tony.kay did the hard work. I am just standing on his shoulders
@tony.kay: just submitted a PR adding some explanation, let me know what you think!
@jethroksy: busy morning. will look soon. Thanks!
I've introduced react.js into a nontrivial living ember.js codebase, which makes seeing this especially awesome. I hope all clojurists are cheering, if they ever heard about it the horror of Object.observable: https://twitter.com/jdalton/status/661254992502747136
if not, here's a good blog post: http://www.html5rocks.com/en/tutorials/es7/observe/
it wouldn’t have affected ClojureScript programmers much anyhow but it’s good that JS isn’t introducing bad idea #931
if you need any more evidence that Om Next is fixing some big conceptual problems around Flux / Redux / etc.
I'm not needing any more evidence of anything. The more we grok Om next, the simpler everything is getting. Just finished refactoring our production-app-in-progress. Read code down to like 6 lines. Remoting 6 lines. Mutations 20 lines. We haven't added many features yet (e.g. nothing needing params on query elements)...but the sheer lack of...well...almost every kind of pain is just awesome.
the pain is understanding the higher level concepts...which is the right kind of pain
What's the easiest way to get a quick Om app up and running with ClojureScript on both the server (i.e., node) and the client?
Following this but it doesn't seem to have a server: https://github.com/omcljs/om/wiki/Basic-Tutorial
I don’t think theres a template for Om.next, since it’s moving pretty fast. Om now doesn’t have a server component, but there are some templates around. A super minimal one would be pass the —om
flag to the figwheel template.
yeah, I don’t think there is an om next template but there are some example projects out there
also one of my chestut projects live-reloading doesn’t work so I have to refresh the page
I plan to update chestnut, it can be simplified a lot now that Figwheel is more mature, but might be January before I can do a proper release
Well it depends, Figwheel won't do everything that chestnut does, but currently I think it better reflects the state of the art
I think its hard to recommend a server setup because Om next really doesn’t care how your server is setup.
on this project live-reloading works fine https://github.com/tmtwd/tic-tac-toe
similar to as in @tony.kay's Om.next tutorial https://github.com/awkay/om-tutorial That way you also have a place to put devcards src and anything else you need
Thats what I’m doing right now, and one of those is for code thats shared between the frontend and the backend. I’m only sharing the frontend routes right now.
In om.next, what’s the idiomatic way to specify both the query and a filter? In the AnimalList
example with a start
and end
, the read function grabs the subvec
directly. Is there a way to communicate the query to use in that situation?
but you can use parameters and interpret those if you want to customize the query in some way - same as you do w/ URL query params