Fork me on GitHub
#fulcro
<
2020-08-03
>
lgessler02:08:02

nvm, looks like using component options is the preferred way for uism's to get information about specific components

felipethome15:08:19

Hi! We are having an issue when using Fulcro 2.8.13. The problem is that sometimes our interface is not being updated after changing the db (it is a very intermittent issue). In particular we are noticing the problem when using the markers table. After the load finishes the interface doesn’t get updated to remove our “loading” component. We use more than one Fulcro app per page because our tool was written in Re-frame and we are migrating it to Fulcro, so we create a new app for every part that we are migrating until we are ready to use only one. After some debugging it seems we have a concurrency problem. Sometimes the p/reconcile! function is not being called. We believe the problem may be here: https://github.com/fulcrologic/fulcro/blob/6f331083c5dfe6edf47fa8bf8f37be3bb2c50ad6/src/main/fulcro/client/primitives.cljc#L1856 and here: https://github.com/fulcrologic/fulcro/blob/6f331083c5dfe6edf47fa8bf8f37be3bb2c50ad6/src/main/fulcro/client/primitives.cljc#L1852 That is because the Throttle is not app specific and because requestAnimationFrame is not guaranteed to be called in the next frame. So we changed the Throttle to exist by reconciler and the requestAnimationFrame to be called inside another requestAnimationFrame. @tony.kay do you think that makes sense?

felipethome15:08:44

#?(:cljs
   (defn -queue-render! "PRIVATE."
     [f]
     (cond
       (fn? *raf*) (*raf* f)

       (not (exists? js/requestAnimationFrame))
       (js/setTimeout f 16)

       :else
       (js/requestAnimationFrame
         (fn []
           (js/requestAnimationFrame f))))))

#?(:clj (defn schedule-render! [r] :noop)
   :cljs
        (defn schedule-render! [reconciler] (.fire (get-in reconciler [:config :throttle]) reconciler)))

tony.kay16:08:14

F2 had some general internal issues with corner cases like this. Neither F2 or F3 guarantee a UI update based on db changes. Fulcro is a transaction-centric system. I no longer have time to maintain F2. Either port to F3, or maintain a fork with your own fixes.

felipethome16:08:45

We have been migrating to Fulcro 2 for almost 2 years now, it will be difficult to justify the need to port to F3 at this moment. If I sent the PR any chance that you could publish a patch version?

tony.kay16:08:42

yes, I can do that