fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
hadils 2021-02-17T00:04:59.426800Z

N00b question. I have created an unholy alliance between fulcro-rad-demo and the React Native demo code. I have jumped through several hurdles already but my EQL and Pathom skills are in their infancy. I do not understand why the below query is causing the RAD demo parser to throw an exception:

[{:com.wsscode.pathom.connect/indexes [:com.wsscode.pathom.connect/idents :com.wsscode.pathom.connect/index-io :com.wsscode.pathom.connect/autocomplete-ignore]}]
Can anyone point me in the right direction? Thanks! P.S. This query is coming from Fulcro Inspect Electron. I am sure that my parser is incorrect in this case.

2021-02-17T00:15:06.429700Z

@hadilsabbagh18 When you say “the query is coming from Fulcro Inspect Electron” do you mean that you entered that query in the EQL tab and got the expected result?

hadils 2021-02-17T00:15:57.430500Z

No @alex-eberts. This is a query that Fulcro Inspect Electron sends to load the Pathom indexes for the EQL window.

Jakub Holý 2021-02-17T15:46:33.436Z

Notice the Index resolver filters out some non-transit data https://github.com/fulcrologic/fulcro-rad-demo/pull/18

hadils 2021-02-17T17:04:01.436400Z

I resolved my problem. Thanks everyone! I started from the RAD demo and carefully integrated the native stuff.

2021-02-17T00:17:09.431200Z

So where are you getting that query from? The network tab?

hadils 2021-02-17T00:18:58.431700Z

No the load Pathom index button on the EQL tab. I think I don't have transit properly configured in my code, based on the error message:

body was either not transit or you have not installed the correct transit read/write handlers."

2021-02-17T00:22:11.431900Z

It’s possible that you may be using an older version of the rad demo. There was a PR in Dec that fixed an issue with the index not loading: https://github.com/fulcrologic/fulcro-rad-demo/pull/18/commits/819a2395c935f4c4675d0a83c29518daa2fd9516

2021-02-17T00:22:37.432100Z

When did you pull the RAD-demo?

hadils 2021-02-17T00:24:14.432300Z

Last week.

hadils 2021-02-17T00:24:47.432500Z

Let me look into that though

hadils 2021-02-17T00:27:39.432700Z

That code in in my demo.

hadils 2021-02-17T00:27:42.432900Z

code.

2021-02-17T00:29:54.433100Z

Is your code on a public repo that I can take a look at? Have you checked with the guys in the #pathom channel to see if this is a known problem?

hadils 2021-02-17T00:35:04.433300Z

The repo is not public, unfortunately.

hadils 2021-02-17T00:35:27.433500Z

I will keep digging.

hadils 2021-02-17T00:35:45.433700Z

Thanks for you help @alex-eberts.

2021-02-17T00:36:17.433900Z

Sorry I couldn’t be of more help - good luck!

2021-02-17T00:52:34.434100Z

Thanks @tony.kay, I realized that my understanding of load! is lacking and I need to go back and digest this a bit…

tony.kay 2021-02-17T01:22:12.434300Z

So, my first question @hadilsabbagh18 is “does it work with the stock demo?” I have not tried in a while, but it should. If the answer to that is “yes”, then my guess is that you changed the parser in some incompatible way. If the answer is “no”, then it is an oversight in the demo. Also, did you change versions of things? What version of Pathom? Fulcro assumes Pathom 2.x

stuartrexking 2021-02-17T20:45:14.442600Z

I’m looking for a little guidance on authorization of various parts of my app (non-RAD). I have an authentication flow and UISM similar to what RAD provides that allows for auth using AWS Cognito. I have a set of user permissions in my state. What I’m unclear on is where is the best layer in the app to enforce authorization. I have simple router hierarchy. Some things I’d like to be able achieve: 1. Have a authenticated and non-authenticated authorized routes 2. Have authorization on particular components, say comparing the user permissions to the set of permissions on the components 3. Perhaps even have authorization on the query. RAD provides a few hints of authorization against attributes but purposely avoids an implementation as it’s a minefield. At this state all front end. I’ll sort parser security at a later stage. What I’m looking for is a little guidance on which hooks in the system to use. For this kind of functionality should I be using allow-route-change? on the routes? Should I build an authorizing router that can wrap other components? Should I be using render-middleware? Should I just have a defsc or function that can do this for me? I want to keep the simplicity and performance that fulcro provides. I’m a little lost and would love a push in a particular direction, perhaps even a strong shove! Where to begin or how have others done it?

stuartrexking 2021-02-17T22:33:01.444300Z

I’m thinking that I should just take the RAD approach: Have a Session component that queries on the authentication state as well as the user permissions, then just use those directly in components that require them.