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
eoliphan
@eoliphan
figured it out, but not sure what the problem is. When I got rid of the pull, everything was ok. But I'm not sure why pull isn't happy. been over the DS, etc docs and it seems like it should
(reg-query-sub
  :cur-form-def
  '[:find (pull ?e [*])    
    :in $
    :where
    [_ :designer/cur-form-id ?id]
    [?e :form/id ?id]
    ])
Oliver Rolle
@orolle
Pulls all fields of an entity via (re-frame/subscribe [:subs/pull entity-id])
(re-posh/reg-pull-sub
 :subs/pull
 '[*])
Petrus Theron
@theronic
There are two problems in Reagent land I keep running into: I forget to update Form-2 component arguments, and I can't get posh to re-render things when I expect to. I want to display the entire the posh db at the bottom of my page so see what's going on. I can never remember when I should deref conn or not. Why doesn't [:code (pr-str @conn)] inside my root component re-render on every db change?
Denis Krivosheev
@denistakeda
@theronic I can be wrong but I suppose that connection is just a regular clojure atom. Reagent doesn't rerender component for regular atom, only for reagent/atom. At the same time q and pull return reagent atom and it works as expected.
Petrus Theron
@theronic
@denistakeda thanks, that probably explains it. How do I get a component to re-render on any change to conn's db?
Denis Krivosheev
@denistakeda
I don't know the easy way to do so. The first idea is to add watcher to this atom that triggers force rerendering of the root component.
But wait a little bit. Maybe somebody else has a better idea
Brian Marco
@bamarco
https://github.com/bamarco/onyx-sim/blob/master/src/cljs/onyx/sim/core.cljs using make-reaction like i do in debug-conn here will work. Haven’t really stress tested it though might just be getting lucky. If you want to be more efficient you could rig up a listen! on the conn.
Oliver Rolle
@orolle
Does posh support running the query execution in a web worker? I have small lacks in my UI and I think about putting the heavy work into workers.
Christopher Small
@metasoarous
@orolle Not at present. I did some preliminary work trying to get it working, but couldn't quite sort it out. In theory it should be possible, as long as you're not putting functions or anything weird in your db. We are looking at the possibility of putting this in datsync fwiw.
Brian Marco
@bamarco
@mpdairy @metasoarous I've got rum working for the most part with posh. I needed to understand posh internals better and this seemed like a way to kill two birds with one stone. Only thing not quite compatible is that rum derived-atoms have no :on-dispose.
Brian Marco
@bamarco
well it almost works. still something not quite right with derived-atoms updating.
Christopher Small
@metasoarous
@bamarco Awesome!
Is the remaining issue that it won't garbage collect properly/automatically?
Brian Marco
@bamarco
the :on-dispose issue is related to that. The worse problem is that make-reaction is not updating period. If you use the atoms directly it works, but not inside a derived-atom.
I fixed a small bug that was hiding the big one from me.
It may only be a problem with nil starting values. haven't tested yet because all my code in onyx-sim is re-com based and not rum compatible
I also tried using build-defc from rum, but couldn't get that to work either.
Brian Marco
@bamarco
Okay I found a fix, but now I need to test to make sure I didn't break the reagent plugin. It'll have to be tomorrow
Christopher Small
@metasoarous
Awesome man! Thanks for working on that!
Brian Marco
@bamarco
Got it tested will push to my pr after i get wifi back
Brian Marco
@bamarco
Okay. The pr is in good shape except for the comment by @alexandergunnarson. The only reason I made any changes to posh.ratom at all was because it was putting errors and warnings in my figwheel project.
Anybody know the right fn call for array? mpdairy/posh#30
Brian Marco
@bamarco
@alexandergunnarson I think I figured out the issue. The if-cljs macro may be functioning off a little bit. Testing to see if that's the problem now.
Brian Marco
@bamarco
Nope just needed to fully qualify the name cljs.core/array works
Okay rum support pr should be good to go now
Christopher Small
@metasoarous
Dope!
Brian Maddy
@bmaddy
Is there a way to do a pull-all in posh? I'm trying to write a pull-all version of this: https://github.com/denistakeda/re-posh/blob/master/src/re_posh/subs.cljc#L16
Mapping over ids with p/pull gives errors. I suspect because it returns a reaction (which I don't really understand yet).
Brian Marco
@bamarco
@bmaddy try using deref after each individual pull (add it to your mapping function). This will give the value for the reaction. You may need to wrap the whole thing in a reagent.core/make-reaction function if re-posh isn't doing that automatically where you are calling the derefs.
Brian Maddy
@bmaddy
Awesome, that totally worked @bamarco, thanks!
(defmethod re-posh.subs/execute-sub :pull-many
  [{:keys [pattern ids]}]
  (reaction
   (mapv #(deref (p/pull @re-posh.db/store pattern %)) ids)))
Tyler Tolton
@Defunctionalize

okay! So, I'm starting out with dat[ascript|omic] for the first time via re-posh and it's terrifying! I don't know how doing things works :sweat_smile: :

okay, so I have the following value in my app-db:

@re-frame.db/app-db
=> [{:db/id -1, :app/type :type/account, :account/balance 800}]

and I made a subscription like so:

(rp/reg-sub
  :account-balance-id
  (fn [_ _]
    {:type :query
     :query '[:find ?id .
              :where [?id :app/type :type/account]]}))
and, firstly, it seems to be getting nil. secondly, I have no idea what the dot in :find ?id . is for. I just copied it from the todomvc
I just don't understand enough about the workflow to debug and troubleshoot. :/
Tyler Tolton
@Defunctionalize
figured it out. sorry for the newb question. I was dispatching using the reframe reg-event-db function.. :sweat:
Tyler Tolton
@Defunctionalize
This message was deleted
Brian Hurlow
@bhurlow
Hello Posh folks! Apologies if this topic is ongoing somewhere else, but I wanted to check and see if anyone has any progress on the combining client queries into a "scoped" datomic view? as outlined in this thread: mpdairy/posh#3 I'm curious if anyone has attempted to analyze the query data to produce a set of datoms suitable for bootstrapping the datascript client :fishing_pole_and_fish:
Will
@Lokeh
are there any examples of plugins for other view frameworks? e.g. rum, quiescent, etc.
Christopher Small
@metasoarous
@lokeh To my understanding there is a rum plugin, or at least some work on one, but it may still be under code review. Check the PRs and issues. Would love to see a quiescent binding.
Brian Marco
@bamarco
@Lokeh I wrote a rum plugin. There were a few bugs with it. I’ve fixed most of them, but haven’t had time to test them to make sure the fixes didn’t introduce new problems. I was also working on a refactor to make the plugin process more robust (the combination of libraries is going to become burdonsome without a more generic way to bind libraries) but I think my solution was too complex so I have abandoned it for now (I think the latest version of spec will address some of these issues)
Tyler Tolton
@Defunctionalize
Is there like, a whitepaper on the concept of pattern matching event data to determine if a subscription needs to be updated? The concept seems so incredibly valuable I'm surprised it isn't discussed more
Christopher Small
@metasoarous
Differential datalog
Tyler Tolton
@Defunctionalize
holy crap, thats amazing
this could be really awesome
Christopher Small
@metasoarous
Yes, and this has been worked on now in Rust, with a Clojure API: https://www.youtube.com/watch?v=ZgqFlowyfTA
drew
@drewverlee

Greetings, hopefully this is the right place to ask this type of question, otherwise i would be happy to move the discussion else where.

Anyone want to try their hand at comparing re-posh (or maybe just posh) to Fulcro? As a starting point, im trying to understand why Fulcro isn't taking advantage of Datascript. The only comment i can find on the subject dates back a year ago when i specifically asked about it on reddit and the short answer was "performance, maybe".

In a larger sense, i see both approaches as very similar in nature. With the key being that client Db is a materialized view of your persisted database. Assuming we have reactive datalog (do we? whats the state of that???) Then i'm some what confused we weren't just building systems that look like datomic queries with some html around them.

In approaching this, im reading through the docs for a lot of projects and i assume ill be doing spikes in them as well as diving into code. None of this is meant to lessen the work anyone is going, rather i assume there are very real trade offs in each approach that matter and mostly this is trying to ferret out the differences because im assuming there enlightening!

Christopher Small
@metasoarous
A big difference is that Fulcro is Om based, while Posh's main API is reagent based (though there's a rum plugin as well, and in theory it could be redesigned to work with om as well).
We do sort of have true reactive datalog via 3df now, but it is mainly designed for running with datomic on the JVM for now. The main obstacle to using on the browser is that the 3df implementation is written in rust (timely dataflow). I've heard tell that this has been successfully compiled to web assembly, but I have yet to try this myself, and have no idea what the distribution details look like there. So for now, assume that this is just going to be useful on the server, and that Posh's query filters are probably the best you're going to get for the moment.
Christopher Small
@metasoarous
Also note that because 3df is rust, you can't do reactive queries that require calling functions, because these would need to run in rust. So even on the server, with 3df, we're going to be a little limited about what we'll be able to do fully differentially.