Fork me on GitHub
#fulcro
<
2017-08-22
>
gardnervickers01:08:39

Wow thats incredible, envious I wasn’t in the eclipse path 😄

gardnervickers01:08:30

What ended up being the issue here? https://github.com/fulcrologic/fulcro/issues/13 We’re having some trouble adv. compiling our Fulcro app, just wanted to get some more data points.

tony.kay05:08:47

@gardnervickers Specifically: Om Next has a hacky thing it does to the actual clojurescript compiler. The call to set-refresh-dirs! causes code reload, but I guess in a different order or something. So, the om next hack gets applied, and if dev is on the classpath then that triggers a reload that reloads the compiler code which overwrites the hack. So, making sure set-refresh-dirs doesn’t get called is essentially the fix. In truth, not hacking the compiler would be a better fix. I opened an Om issue, but it’ll have to be analyzed to look for a better soln

claudiu06:08:51

@tony.kay Was looking over the recipe for pagination. Is there a recommended approach for getting the count ?

claudiu06:08:11

Also regarding pagination approach my first thought was to just, have current-page, load, and just keep all in :page/items filtering in the view based on current page. Is this also a valid approach ?

claudiu06:08:02

without the count, seems likely that I might trigger load and have no elements to load. Only solution that comes to mind is to always require a extra element, and based on the number returned decide in the post-mutation if a new page is available,.

tony.kay06:08:25

@claudiu Well, it’s your data. Pagination over a large set is a hard problem, unless you use something like Datomic (where you can use the same database as-of when you started paginating without cost). Otherwise the count could change on the server. Also, the page boundaries could need to change. Kind of up to you to design it so it works acceptably given your database and other constraints. The demo just shows you the basic calls you’d make. Structure the data however you like.

tony.kay06:08:51

If you mean “can I load them all and then paginate”: of course

tony.kay06:08:00

assuming the list is tractable in size

claudiu06:08:07

ahh oky cool. Mysql & google datastore, for most of my projects. 🙂

claudiu06:08:11

Don't think it's doable to load all, usually work on projects with large datasets.

claudiu06:08:21

I don't mean "load them all". Just to keep them in :article/list insted of :articles/by-page and based on the current page filter and just if I'm on page just show 10-20. Loading page 2-3 would be done with filtering by > last_id, and if I get 11 results I know that I have more that I can load.

tony.kay06:08:55

sure. anything like that

claudiu06:08:44

Will give it a try tonight. Thought I'd ask since I always get the impression that most of my old habbits, don't really fit into clojurescript & fulcro that well, and usually there's a nicer way of approaching things 🙂

tony.kay06:08:43

yeah, there is a lot of unlearning to do…but then sometimes your existing knowledge is perfectly valid. It throws you off balance for a while when you switch

tony.kay06:08:01

until you learn what to trust again

claudiu06:08:41

thank you 🙂 Core concepts part 1 is amazing (kinda feel silly that I struggled a bit with the concepts). Really looking foreword to the second part. 🙂

tony.kay19:08:52

@claudiu It’s different. I have the same thought now that I’m used to it: it’s sooooo simple. But when it is foreign it takes a bit. I think seeing the graph in action really helps, so the videos are a powerful tool to explain that.

currentoor19:08:54

@tony.kay is there a reason why you’re passing in (-> env :ast :key) as the second argument to read-* instead of the k that’s passed in? https://github.com/fulcrologic/fulcro/blob/develop/src/main/fulcro/server.clj#L573

currentoor19:08:13

I was writing a spec that calls server-read and for a while I couldn’t get why I was getting dispatch value NULL error 😅

tony.kay19:08:37

because on an ident-based query k will be (first ident) which is a keyword and I need to know if it is truly an ident.

tony.kay19:08:50

log the value of k and the vallue of the ast key. They are different

tony.kay20:08:03

pretty sure. If I’m wrong please correct me.

currentoor20:08:50

yeah @tony.kay you were right they are different, just checked

tony.kay20:08:01

thought so 🙂

nickowsy22:08:15

we just migrated from the untangled-client to fulcro. With untangled, we were setting pathopt to true

(defonce app
         (atom (uc/new-untangled-client
                :pathopt true
                :started-callback started-callback)))
. I'm having trouble finding how to set pathopt when calling
(fulcro.client.core/new-fulcra-client ...)

tony.kay22:08:51

you pass it as a normal reconciler option now

tony.kay23:08:03

:reconciler-options {:path-opt true} I think it is

nickowsy23:08:12

sweet, thanks tony. I'll pass that in.