This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-22
Channels
- # admin-announcements (25)
- # beginners (60)
- # boot (277)
- # cider (5)
- # cljs-dev (3)
- # cljsrn (2)
- # clojure (82)
- # clojure-art (15)
- # clojure-berlin (2)
- # clojure-boston (1)
- # clojure-italy (40)
- # clojure-russia (118)
- # clojurebridge (1)
- # clojurecup (1)
- # clojurescript (82)
- # component (3)
- # cursive (31)
- # datavis (9)
- # datomic (39)
- # editors (1)
- # editors-rus (9)
- # emacs (15)
- # hoplon (50)
- # ldnclj (2)
- # leiningen (4)
- # off-topic (9)
- # om (123)
- # re-frame (28)
- # reagent (7)
- # vim (1)
- # yada (3)
if you’re just starting out and you try to do everything at once your unlikely to succeed
I’ve gotten all working except having different urls for production and local with my uri for the datomic db
Well, the bigger question I was trying to ask about is whether there exists any kind of a roadmap for someone willing to put the time in to learn all these things. There is no sign that says, if you would like to use datomic in production you will need to learn how to use components. The main thing I’m trying to figure out isn’t so much the answer to this one question, but rather whether there are guideposts to help me find out whether I’m even asking the right questions.
all this stuff is very new (Datomic + Client-centric approach) - so you’ll be adventuring with the rest of us
Then I suppose the next question would be — assuming I am able to figure out the answer to the next set of challenges — and I am able to document the path I have taken to get from zero to something, where might I place that map so that others could improve it/critique it/benefit from it.
nothing definitive yet, but the idea is brewing - I wouldn’t recommend pursuing very serious doc efforts until we get to beta however
but once we’re on the other side of beta - that would be a good time to write all kinds of tutorials / books
@dnolen: awesome. hopefully will be able to contribute by that time. Also, thanks for the feedback on focusing the question — was able to get an answer that solved my problem in the beginner channel 😉
@firinne: for some Om Next, ReactNative and related content, check out some of the work Mike Fikes (and others) have done here: http://cljsrn.org
Hey everyone, question: When looking at using Om, any suggestions for UI component libraries (bootstrap, material design lite etc. kind of libraries) ? I would think avoiding libraries that use JQuery would be reasonable for one thing? Are there some libraries that are a very good fit for Om (made for React maybe)?
use 1.0.0-alpha28 mutate fn throws exception Uncaught Error: Assert failed: app/route mutation :value must be nil or a map with structure {:keys [...]} (or (nil? value) (map? value))
Hi everyone ! Anyone has an example with Datomic on the back end and Datascript on the client ? I am struggling a little with the merge functions...
can someone elaborate on the :value
key of this? I find it confusing. It describes constrains on correctness while saying it will have no-effect at all?
:mutate - a function of three arguments [env key params] that should return a valid parse mutation result map. This map should contain a :value and an :action entry. :value is an optional hint at keys affected by the mutation; it has no effect on rerendering and should only contain keys valid for :read functions. The value of :action should be a function of zero arguments that applies the requested mutation.
@denik you can omit but it’s generally not a good idea - you want to document the implications of the mutation
@dnolen: hmm I still have trouble understanding what :result and :tempids have todo with it
@dnolen: my issue it that I have some components that don’t rerender after a transaction and I want to understand if :value has something todo with it
@denik ah it just sound like you’re not aware of the structure of :value
in the mutations case
well what if to components have the same query? Then, in the parent component, I only get the query from one component and pass the same props to the other which is query-less
When doing a remote update and i return the tempids mapping from the backend, is there anything i need to do make sure om.next updates the local client database with the new real ids. This is re-rendering but with the temp id.
(add-invite! [e]
(.preventDefault e)
(let [value (some-> e .-target .-form .-elements (aget 0) .-value)] ;; this is a mess
(om/transact! this `[(admin-ui/add-invite! {:org-id ~id :email ~value}) [:organization/by-id ~id]])))
And this is my mutate function
(defmethod mutate 'admin-ui/add-invite!
[{:keys [state ast]} _ {:keys [:email :org-id]}]
(let [temp-id (om/tempid)
ast (update-in ast [:params] #(assoc % :temp-id temp-id))]
{:action (fn []
(swap! state update-in [:invite/by-id] assoc temp-id {:db/id temp-id :invite/email email :organization/_invites {:db/id org-id}})
(swap! state update-in [:organization/by-id org-id :organization/invites] #(vec (conj % [:invite/by-id temp-id]))))
:remote ast}))
This is my response from my server,
["^ ","~$admin-ui/add-invite!",["^ ","~:keys",["~:invite/by-id",17592187944777],"~:tempids",["~#cmap",[["^2",["~#om/id","~u39e94a90-8982-4d87-929f-88c508c28f20"]],["^2",17592187944777]]]]]
@dnolen: Slack lost your instructions about what the foam design doc needed, so I did this from memory: https://github.com/arohner/foam/wiki/Design . It definitely needs more work. What else would you like to see added?
@arohner: cool will have to give a thorough read later but feel free to copy that stuff here https://github.com/omcljs/om/wiki/Server-Side-Rendering
@marcol not really - that could be made to work but I don’t really see a compelling use case
build project https://github.com/callemall/material-ui with dependency react
@a.espolov: you can probably ask that question in #C03S1L9DN - but
@dnolen more from a design perspective, I have data being taken from the query string but I did not want my component nor my parsing read function to have to get this information directly from the request, therefore wanted to decouple this responsibility and have this information be given.
@dnolen not a problem per se, just more of an architecture/design that I'm trying to achieve, so from that perspective you can say it is convenience
and it doesn’t really make any sense to me since the root component implicitly takes the root value of the query applied to the applicate state
@iwillig you’ll also need to give the reconciler a clue as to what to migrate: (om/reconciler {:state … :parser … :id-key :om/id})
(or whatever your primary key is)
@dnolen I have a single page app, and the application state has projects. A request is then made by the user to see only 1 project, which changes the hash of the url. A hash change is detected and the view is changed to show project information. I'm doing this by doing an add-root!
with a new component; therefore, was looking to have the project id be passed as an input instead of having the component or the query need to look at the query string for the project id
@marcol other people are working on that with various ideas and I have some things in the pipeline as well
@joshfrench: should it om/id or the key that my id are store in? in cause it would be :db/id
you’ll have to look at what other people are doing and tune in when I talk about routing sometime in January
@kahunamoore: much appreciated