Fork me on GitHub
#fulcro
<
2021-03-15
>
thosmos01:03:59

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.kay01:03:47

@thosmos Versions? Electron vs Chrome?

thosmos01:03:49

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

tony.kay01:03:35

Chrome commercial or Chromium?

thosmos01:03:03

Chrome commercial & Canary

tony.kay01:03:40

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.kay01:03:52

That console might also be showing you errors.

thosmos01:03:37

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

thosmos02:03:29

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.kay04:03:04

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

3
👏 3
tony.kay04:03:51

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

bbss11:03:20

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.

bbss11:03:47

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.

bbss11:03:12

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..

bbss11:03:38

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?

bbss11:03:51

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.

hadils15:03:12

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.kay15:03:14

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.

Marcus20:03:34

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.kay22:03:21

@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.

Marcus06:03:55

@U0CKQ19AQ Ok. Makes sense. 🙂 Thanks!