Fork me on GitHub
#fulcro
<
2020-05-30
>
jaide00:05:43

Can you still leverage the great things that fulcro offers if your backend is written in Python or F#?

currentoor02:05:49

with a pathom parser running in the client you can wrap any backend API (REST, graphQL, etc) with an eql interface that works perfectly with fulcro

parrot 12
jaide02:05:09

Excellent! Thanks.

murtaza5213:05:00

While using a defsc-report component, in one of the mutations I am optimistically dissoc a row from the table. This does not force the report to rerender, just the data in that row of the report disappears, while the row controls still showing up.

murtaza5213:05:00

I am able to force a rerender using control/run!, however there is a lag between the state ap being updated and the run!, so for a sec the row without the data is visible in the report.

murtaza5214:05:00

Only running control/run!solves it, however ideally I dont want to run it, as I dont want to load the data from the server, just want my dom to reflect my local db, which is not happening.

murtaza5213:05:39

I wanted to use the confirm box , not able to find it in the semantic-ui-wrapper, not sure if I am looking in the right place.

murtaza5215:05:08

In my rad form when I save the entity, it redirects back and forth between the form and report screen multiple times, and then shows the report screen. This is the error is prints on the console -

core.cljs:159 ERROR [com.fulcrologic.fulcro.routing.dynamic-routing:188] - dr/target-ready! was called but there was no router waiting for the target listed:  [:com.fulcrologic.rad.report/id :jra.ui.farm/AccountList] This could mean you sent one ident, and indicated ready on another.
Also these warnings are printed on the screen -
core.cljs:159 WARN [com.fulcrologic.fulcro.ui-state-machines:692] - UNEXPECTED EVENT: Did not find a way to handle event :event/set-ui-parameters in the current active state: :state/loading
core.cljs:159 WARN [com.fulcrologic.fulcro.ui-state-machines:692] - UNEXPECTED EVENT: Did not find a way to handle event :event/run in the current active state: :state/loading

myguidingstar17:05:46

@jayzawrotny off the top of my head, these are several things to keep in mind when your server is not clojure: 1. Ensure all entities have ident key if you want them to be normalized 2. Client side are async code, so be prepared to deal with that 3. No tempids; mutation returning values can be hard or even impossible. Anyway, I believe all the greatness of (client part of) fulcro and pathom is still worth it

jaide17:05:36

Good to know, thanks.

Chris O’Donnell18:05:33

@U0E2YV1UZ Why do you say no tempids? If you have a standard REST API where POST requests return the created entity, shouldn't the client-side mutation be able to construct a tempid map and return it? I know I implemented tempids with client-side pathom in a fulcro 2 app backed by a graphql API using a parser plugin.

myguidingstar18:05:12

@codonnell you're right. I remember it wrong, it was just possibly more roundtrips with tempid compared to pathom in the server sude

currentoor18:05:25

@U0E2YV1UZ why do you say no mutation return values? I don’s see how that would be any different?

currentoor18:05:13

the only difference i see is it will probably multiple round trips since the parser is in the client, whereas if it was on the sever it would all be done in one

myguidingstar18:05:48

The same mistake I had with tempid, thanks for pointing it out

jaide19:05:55

Are there any guides or examples of code splitting\lazy loading components with Fulcro? The example in the docs seems to suggest it's lazy loading content vs another component, bundle, or styles.

tony.kay19:05:51

The book used to have a code splitting example, but I have not updated that section for F3. Basically code spliting is mostly a cljs feature you have to understand. The Fulcro part is just that you either need to use a floating root, or a dynamic query to compose that newly loaded component into the tree

jaide02:05:19

Thanks very much. Backing up a bit, if you were going to build a PWA in ClojureScript. Would you use lazy loading? I presumed it would be necessary to hit the performance requirements to be installable but maybe it's more about loading something with server-side rendering than strictly the JS bundle?

tony.kay05:05:41

So, my experience is that when using cljs your minimum bundle size is somewhat large compared to the application bits (unless it gets to be a rather large app). You really need a lot of user code before code splitting brings much of a speed win, and it hurts you in complexity. I would suggest that you play with code splitting from a “measurement” perspective early before you settle on a design: see what your production build artifacts look like.

jaide17:05:26

That's a very good point. I think when you use something like Lighthouse to validate a PWA it's measuring the time between server response and when seemingly meaningful\interactive content is accessible.

tony.kay19:05:59

It would not be terribly hard to expand dynamic router to understand code splitting so that routes could be auto-loaded as you go to them.

tony.kay19:05:17

but no, I’m not aware of any OSS examples at the moment

daniel.spaniel22:05:51

Tony .. I am having a few issues with guardrails on UI side these days. I getting this error

daniel.spaniel22:05:54

core.cljs:159 ERROR com/fulcrologic/fulcro/algorithms/form_state.cljc:182 add-form-config*'s argument list
 -- Spec failed --------------------

  [... #object[Component [object Object]] ...]
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

should satisfy

  component-class?

-------------------------

daniel.spaniel22:05:47

the thing is wants as a component class I am passing in a component instance .. so wonder why its barfing

daniel.spaniel22:05:17

i think it wants a class and not instance .. but how to get that class from the instance

Chris O’Donnell23:05:03

@dansudol I'm not sure if you can get the class from a component instance, but I'm not sure why you need to. Can you not pass the class to wherever you're calling add-form-config*?

Chris O’Donnell23:05:33

I believe this approach is mentioned in one of the videos.

daniel.spaniel23:05:27

I could @codonnell and mostly I am doing that . but was trying to be slick I guess .. reverting to just regular passing the form now so good point

tony.kay23:05:29

@dansudol (react-type instance)

tony.kay23:05:44

or just literally pass it the symbol of the class

tony.kay23:05:18

probably should add an alias for that so it is easier to find