om

Please ask the channel first, not @dnolen directly!
ag 2017-04-06T00:59:39.505775Z

I have a function that does some data manipulations and returns {:value ,,, :remote ,,,}, it’s kind of “generic” it fits for most of the cases. I call it from my “read” methods, e.g:

(defn app-data-read [env k params] ,,,,,
  {:value ,,, :remote ast})

(defmethod read :foo
  [env k params]
  (app-data-read env k params))

ag 2017-04-06T01:01:24.522640Z

now what if in another method I need to reuse the output of add-data-read and manipulate some more?

ag 2017-04-06T01:02:40.533610Z

how do I do that? Maybe it’s just wrong to have the sort of “indirection” as app-data-read?

ag 2017-04-06T01:06:50.567985Z

because something like this won’t work:

(defmethod read :bar
  [env k params]
  (let [v (app-data-read env k params)] 
    (assoc-in v [:value :data :bar-data] 42)))

ag 2017-04-06T01:08:29.581283Z

oh, wait… no it actually works

raspasov 2017-04-06T03:32:58.610798Z

@ag yea it should work, I don’t see a reason why it shouldn’t….

raspasov 2017-04-06T03:33:55.616454Z

as long as it’s a pure function it shouldn’t matter how many function calls there are

ag 2017-04-06T03:33:56.616553Z

Sorry, I got confused myself (again)

raspasov 2017-04-06T03:34:11.617995Z

haha np 🙂 it happens to everyone

wilkerlucio 2017-04-06T15:07:00.548948Z

hello, I'm having an issue with advanced compilation, this is the error: Rl {message: "Invalid join, {:app/search-form nil}", data: n, ag: null, name: "Error", description: undefined…}

wilkerlucio 2017-04-06T15:07:29.561148Z

it seems like I can't get the query after advanced compilation, when I try (js/console.log "Root" (pr-str (om/get-query Root))), it returns nil for the query

wilkerlucio 2017-04-06T15:07:56.572371Z

is there any known caveat about this on advanced compilation?

matthavener 2017-04-06T15:17:50.816754Z

wilkerlucio: are you doing anything fancy with your cljs build process?

wilkerlucio 2017-04-06T15:29:49.116882Z

@matthavener I don't think so, this is what my compilation setup looks like:

{:id           "production"
                        :source-paths ["src/client"]
                        :jar          true
                        :compiler     {:asset-path    "js/prod"
                                       :main          mortician-gui.main
                                       :optimizations :advanced
                                       :output-dir    "resources/public/js/prod"
                                       :output-to     "resources/public/js/mortician_gui.min.js"}}

matthavener 2017-04-06T15:31:04.149200Z

ah ok, there’s a known bug that breaks get-query if you build after requiring om.next but that doesn’t look like its happening there

wilkerlucio 2017-04-06T15:31:57.172144Z

what you mean building after requiring om.next?

matthavener 2017-04-06T15:32:20.181664Z

I think the bug also asserts on get-query anyways, I don’t remember it returning nil

matthavener 2017-04-06T15:32:40.189764Z

ah like if you run the cljs builder inside the JVM after doing other things. Instead of running it via lein-cljsbuild

wilkerlucio 2017-04-06T15:34:30.234723Z

also, if I try to (om/query Root) it get's me Uncaught Error: No protocol method IQuery.query defined for type function: function (){React.Component.apply(this,arguments);this.state=null!=<http://this.Lc?this.Lc():{};return|this.Lc?this.Lc():{};return> this}

devo 2017-04-06T16:53:14.061086Z

Are there any examples of SSR with compassus besides the tests.cljc file in the compassus repo?

anmonteiro 2017-04-06T17:02:29.267946Z

@devo I don’t think so, no

anmonteiro 2017-04-06T17:02:50.275678Z

BTW, Compassus SSR doesn’t work with the very last Om Next release

anmonteiro 2017-04-06T17:03:12.283652Z

so you need to use alpha47 for now

anmonteiro 2017-04-06T17:03:33.291484Z

I’ve been meaning to look into that, but still haven’t had the time

devo 2017-04-06T17:08:30.399701Z

No worries. Been having issues merging in state correctly when rendering a compassus app server side. Will just keep tinkering with it.