Fork me on GitHub
#fulcro
<
2020-05-25
>
murtaza5211:05:13

com.fulcrologic.fulcro.data-fetch/load!it takes a class or factory. My class has nested components, and I want to only load the top level component, how do I do that ? is there a way to just specify an eql query / ident, instead of a component ?

codonnell11:05:37

You can create a separate component with whatever you'd like to load and pass that.

codonnell11:05:54

Fulcro needs the component definition(s) to know how to normalize the results.

murtaza5212:05:12

@codonnell thanks, I also found load-fields! , I assume that should also do the job.

codonnell12:05:12

Didn't know about that, but it sounds promising!

roklenarcic13:05:17

I have a question about returning values from remote transactions. Let’s say I have a server-side mutation resolver that returns a list of items, but I would also like to return tempid mappings… how do I do that? The data types clash (I cannot add temp-ids key to a vector.

codonnell14:05:21

I've always returned maps from remote transactions. Didn't even know it was possible to return a vector.

codonnell14:05:30

Can you not return a map?

roklenarcic19:05:21

well the value I’m loading is a list, but I can wrap it into a map

👍 1
murtaza5214:05:03

in the rad-demo I see the seed data for the entities have both :db/id and an entity id ex :invoice/id, why do we need both ? Isnt just the :invoice/idenough for resolution ?

zilti14:05:34

:db/id is the id for the Datomic datum, :invoice/id is the invoice id. If anything, you could do without :invoice/id

zilti15:05:38

It is basically a slight abstraction from the database internals, since :db/id is technically an internal thing of Datomic

murtaza5215:05:00

yes but datomic assigns :db/id if it is not specified, so is there a specific reason that fulcro is specifying it ? does fulcro-rad use the :db/id when it generates the resolvers ?

zilti15:05:51

Assigning a temporary id to it allows you to add refs to specific datums without committing to the db first

zilti15:05:38

Pretty sure fulcro-rad-datomic doesn't care about the :db/id as long as you don't define it as the primary index of an entity

murtaza5215:05:33

@zilti thanks, that explains it.

👍 1
zilti15:05:47

I have a question as well now. I placed an svg into resources/public/images. Trying to access it via the browser only returns ["^ "] though... I have never seen that before with Ring. Is there something Fulcro-specific going on here?

holyjak20:05:39

That looks perhaps like transit-encoded empty value?

codonnell15:05:03

That really depends on how your ring handler is set up, not anything fulcro-specific.

zilti15:05:30

I left it as-is from fulcro-rad-demo

codonnell15:05:00

Looks like that's set up for some kind of blob storage for urls starting with image/.

zilti15:05:33

That is commented out though

zilti15:05:40

I guess it is a mime type issue

codonnell15:05:38

That's possible. Based on your comment above it looks like you may be getting transit back.

zilti15:05:45

Ahh it is being served as "transit+json" yes

zilti15:05:10

Aghh, it is already configured to statically serve the contents of /resources/public... Seems like it doesn't do it for all file types

zilti15:05:58

Yes, png works fine. svg fails

murtaza5216:05:16

What is the purpose of com.fulcrologic.rad.attributes-options/targetwhen used for :reftypes ? I thought it was being used for generating resolvers, but that doesnt seem to be the case.

zilti17:05:05

I've just been wondering... do I get any functional advantage (or lines-of-code advantage) from using Semantic UI React components over just using plain Semantic UI?

tony.kay20:05:31

@zilti I do not use any Semantic UI React components unless they provide real logic (i.e. Dropdown). If I just want something like a grid or table, I just use the the CSS classes. It is less hassle, less overhead, etc.

holyjak20:05:45

Same here. I have used eg the Popup component because of its behavior.

tony.kay20:05:42

if you want a LOC advantage, make your own functions or macros…i.e. we have a divs macro that takes a sequence of class kws, and results in nested divs:

(divs :a :b :c ...) => (div :a (div :b (div :c ...)))

tony.kay20:05:39

@murtaza52 look through the source of both RAD the Datomic adapter, and RAD semantic UI. I don’t remember off the top of my head everywhere it is used, but it is important to know what kind of thing a ref points to in some situations.

murtaza5221:05:49

If I want to see the pathom path taken to resolve a given eql query, how do I do that ?

mruzekw21:05:08

Does fulcro-garden-css work with React Native?

mruzekw21:05:29

(I'm technically using react-native-web but same API as far as I'm aware)