This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-10
Channels
- # beginners (97)
- # boot (77)
- # cider (7)
- # cljs-dev (47)
- # cljsrn (3)
- # clojure (125)
- # clojure-austin (5)
- # clojure-dusseldorf (1)
- # clojure-italy (4)
- # clojure-russia (91)
- # clojure-spec (80)
- # clojure-uk (54)
- # clojurescript (92)
- # core-async (6)
- # cursive (17)
- # datomic (56)
- # hoplon (7)
- # immutant (3)
- # liberator (3)
- # luminus (4)
- # off-topic (26)
- # om (41)
- # om-next (11)
- # pedestal (3)
- # perun (3)
- # protorepl (25)
- # re-frame (32)
- # reagent (33)
- # ring (46)
- # rum (3)
- # spacemacs (5)
- # specter (82)
- # test-check (16)
- # untangled (8)
- # yada (26)
eghrrr… can someone tell me? why when I have a query in the Root with subquery of a component that has ident such as [{:app/data (om/get-query CompWithIdent)}
then in :app/data
read method I can see things in state normalized. Yet when I move the query to another component, let’s call it simply Widget
and then replace query in the Root to use (om/get-query Widget)
then om doesn’t normalize things anymore?
ok, for the lack of better ideas I just did this: (om/tree->db (-> ast om/ast->query vector) @state true)
in :app/data
read method to force normalization.
Can anyone suggest why I can’t target :nodejs when building cljsjs.react dependant app? I get
Error: Cannot find module 'react'`
thrown from react-dom.inc.js, even though I don’t use any optimizations? Something to do with require paths, but can’t make it look in the directory where compiled files are (out)I think it’s a problem with cljsjs.react.dom, as soon as you require the ns it won’t compile for :target :nodejs. The issue is reproducible with omcljs, too
You can try by removing all require’s from (ns om.next.run-tests) and only require cljsjs.react.dom, run
./bin/tests
it will fail with the above error.(ns om.next.run-tests
(:require [cljs.test :refer-macros [run-tests]]
[cljs.nodejs]
[cljsjs.react.dom]
;[om.dom]
))
(defn main []
)
(set! *main-cli-fn* main)
This should do.I think it’s cljsjs/react-dom issue, created a ticket: https://github.com/cljsjs/packages/issues/923
with compassus, where can i find out the route params?
nvm, i need to handle this myself in my set-route! method i believe..
can params be passed to :index-route? its not so clear to me how i set params when the page loads
should i pull them out of the url and set them in my initial app-state?
it works, just don't know if its a best practice...why even set an :index-route
and not just set that up in the initial app-state as well
@danielstockton in an om.next toy using bidi I stick it in the app-state under the key :route/params
yeah, that's what I'm doing, just seems strange to pass :index-route to compassus without having the option to initialize params too
@danielstockton FWIW, our :index-route
just shows a spinner, then the history mechanism fires some kind of set-route!
, even when the path is /
Is the :easy-reads
reconciler options documented anywhere? Looks like it just picks an implementation of transform-reads
, but I'm not quite following the code. Is :easy-reads false
a more thorough search that's less performant?
@peeja not documented and probably subject to removal soon
:easy-reads true
just keeps whatever you passed in the read vector
if it's false it'll eliminate duplicates and such
That’s exactly what I’m trying to do, but the normalization not being kicked-off. I’m wondering now, maybe defcard-om-next
(macro that @anmonteiro wrote) is doing something and Root component not being rooted properly?
basically I expect things to be automatically normalized if I have a component with an ident anywhere in the component graph, not just top level, right?
@ag yes as long as your non-normalized data matches your query structure
oh, it means that if I have final query {:root {:app/data ,,,
, in the atom as well I have to have the same structure? I can’t just put :app/data
at the top level?
is there anything I can do in read method for :root
? since it’s just a “placeholder”? Right now what I’m doing is this {:value (parser env query)}
but then things don’t get normalized automatically, since the state-atom doesn’t have :root
key
interesting @peeja, sounds like a good idea to avoid a FOUC before the loader kicks in
i trigger/remove my loader in send, either side of request/merge at the moment
geez… everytime I feel I get close, om throws temper tantrums. can someone explain to me. (db->tree)
does not execute parser reads, right?
so now I’m struggling to get the right query that a) being in the root will normalize data, b) pulls things based on given ident pointer out of normalized db
so, setting the right query in the root that resembles the structure of denormilized data in the atom forces reconciler to denormalize things. Now how do I include in the query part where I need specific data, that I want to grab via ident pointer e.g. [:list-data/by-id 1]
so my initial query that forces things to be normalized when I pull it with (get-query Root)
looks like this: [{:root [{:app/domain-data [{:rows [:description]}]}]}]
, now in reality what I need is to pull data by ident, e.g. [{[:domain-data/by-id :resources] [{:rows [:description]}]}]
but setting that kind of query in the root breaks normalization.