Fork me on GitHub
#fulcro
<
2020-06-17
>
bbss04:06:01

@zhuxun2 interesting start of discussion, not really sure about why it's designed like that. I'm guessing mostly because it wanted to stay close to datomic pull syntax. There are also #eql and #datomic where there could be people who know the answer to that šŸ™‚, just noticed you already posted to #datomic..

murtaza5206:06:29

also I assume EQL started with a separate library pathom, which was developed independently of fulcro.

aratare08:06:15

hey guys, how would one test out server-side mutations in the REPL? I'm following through the dev guide and most commands involving api-parser ... are queries to fetch data. The closest thing I've found is comp/transact!, but given that it requires this I assume that's for the client-side? Say I have an entity ready to go, how would I test a mutation with it on the serverside? Thanks in advance.

strsnd10:06:24

@rextruong I test them in the server-repl as well by invoking the pathom parser manually

aratare14:06:41

ok so I just found out about api/parser [(ns/mutation ...)]` and now things are working šŸ‘Œ Thanks a lot šŸ˜„

tony.kay14:06:01

@mruzekw 3.2.11 is on clojars with your electron fix

tony.kay14:06:01

@murtaza52 @zhuxun2 EQL stems from Datomic pull, and then into Om Next where it was adopted by Untangled (the prior name of Fulcro) and Pathom. Wilker and I made EQL as a formalization of that syntax. We were not involved in its design, only a standardization because we were both trying to build tools for Fulcro that would work together using the same algorithms.

šŸ‘ 6
zilti16:06:03

I am not sure how to solve this... I made a component that is a dropdown, but since I have to initialize it in a function (to be used as a field-formatter in a RAD report) I don't know how to make sure it gets access to the global state/props/everything

tony.kay16:06:38

see hooks and floating roots. RAD using the floating-root renderer already

tony.kay16:06:05

There is a demo in Fulcro that shows a GCā€™d component that is probably perfect for thisā€¦see https://github.com/fulcrologic/fulcro/blob/develop/src/workspaces/com/fulcrologic/fulcro/cards/multi_root_cards.cljs#L25 @zilti

tony.kay16:06:58

if you have a lot of rows that could get expensive. In general Iā€™d recommend that a row-based component be a plain react component that does not use app/state/props/everythingā€¦just pass it props that are available from the row itself

tony.kay16:06:52

you can transact against the report instance, so I would try to avoid the weight of making it a fully integrated component

tony.kay16:06:48

if you feel like you MUST (i.e. you need to load the picker options based on row content), then you should also be normalizing and caching those options so that each row isnā€™t a huge hit

zilti16:06:51

Transact against the report instance? How do I then ensure that my component gets to see that?

tony.kay16:06:04

I have no idea what that questio nmeans

zilti16:06:52

Now I instance whatever component for the field formatter. How does that component get to see the changes?

tony.kay16:06:12

what do you mean? It updates when the row updates. I assume your transaction is changing something with respect to the row content?

tony.kay16:06:08

remember that the core purpose of RAD reports (at least in this alpha stage) is the DISPLAY of report data with some simple actions. Your escape hatch is to start controlling more and more yourself. If you need complex cases your gradual escape hatches include: 1. what youā€™re trying: formatters/controls. These may require advanced knowledge of React, Fulcro, etc in order to do advanced things, and have certain limitations because of the limited context. 2. taking control of the row by defining a row component 3. taking control of the logic of the entire report by changing out the state machine 4. taking control of the entire report rendering by adding a body to the report 5. Replacing the report with a hand-written Fulcro component. (5) will always give you absolute control (since RAD isnā€™t even involved really). 1-4 require you understand things, which will probably require (at the moment) for you to read the source and comprehend it, along with understand Fulcro. Iā€™m not making ā€œVisual Clojureā€ here. Iā€™m making something for expert users that want to avoid hand-writing the ā€œsimple stupid stuffā€, like database I/O screens. If it evolves into something more than that, great, but that is v1's MVP

zilti17:06:07

No, the transaction doesn't change something with respect to the row content. It is supposed to load autocomplete stuff for a dropdown component to be displayed as field formatter. But even when transacting straight to the detached component, that component won't see the value.

tony.kay17:06:40

best solā€™n is what I said earlier: floating root (if you want to stay in RAD)

zilti18:06:52

Okay. Will look into floating roots then, thanks!