fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
tony.kay 2021-04-23T03:11:08.188700Z

ah, you were talking about same ident mount more than one place…I was talking about a component changing ID while mounted so that the ident changes, which causes other problems. Glad to hear it is better. That most recent optimization was a really good one.

tony.kay 2021-04-23T03:11:54.188900Z

Error handling could use a little love

tony.kay 2021-04-23T03:12:49.189100Z

I’ve done some work on it, but I don’t even remember what. In general, though, I’d first recommend you read my thoughts on error handling in the book.

Tyler Nisonoff 2021-04-23T03:16:42.189300Z

I recall the philosophy of UI should not cause errors in the working state, and therefore errors can be: • bugs • infra issues • security issues • etc. I just want to track my bugs in something like Sentry 😛

Tyler Nisonoff 2021-04-23T03:17:14.189500Z

I created a custom parser that looks similar to RADs, but with my own process-error for now

tony.kay 2021-04-23T03:17:24.189700Z

oh, I just add a timbre appender for that and log them 😄

Tyler Nisonoff 2021-04-23T03:18:09.189900Z

ooh duh, thats the right approach!

Tyler Nisonoff 2021-04-23T03:18:12.190100Z

thanks

tony.kay 2021-04-23T03:18:15.190300Z

sure

2021-04-23T15:09:45.194700Z

Hi friends, over the past few months I've been thinking on and off about handling derived data in fulcro and if we could somehow combine re-frame subscriptions with fulcro to solve this problem. I have an experiment here that shows one combination of how this could work: https://github.com/dvingo/fulcro-re-frame-playground I want to be able to use all of fulcro and not compromise on that (router, dynamic queries, mutations, state machines) and am only leveraging the subscription feature of re-frame and none of the mutation parts. The readme has more details, but the high level is that using a macro you get re-frame subscriptions generated from fulcro queries. Using these base subscriptions you can then write further subscriptions to deal with re-rendering derived data via re-frame components. This works well when your re-frame components are at the leaves of your component tree, but rendering fulcro components from the re-frame components will not always compose to root, which causes problems. I haven't played with the new fulcro hooks code but perhaps there is a way to use those here to get the benefits of fulcro with the benefits of re-frame. This is all experimental, I hope it inspires others to think about this problem and try out the code to see if there are novel ways to make writing apps even easier. The high level goal here to only ever deal with normalized data in mutations and have the subscription layer deal with determining what to re-render. I don't want to have to store denormalized data in the fulcro db or ever describe what out of band properties in the db to re-render, that should be handled for me. Some next steps to experiment with this would be to use a subscription to store an index of components by some alternative property (tasks by author or by date for example) and get the two systems to still play well together (mutating a task causes the indexed list to re-render). Hoping it inspires some more creativity in this area!

👀 5
❤️ 1
donavan 2021-04-26T14:47:43.259100Z

I’ve only been using Fulcro for about 4 months so take anything I say with a huge lump of salt! 😄 I’m looking forward (and I know others are too) for a good solution for derived data in Fulcro. Having used some code that tackles these concerns the two key takeaways I have is the solution must not leak (i.e. where you use it must be totally transparent to surrounding code) and it must fit seamlessly with Fulcro’s ‘philosophy’ (for lack of a better word). Caveat, I’ve only just skimmed the readme; but the extra ::rfm/subs key gives me pause for concern. How would you compare your solution to Pathom3's take on derived state (computed graph nodes)? (Caveat I also haven’t looked too deep into Pathom3 yet! 😄 )

2021-04-26T14:54:38.259400Z

This is not my solution, it is non-abstracted re-frame subscriptions https://day8.github.io/re-frame/correcting-a-wrong/

donavan 2021-04-26T15:10:42.260100Z

I’m not sure what you mean? (FWIW I know re-frame pretty well so am familiar with subscriptions in general) I think the point I was not making very well is; the query is such a fundamental component of Fulcro that I feel any deviation from it (with the sideband ::subs key) should be thought about very carefully. It seems to me (again, from very little skimming of the website) that Pathom3 gives you derived state that fits in with the Fulcro query in a far more ‘natural’ way? :woman-shrugging:

donavan 2021-04-26T15:14:22.260300Z

TBH, in my case a far faster quick fix would be to just use transients for the heavy caclulation part and blindly derive on each render. The JS runtime is pretty fast!

NikolaMandic 2021-04-23T15:36:40.195200Z

I'm a newbie but it seems this is just what I expected from fulcro in previous question on the channel yesterday I won't say if its good or bad but it for sure is an alternative concept. I'm thinking you can implement it in at least 2 way more with different query key or with different rendering optimizer is that so? it seems to me this borrows from redux javascript library am I right?

2021-04-23T16:03:41.195700Z

Hi. I don't believe your question is related to this. If I follow correctly, you are wondering if you always need to pass props to child components, and the answer is yes. This is a fundamental design of fulcro.

