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
Petrus Theron
@theronic
Any update on Rum support for Posh? :) Posh is the last thing keeping me on Reagent
Christopher Small
@metasoarous
@theronic I don't think anyone has done this yet, but there was a bunch of refactoring that extracted most of the stateful bits of things so that someone could add a rum plugin fairly easily. If you're interested in hacking on that, I'd be happy to point you in the right direction there.
Brian Marco
@bamarco
@theronic i also put a ticket describing what I think needs to take place to make it happen.
Matt Parker
@mpdairy
does anyone want to help me set up posh to automatically compile and do a new release to clojars whenever master changes? I tried before but I couldn't get the auth working.
Camilo Roca
@carocad
@mpdairy I have an auto deploy config with travis ci for one of my projects. I didnt setup the auto deploy myself but I think that the file is pretty self-explanatory. The only things that you would need to change are the your encripted env vars and your release config in project.clj. Links below
Matt Parker
@mpdairy
@carocad thanks! that's just what I needed
Petrus Theron
@theronic
Is there a Leiningen template for a quick blank reagent+datascript+posh project?
Brian Marco
@bamarco
Best I know of is to use lein new chestnut <app-name> -- --reagent then add the posh depency manually.
This message was deleted
eoliphan
@eoliphan
Hi, I'm trying to get re-posh working with my app, but my pretty simple req-query-sub seems to be causing an "Assert failed: (db?db)" exception. Not sure what's going on. I was pulling in the datascript conn via mount, removed that, still have the problem, and did some mucking around and determined that calling connect! without a valid conn, throws an assertion there. So it seems like as of connect! things are fine. unfortunately the stack trace isn't really helping me figure out whats going on. I tried the query with and without ':in $' to no avail
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