Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 12 2021 12:30
    fahtative commented #26
  • Sep 12 2021 12:17
    fahtative commented #26
  • Sep 12 2021 12:17
    fahtative commented #26
  • Sep 12 2021 12:13
    fahtative commented #26
  • Sep 12 2021 12:01
    fahtative commented #26
  • Sep 12 2021 12:01
    fahtative commented #26
  • Sep 12 2021 11:59
    fahtative commented #26
  • Sep 12 2021 11:59
    fahtative commented #26
  • Nov 30 2020 19:39
    metasoarous closed #34
  • Nov 30 2020 19:39
    metasoarous commented #34
  • Nov 16 2020 05:16
    metasoarous commented #34
  • Nov 14 2020 12:15
    jpmonettas commented #34
  • Nov 14 2020 12:14
    jpmonettas synchronize #34
  • Nov 14 2020 00:59
    metasoarous commented #34
  • Nov 14 2020 00:58
    metasoarous commented #34
  • Nov 14 2020 00:57
    metasoarous commented #34
  • Jul 22 2020 12:14
    jpmonettas commented #34
  • Jul 21 2020 21:34
    metasoarous commented #34
  • Jul 11 2020 13:34
    jpmonettas synchronize #34
  • Jul 07 2020 12:12
    xlfe commented #35
Christopher Small
@metasoarous
So you have to require reagent separately if you want to use the reagent namespace
javier abanses
@nrfm
thanks! makes sense. Gonna play around with it and see what i come up with.
Christopher Small
@metasoarous
@nrfm Wonderful! Let us know if you have any questions!
javier abanses
@nrfm
@metasoarous My slow brain will certainly need some guidance. I haven't traveled much in macro land!
What branch should i work off ? I am getting a bunch of errors when compiling from the master branch? this one is the first that pops up, it seems aget is missing an argument.
Christopher Small
@metasoarous
It is worth checking with @alexandergunnarson about branch and stuff, since he was most recently working on things
javier abanses
@nrfm
@metasoarous thanks!
Hi @alexandergunnarson, I am getting a few errors when compiling from master first one is this one , could you give me some orientation on which branch is best to work off? thanks!
Christopher Small
@metasoarous
@nrfm Can you also tell us what macro you're looking at?
javier abanses
@nrfm
posh.lib.ratom/ aget* is the first one that cursive complains about in the master branch. It is being called with 1 argument in the cljs version as per the link above
javier abanses
@nrfm
@metasoarous cljs.core/aget inside aget is being called with 1 argument, not aget itself. the java .get method is getting both arguments passed to aget*
Christopher Small
@metasoarous
Ah; OK. Gotcha. Thanks.
I can't look at that right now, but that will help once I or someone else does have the time to
Keep us posted!
javier abanses
@nrfm
no worries, gonna see where i get with it. fixed a few things already. will report back
Christopher Small
@metasoarous
Good stuff! Cheers!
javier abanses
@nrfm
@metasoarous @alexandergunnarson got it compiling now.
Christopher Small
@metasoarous
Oh! Great! What was the deal?
javier abanses
@nrfm
that aget call missing an argument was breaking compilation. I just fixed that and compiles ok with some warnings that i am looking into now.
Use of undeclared Var posh.lib.ratom/array at line 202 src/posh/lib/ratom.cljc is an example.
they seem to originate from the if-cljs macro. investigating now, need some coffee to un-bend mi mind :)
Christopher Small
@metasoarous
Ah; I see. Good catch; Thank you!
Heh; macro recovery
javier abanses
@nrfm
@alexandergunnarson @metasoarous how do i go about running the tests? I have never run tests in cljc and when running lein test all the tests get run for clojure ok, but the ones in :cljs conditionals get ignored. thanks!
Christopher Small
@metasoarous
@nrfm I haven't done any testing with posh; I would check with @mpdairy. He hasn't been working with the library so much lately, but I believe he set up all the testing stuff.
javier abanses
@nrfm
@metasoarous thanks!
Brian Marco
@bamarco
Anybody that was interested in a rum plugin I wrote a potential roadmap here: mpdairy/posh#27
Matt Parker
@mpdairy
@nrfm Hey, I never set up any tests, @alexandergunnarson set up some for his ratom stuff. I don't think they cover much of posh though
Christopher Small
@metasoarous
@mpdairy Thanks!
Brian Marco
@bamarco
@mpdairy @metasoarous I'm trying to understand how the graph is related to the pull analysis. Could somebody explain the basic strategy for how the caching is done? I want to know if I can do the same thing with an onyx compute graph without state (or less state). Like if I have a tx-report can I decide which ratoms should update directly?
Christopher Small
@metasoarous
The graph structure has a cache of active queries, and on transaction, it goes through all the queries and runs a pattern match against the cached structure, and decides whether to rerun the actual query. I don't recall the details of how things are structured though.
If you do some pprints as things flow through, you should get a better sense though.
Brian Marco
@bamarco
That sounds like I could then. I want to stop all the listener business and subsume that into the compute graph. And I might be able to pass the cache as a value too if I can't drop it entirely. Not sure if it's worth the time at this phase.
javier abanses
@nrfm
@mpdairy thanks!
Baruch Berger
@bbss
I'm trying out posh, but getting an error when using pull:
plugin_base.cljc:77 Uncaught TypeError: Cannot read property 'call' of null
    at posh$plugin_base$get_db (plugin_base.cljc:77)
    at Function.posh.plugin_base.pull.cljs$core$IFn$_invoke$arity$5 (plugin_base.cljc:127)
    at posh$plugin_base$pull (plugin_base.cljc:123)
    at Function.posh.plugin_base.pull.cljs$core$IFn$_invoke$arity$4 (plugin_base.cljc:136)
    at G__10150__3 (core.cljs:4148)
    at G__10150 (core.cljs:4149)