2021-04-23T16:12:43.195900Z

What I described is only dealing with derived data which fulcro does not maintain in its indexes, and thus cannot update efficiently without you telling it to (or doing a crude full re-render from root)

NikolaMandic 2021-04-23T16:15:39.196500Z

hm ok when I saw your post I thought that what you made is something that would work similarly as reducer in react-boilerplate like if something changes in the local database you would have subscription for it that would trigger a rerender which is what reducers do in react-boilerplate I was spending bit of time trying to use query as reducer from react-boilerplate without success I guess with your approach it would be possible. thats one of the things why I asked about props. its just latter that I found out from tutorials how does fulcro deal with this. thanks for reply. I'm still trying to get better grasp of fulcro so I'm not very competent to comment

2021-04-23T16:59:20.197200Z

Ah I see thanks for clarifying! I think it's analogous then yes. It was hard to understand without code examples.

NikolaMandic 2021-04-23T17:23:14.198200Z

for what I saw in javascript world there are two approaches that compete with fulcro approach when it comes to state management thats reducers approach and rxjs approach of angular where people might chose not to go with redux but use rxjs pipes. fulcro in a way competes with them with its methods and innovating a bit. it for sure is attractive to experiment with all these ideas

NikolaMandic 2021-04-23T21:06:15.200Z

I'm trying to use optimized-render! keyframe/render! in latest rad and I copy pasted code from video on how rendering works but so far I can't manage to reproduce that just one person updates is rad template able to do this?

Tyler Nisonoff 2021-04-23T21:52:24.201500Z

@tony.kay r.e. the modification you recently made to m/returning What are your thoughts on a generic opts map as the additional arg rather than just query-params ? This would allow other future options such as without / other df/load! functionality I’d be happy to provide a PR if you’d like, been testing my own version

tony.kay 2021-04-23T22:05:46.201600Z

seems reasonable..but have I already messed up and used a non-map as that argument?

tony.kay 2021-04-23T22:06:05.201800Z

RAD requires multi-root renderer if you’re using SUI plugin, or some controls will not work.

Jakub Holý 2021-04-23T22:06:18.202100Z

Why do you want just a single person to update? Trying to optimize? I would recommend getting really familiar with Fulcro before trying to do anything fancy.

Tyler Nisonoff 2021-04-23T22:06:24.202400Z

query-params is a map, but we’d have to nest it inside another map

Tyler Nisonoff 2021-04-23T22:06:58.202600Z

i dont believe you’ve pushed a release of this code fwiw, but some may be using it

tony.kay 2021-04-23T22:07:14.202800Z

Ah, if I have not actually released it, then yes, let’s fix it

tony.kay 2021-04-23T22:07:28.203Z

I think you’re about the only person even aware it exists

Tyler Nisonoff 2021-04-23T22:07:41.203200Z

yeah i think so as well 😄

Tyler Nisonoff 2021-04-23T22:34:51.203700Z

https://github.com/fulcrologic/fulcro/pull/476

Tyler Nisonoff 2021-04-23T22:39:54.204Z

i can add a follow-up one adding without support, but it’ll require proxying data-fetch ’s elide-query-nodes and elide-ast-nodes to a helper namespace so that mutations can use those as well

NikolaMandic 2021-04-23T22:40:11.204200Z

I'm trying now to follow fulcro tutorial how rendering works and I have trouble reproducing what Mr. Kay did there in the way I tried I hope to do what he did in the video I tried copy pasting the code into rad after cloning rad as is but I guess now it does not work due to rad using another render that behaves differently than the one in tutorial. not sure if one can specify the other renderer I just trying to force the optimized one into it like in the video 🙂 now I'm falling back to code from repository in the video trying to follow step by step until I see it working trying to get my feet wet with the fulcro it looks like a really nice software

hadils 2021-04-23T23:21:38.207Z

Hi. I am working on a hybrid RAD and vanila Fulcro Expo/RN app. RAD on the backend and Fulcro on the frontend. I am getting the following warning consistently:

WARN [com.fulcrologic.fulcro.components:1777] - Component com.fulcrologic.fulcro-i18n.i18n/LocaleSelector does not INCLUDE initial state for com.fulcrologic.fulcro-i18n.i18n/Locale at join key :com.fulcrologic.fulcro-i18n.i18n/available-locales ; however,  com.fulcrologic.fulcro-i18n.i18n/Locale HAS initial state. This probably means your initial state graph is incomplete and props on com.fulcrologic.fulcro-i18n.i18n/Locale will be nil.
a
I am not using i18n anywhere in my project.

NikolaMandic 2021-04-23T23:31:36.207200Z

it seems I used latest fulcro but ident optimizer is not the default anymore one has to specify it explicitly if one tries to follow tutorials with the latest fulcro if anyone searches for this in google I guess someone will spot this chat