Fork me on GitHub
#fulcro
<
2018-08-28
>
tony.kay03:08:43

@thheller a few ways. ptransact is really the main one because it is traceable…but you probably mean “after any arbitrary remote”?

tony.kay03:08:05

See the :mutation-merge option on new-fulcro-client

tony.kay03:08:27

that’s the most general way to intercept completion

veddha05:08:34

where is the best tutorial for fulcro frontend?

cjmurphy07:08:11

I would go for the erstwhile 'friends' example: https://github.com/fulcrologic/fulcro-getting-started#17-the-secret-sauce--normalizing-the-database. You may need to read it many times and ponder etc. It is all about understanding the role of idents.

thheller11:08:11

I just pushed the first pre-alpha version of the new UI stuff I'm working on. its still in pretty rough shape and far from ready for actual use. you can however do the basic builds commands like starting/stopping watch, compile

thheller11:08:53

if anyone wants to tell me about all the fulcro stuff I'm doing incorrectly I'm all ears 😉 https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/ui/app.cljs

thheller11:08:34

you can upgrade to 2.6.4 and run shadow-cljs server and open for the UI

thheller11:08:46

its currently pretty easy to overload the UI because the underlying websocket is way too chatty

thheller11:08:10

but next up I want to properly visualize the build progress and show build warnings/errors in the UI

thheller11:08:51

its pretty impressive how little actual client-side code there is for what it does already

thheller11:08:28

anyone have any recommendations regarding namespaced keywords? its a total mess right now. I created a few dummy empty alias namespaces but I really don't like that approach. just using one singular namespace for all aliases currently seems best to me

mitchelkuijpers14:08:26

It depends we create namespaces for domain objects

mitchelkuijpers14:08:01

like shadow-cljs.domain.build and then we add the specs there for that domain part and require and alias those keywrods

thheller14:08:37

yeah I started with shadow.cljs.model but it somehow felt wrong putting everything into one ns

thheller14:08:47

then I started creating more but that just felt worse

mitchelkuijpers14:08:16

But we do create some different namespaces per thing, but I still don't like it

mitchelkuijpers14:08:44

But it kinda works for us

thheller16:08:23

I kinda settled on using specific keywords a while ago so I guess I'll stick with just one ns

thheller16:08:13

:project/id and :user/id destructure to the same id which sucks. so just :my.alias/project-id and :my.alias/user-id seems best right now

mitchelkuijpers20:08:51

True but you can destructure that differently, but that is just personal preference

exit220:08:01

does fulcro.client.data-fetch cause a full re-render? I’m having an issue where some of my components are going back to a default state after the fetching

thheller20:08:30

was I wrong under the impression that a component only re-renders when its own query data changes not whatever child queries I joined in?

thheller20:08:49

not sure if I'm just doing it wrong or if that always works that way

pvillegas1221:08:25

trying to deploy a fulcro app to heroku but missing an npm install when pushing. I used lein new fulcro app-name nodemo shadow-cljs

thheller22:08:51

ok I'm completely lost. I must be doing something I'm not supposed to do.

thheller22:08:42

when I add this "global" reference the ident function of that component gets called with a {::active-build :browser} map for some reason I can't explain

thheller22:08:52

why is that?

thheller22:08:11

I (assoc state ::active-build :browser) in a tx and that somehow causes the strange flow of events

wilkerlucio22:08:00

@thheller having a dynamic ident seems a very bad idea IMO

thheller22:08:10

I don't want it to be dynamic

thheller22:08:21

I just added it because I can't figure it out

thheller22:08:55

(defsc MainNavBuild [this props]
  {:ident
   [::m/build-by-id ::m/build-id]

thheller22:08:00

this has the same issue

thheller22:08:30

no the behavior is the same. nothing changes

wilkerlucio22:08:47

one tip, since you are using connect, having those -by-id can be a bummer, if you just use the same prop name for ident key (`::m/build-id` in this case) everything will just fit in place regarding client/server comms

wilkerlucio22:08:31

lets say you wnat to lazy load data for the build after it's rendered

wilkerlucio22:08:15

if your ident key is [::m/build-by-id ...], then it doesn't match the ident for the server side, which would be [::m/build-id ...], so you have to convert one to the other at some point ,and convert again on the way back

wilkerlucio22:08:36

if your ident is just [::m/build-id ...] you don't have to convert anything at all

thheller22:08:30

I don't unterstand. I thought there was no ident on the server?

wilkerlucio22:08:54

there is, when you make a query like: {[::m/build-id 123] [::m/some-build-data]}

wilkerlucio22:08:05

in pathom connect terms this means: "I'm proving you a ::m/build-id with value 123 (or {::m/build-id 123})", then the query will use that information as a starting point to find related data (using connect indexes)

thheller22:08:44

good to know

wilkerlucio22:08:10

try on OgE, it will auto-complete available idents for you 😉

thheller22:08:35

changed it to build-id

thheller22:08:42

but doesn't affect the other thing

wilkerlucio22:08:54

but that was a tip, not a solution to the problem, hehe, we can keep on that

wilkerlucio22:08:20

so, at what point you are seeing the strange behavior, when you start the app?

wilkerlucio22:08:36

because ident is only called by fulcro in a few situations, the first one being data merge

thheller22:08:45

so I now have

(defsc MainNavBuild [this props]
  {:ident
   (fn []
     (js/console.log ::main-nav-build props)
     [::m/build-id (::m/build-id props)])

thheller22:08:32

if you look at the :.../main-nav-build messages it gets called with a MapEntry entrance