fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
thosmos 2021-03-15T01:17:59.296Z

My app DB is empty in Fulcro Inspect. I’ve gone back to what I thought was a previously working version, but it’s still empty. The app is working normally. Any tips for how to troubleshoot it?

tony.kay 2021-03-15T01:35:47.296600Z

@thosmos Versions? Electron vs Chrome?

thosmos 2021-03-15T01:36:49.297200Z

Chrome Fulcro Inspect 3.0.4, Fulcro 3.3.0 (currently rebuilding with 3.4.20 now)

tony.kay 2021-03-15T01:38:35.297600Z

Chrome commercial or Chromium?

thosmos 2021-03-15T01:39:03.297900Z

Chrome commercial & Canary

tony.kay 2021-03-15T01:41:40.299300Z

So, I’m not aware of any issues with the latest version and Chrome. If you right-click on Inspect itself and Inspect it (very meta) to open up the console on the plugin, you can clear the application data and see if that fixes it. Sometimes a bad value gets in there and hoses things. Uninstall/reinstall has the same effect.

tony.kay 2021-03-15T01:41:52.299600Z

That console might also be showing you errors.

thosmos 2021-03-15T01:48:37.300700Z

oh nice about the meta tools, I didn’t realize that was possible. now after building with 3.4.20 I’m getting a a few errors. I’ll attempt to resolve those and circle back if I’m still having problems

thosmos 2021-03-15T02:00:29.301800Z

it’s working now. It looks like the problem was that I introduced some strange data that triggered a strange error that wasn’t previously getting warned about, but the newer fulcro seemed to surface it. Thanks for the help!

tony.kay 2021-03-15T02:19:29.302Z

no problem

tony.kay 2021-03-15T04:27:04.305100Z

Another pass at Fulcro in vanilla hooks-based React apps. SHA 0a52e40e49f40d6b2a0c6900ba2841c4709f2af0, and on develop. After some discussion with @wilkerlucio we decided that it might be nice to just be able to specify a query. It occurred to me that it is pretty easy to infer auto-normalization with a simple rule: the first prop with an id for the keyword’s name is how to look up the ident. So, even for things that have a constant ident you can just include a :ui/id in the query and a :ui/id :settings kv pair in the state. The final usage looks like (example todo list): https://github.com/fulcrologic/fulcro/blob/develop/src/workspaces/com/fulcrologic/fulcro/cards/composition_cards.cljs#L45

1
👏 1
tony.kay 2021-03-15T04:27:51.305900Z

feel free to play with it and give feedback. I deployed a snapshot as 3.4.21-SNAPSHOT if you don’t use deps.

2021-03-15T11:17:20.310500Z

Will give that a try next time I run into the need! Thanks. Already using the use-query-subscription with alternate render in some spaces.

2021-03-15T11:18:47.311600Z

I've been having issues with my app crashing when using it on iOS, most horrible browser to debug ever 🔥, Taking the crown from IE6, ironic considering the initial stance of Apple towards html5 apps.

2021-03-15T11:19:12.312Z

I figured it's probably mostly caused by scrolling a list that's "too big", although it's only 10-20 items with maybe 10 dom elements and some strings as children, nothing crazy..

2021-03-15T11:21:38.313300Z

I'm trying react-window but it seems since it wraps a class this messes with the fulcro bindings. https://book.fulcrologic.com/#_using_fulcro_component_classes_in_vanilla_js_detached_subtrees I think this applies for solving it, but that sounds like something I want to avoid. Any tips?

2021-03-15T11:43:51.314300Z

great, react-virtuoso seems much better so far, seems to work with comp/with-parent-context plus it reads dynamic item without needing to calculate it manually.

hadils 2021-03-15T15:18:12.319500Z

I have modified the Fulcro React Native demo. I have a Session component which works fine with the Login interaction and the state machine. I have been able to get the user id inside the Session component. I need to use this in other components in my UI, e.g., to get addresses etc. for the current user. I don't know how to acccess the user id from outside the Session component. Any suggestions would be greatly appreciated...

tony.kay 2021-03-15T15:49:14.319700Z

Use an ident join in a query. For example, if you loaded it at the top level using :current-user, then the state has :current-user [:session/id some-user-id] (or something similar). You can just add [:current-user '_] to any component’s query, and it will resolve it.

hadils 2021-03-15T15:51:04.319900Z

Thank you, @tony.kay!

Marcus 2021-03-15T20:00:34.321600Z

What is the point of defining initial state? Is it in cases where initial state differs from the queried state? Couldn't we just use the queries and pass in server-side data?

tony.kay 2021-03-15T22:31:21.324900Z

@marcus.akre this is a common misunderstanding. Fulcro is a reified data view. Initial state is what data needs to be populated into the UI before any loads have ever happened. Without initial state, what do the UI queries have to query? The component queries are usable by loads, but are always used to get data from the local db.