maybe this warning I get during compilation has something to do with it:
WARNING: Wrong number of args (1) passed to posh.plugin-base/missing-pull-result at line 20 resources/public/js/compiled/devcards_out/posh/plugin_base.cljc
WARNING: Wrong number of args (1) passed to posh.plugin-base/missing-pull-result at line 22 resources/public/js/compiled/devcards_out/posh/plugin_base.cljc
WARNING: Wrong number of args (1) passed to posh.plugin-base/get-db at line 127 resources/public/js/compiled/devcards_out/posh/plugin_base.cljc
Brian Marco
@bamarco
@bbss Can you show your call to pull in your code and your ns?
Baruch Berger
@bbss
@bamarco sure, thanks
(ns korean.cljs.quick-word
  (:require
   [korean.cljs.training.training-component :refer [typing-field matched-text]]
   [datascript.core :as d]
   [reagent.core :refer [as-element] :as r]
   [posh.reagent :refer [pull q posh! transact!]]
   [cljs-react-material-ui.reagent :as ui]
   [cljs-react-material-ui.core :refer [get-mui-theme]]
   [cljs-react-material-ui.icons :as ic])
  (:require-macros
   [devcards.core :as dc :refer [defcard deftest]]))


(defn quick-word-component
  [state db]
  (let [current-typed (r/atom "")
        results (r/atom {})
        challenge (next-challenge (expression-couples-by-levels db))
        show-tip (r/atom false)
        [from to] (first challenge)
        from-text (:expression/korean (pull @db '[:expression/korean] from))
        to-text (:expression/english (pull @db '[:expression/english] to))]
    [:div ..etc..]))
Baruch Berger
@bbss

and

(def db
  (d/create-conn {:translated/english {:db/cardinality :db.cardinality/many
                                       :db/valueType :db.type/ref}
                  :translated/korean {:db/cardinality :db.cardinality/many
                                      :db/valueType :db.type/ref}}))
(posh! db)

for what it's worth. That doesn't throw though.

Brian Marco
@bamarco
@bbss posh calls to pull and q take the whole conn not just the db. Try removing the derefs. So it says db instead of @db
Baruch Berger
@bbss
@bamarco yes, forgot to change it back, I tried like that initally. Same problem.
Brian Marco
@bamarco
@bbss You also need to 'deref' the pull call itself. So @(pull ...)
Baruch Berger
@bbss
well the error already occurs when calling pull
Brian Marco
@bamarco
Do you have a pull by itself? Because you are immediately calling a keyword property on the result.
Baruch Berger
@bbss
no, the pull didn't succeed, this would work with a normal pull though.
Brian Marco
@bamarco
Posh pull returns a ratom not an entity.
Baruch Berger
@bbss
yes, I understand that. But posh pull is the thing that errors so we aren't there yet :D
Baruch Berger
@bbss
but your point about taking the conn, not just db makes me think maybe it's got something to do with devcards
Brian Marco
@bamarco
That's all I got. Good luck though. :smile:
Baruch Berger
@bbss
Okay, thanks for the input :D
posh looks pretty awesome :)
was doing a kind of full rerender approach before, but I think reactive q and pulls will be a lot cleaner/faster
Brian Marco
@bamarco
Yeah, it def cuts down on reloads.
Baruch Berger
@bbss
Hmm, I don't get the same error anymore. I think it's because of the order in which I required..