Fork me on GitHub
#fulcro
<
2020-06-22
>
tony.kay15:06:44

released in 0.0.14-alpha

murtaza5215:06:14

šŸ‘ thanks appreciate it

Andrew14:06:07

I'm playing with the fulcro-native-template and I'm having trouble keeping a repl connected. I start and run the example app just fine. I can connect to the shadow-cljs repl with calva in vscode. The issue is that as soon as I made any edit expo reloads the whole app which silently breaks the calva repl connection requiring me to disconnect and reconnect it. Sorry if this something obvious, I'm very new to clojure and am not accustomed to the tooling yet.

tony.kay15:06:56

Turn off the fast refresh option in native itself

tony.kay15:06:19

shadow will hot reload the code. Donā€™t let RN do itā€¦dev menu in app on phone

Andrew13:06:13

I've already done that. Shadow hot reloads everything just fine, the problem is that immediately afterward expo behaves like an entirely new bundle was built (shows the downloading js bundle popup) and hard-reloads the app.

tony.kay14:06:05

not in my controlā€¦thatā€™s in the dev menu for expo on the phone

tony.kay14:06:18

Fulcro has nothing at all to do with code loading

Andrew15:06:28

There's some strange interaction between vscode/calva and shadow-cljs making expo think it needs to constantly build a new bundle. Likely "because windows". You're right, nothing to do with Fulcro though, thanks for the input šŸ˜ƒ

Andrew01:06:19

An version bump to latest Fulcro, fulcro-native, expo, and shadow-cljs has magically resolved this. I haven't learned enough about the tooling yet to figure out exactly why. There's a mountain of new knowledge to tackle coming from TS/react-native to cljs and Fulcro haha. Would it be useful for me a send a PR to bump the dep versions on the fulcro-native-template or is there a reason to keep them as-is?

tony.kay15:06:43

no reason, thatā€™d be fine

zilti15:06:13

So probably a simple thing, but I am a bit stuck with it: I have a component with a query and an ident, and in its parent, I have {:ui/child-data (comp/get-query Child)} in the query. Now calling df/load! with the [:component/id ::Parent :ui/child-data] target loads a list of {:child/id uuid} into ui/child-data, and normalizes the actual data into the database at the :child/id key. This is fine. But... When I now render the child components using (def ui-child (comp/factory Child {:keyfn :child/id})) and then (mapv ui-child child-data) it only has its ident populated with the id. Which makes sense considering child-data only contains the idents. How do I populate the rest of the child's props now?

zilti15:06:43

Obviously I could "catch" the data in :post-action of df/load, but that feels very very wrong.

tony.kay15:06:51

what is you load???

tony.kay15:06:00

well, I guess the load must be ok, but the query looks ok too

tony.kay15:06:09

you have a join, so it should denormalize the props

tony.kay15:06:33

not sure what you mean by ā€œpopulate the res of the child propsā€ā€¦didnā€™t you load them???

zilti15:06:35

The load call?

(df/load! this :example/all-entries Child {:target [:component/id ::Parent :ui/child-data]})
And it loads fine. :ui/child-data contains all idents of the entries, and the data itself gets stored at the root point of the client database

tony.kay15:06:53

right, and parent has a query join to Child

tony.kay15:06:20

so in the UI you should see a vector of denormalized children in props

tony.kay15:06:01

double-check your query(s)

zilti15:06:08

...Oh! Yes, had a typo in the parent query...

tony.kay15:06:32

pretty much the only place to look: query, ident, state. šŸ™‚

tony.kay15:06:57

the macro tries to help you catch a number of those kinds of errors, but I guess it still misses some

zilti15:06:00

I am slowly getting into the thinking pattern needed šŸ™‚

zilti15:06:23

I mean, I guess technically it isn't an error. Just not what I wanted

tony.kay15:06:33

let me know when youā€™re to the point of slapping your head and thinking ā€œwhat did I find so hard about this??ā€ šŸ˜„

zilti15:06:41

Haha I will šŸ˜„

Adrian Smith16:06:31

I think clj-kondo will soon have support for catching problematic calls to macros: https://www.reddit.com/r/Clojure/comments/hcnfwl/some_preliminary_docs_for_an_upcoming_cljkondo/ maybe in the future we won't even need to run code to see problems there

borkdude16:06:49

Already released yesterday

zilti16:06:27

Niiiiiice!

zilti19:06:38

I made a wrapper to use IBM's Carbon Design System with Fulcro: https://gitea.lyrion.ch/zilti/carbon-wrapper

JAtkins21:06:07

Awesome! I think I'll use it on my next project actually, since semantic is dead from all appearances.

zilti21:06:12

Yea, unfortunately it seems pretty dead, as the main maintainer moved on to Microsoft... It's a shame, it's really nice to work with. I'm using Semantic for a project at work currently

JAtkins21:06:21

I'm in a similar position. I didn't know how dead semantic was when I started the company project. Fortunately everything still works -- compatibility is one of the very few things about the web that is nice.

strsnd21:06:46

Nice. Btw. https://fomantic-ui.com/ is still maintained and tries to be compatible with semantic-ui, seems to be a drop-in replacement. Especially the build system just works.

ā¤ļø 3