This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-12
Channels
- # beginners (34)
- # boot (210)
- # cider (16)
- # cljs-dev (65)
- # cljsrn (3)
- # clojars (2)
- # clojure (107)
- # clojure-austin (8)
- # clojure-berlin (10)
- # clojure-brasil (1)
- # clojure-canada (1)
- # clojure-dev (1)
- # clojure-fr (1)
- # clojure-italy (22)
- # clojure-new-zealand (12)
- # clojure-nl (28)
- # clojure-russia (13)
- # clojure-spec (25)
- # clojure-uk (10)
- # clojurescript (109)
- # cursive (18)
- # datomic (44)
- # defnpodcast (1)
- # dirac (4)
- # emacs (2)
- # funcool (1)
- # hoplon (16)
- # jobs (14)
- # lambdaisland (23)
- # leiningen (2)
- # luminus (3)
- # off-topic (7)
- # om (58)
- # onyx (16)
- # proton (6)
- # re-frame (42)
- # reagent (55)
- # ring-swagger (5)
- # untangled (47)
- # vim (9)
just hit this https://github.com/omcljs/om/commit/39f68233aab0ef5f38f8e220afed1e7f89190645 great work guys
Hey, could anyone suggest what’s the correct way to use :query-root to denote what’s to send to the server? e.g, is it right in read
(let [updated (assoc ast :query-root true))
{target updated})
Can I assume this will be the root query to be sent over, if only one key did that for its ast?@alex-glv yes, given you use process-roots
on the send function
@alex-glv btw is this your issue? https://github.com/compassus/compassus/issues/11
Ah, yeah. I am still struggling a bit with the terms and parsing in om.next, not sure if the wording makes good sense. I am trying to work on learning from grounds up, ast and parsing, sending queries etc..
I’m afraid I don’t understand your issue
Happy to talk it through here
I’ll close it. I changed a lot and trying to learn om by re-implementing parts of compassus and reading other resources. I realised I don’t how it works yet.
@peeja we just create a state atom serverside with a db inside it? And then after mutations update the db with a db-after
@alex-glv It sounds like you're thinking about the data backwards. You don't want to pass the data from your route into your components, you want to query for it from your components.
For instance, on CircleCI, here's a page that's querying for the organization that was selected by the URL: https://github.com/circleci/frontend/blob/master/src-cljs/frontend/components/pages/projects.cljs#L145
@peeja are you using Compassus in production?
awesome, great to hear!
@rastandy Can you tell us in more detail what about text inputs you are struggling with? When you ask about whether someone has implemented a generic text input that doesn’t lose focus, do you mean a text input that is always focused, and cannot be unfocused?
@levitanong yeah, sorry for the ambiguous question
@levitanong I mean a text input component which allows to call an om.next transaction in its onChange event, and don’t loose focus even when the transaction causes a call to its own render function
@rastandy Hmm.. I don’t recall ever having that problem. Could you paste some sample code?
@levitanong let me try to isolate the problem and send you a self contained example
@rastandy that would be great!
@levitanong I can’t make it on time
@levitanong but I’ll prepare one for tomorrow
@levitanong thank you for your help for now 🙂
@rastandy: sure thing :) just ping me.
@anmonteiro merged those outstanding PRs from yesterday
thanks for the heads up
Is there a way to trigger re-render of given read keys, in the clientside mutation implementation?
e.g. instead of (transact! this [(choose-tab) :key-on-root])
have it so it's just (transact! this [(choose-tab)])
and :key-on-root
is specified inside 'choose-tab
mutation
if I add to render queue immediately after calling transact! , and renders guaranteed to happen after the all the client-side mutations have been processed, that were just specified prior in the transact! ?
I’m hitting two, I suspect related react warnings: Expected props argument to be a plain object. Properties defined in its prototype chain will be ignored.
and Unknown props ‘meta', ‘cnt', ‘arr', ‘__hash', ‘cljs$lang$protocol_mask$partition0$', ‘cljs$lang$protocol_mask$partition1$' on <div> tag. Remove these props from the element.
. I’m calling (om.dom/div (clj->js {}) …)
, but the clj->js source makes me think this should work without error.
@arohner could you somehow have forgotten to use clj->js
somewhere?
that looks just like the attributes of a persistent data structure
@anmonteiro yeah it’s possible, I just don’t see where 🙂
@arohner https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/core.cljs#L6168
I would even risk saying that’s what you’re doing for sure 🙂
Better to ask om-next ? here or in #om-next which has far fewer members -- #anmonteiro tells me om-next is in active development, the 2 are quite different, therefor beginner should start with om-next probably -- best resources to understand om-next quickly? I am now up and running with React Native on Android and wish to write primarily for the Android platform initially with option to re-use (much) on web or iOS or even desktop...
@herbm there’s a bunch of stuff on the wiki you should read through, but you should also ask questions here for anything that you don’t understand
there’s a bit of learning curve if you’re coming from typical front-end dev, we incorporate some ideas from GraphQL/Relay as well as Falcor - neither which are that well known / understood yet
cljs.user> (om.dom/div #js {} "foo")
#object[TypeError TypeError: Cannot convert a Symbol value to a string]
TypeError: Cannot convert a Symbol value to a string
at Array.join (native)
at Function.cljs.core.str.cljs$core$IFn$_invoke$arity$1 ()
at Object.cljs$core$str [as str] ()
at Object.cljs$core$pr_writer_impl [as pr_writer_impl] ()
at cljs$core$pr_writer ()
at
at Object.cljs$core$pr_sequential_writer [as pr_sequential_writer] ()
at cljs$core$print_map ()
at Object.cljs$core$pr_writer_impl [as pr_writer_impl] ()
at Object.cljs$core$pr_writer [as pr_writer] ()
ah, looks to be http://dev.clojure.org/jira/browse/CLJS-1631
yeah, that’s just the printing
use js/console.log
to see the stuff in the console
Trying to wrap my head around readers. - What am I allowed to return? :value is just going to stop parsing and bubble up the reads. - I can return {target ast} (potentially modified). If I return an AST of one of the children, how is going to affect the merge later? - Can I return another query? If yes, can I return (with-meta query {:query-root true}), will this query be sent over to the remote (given I do process-roots in send) - Will every key in the query hit the reader that has this key as dispatch value unless parent returned :value, then it won't? Appreciate if anyone can chime in on these questions!
So if I have data something like this:
{:colors {:colors/list [{:color-id 0
:name "red"
:details [{:id 0 :description "Red. Cras placerat accumsan nulla"}
{:id 1 :description "Red. Donec vitae dolor"}
{:id 2 :description "Red. Nullam rutrum"}]}
{:color-id 1 :name "orange"
:details [{:id 0 :description "Orange. Cras placerat accumsan nulla"}
{:id 1 :description "Orange. Donec vitae dolor"}
{:id 2 :description "Orange. Nullam rutrum"}]}
,,,]}}
What would be the correct (parametrised) query to retrieve details
for a given color-id