Fork me on GitHub
#fulcro
<
2020-04-05
>
roklenarcic20:04:42

I’ve tried to fun df/load! in cljs REPL and it doesn’t do anything, but if I stick the same code on a button, then the transaction runs…. what could be the problem there?

currentoor20:04:09

what are you passing as the first parameter in the repl?

currentoor20:04:33

make sure that first argument is not nil

currentoor20:04:20

and you’ve made sure that value is not nil?

roklenarcic20:04:53

`

(df/load! app.application/SPA....
given the template project

currentoor20:04:35

df/load! calls comp/transact!

currentoor20:04:48

do you have the inspect extension installed?

currentoor20:04:02

are you seeing anything in the transactions tab in there?

currentoor20:04:08

when you use the repl

roklenarcic20:04:46

no transactions in inspect if I use repl

currentoor20:04:40

can you share the full code snippet of what your pasting in the repl?

roklenarcic20:04:41

(df/load! app.application/SPA :user/info UserInfo)
in repl doesn’t trigger any tx or error in console

currentoor20:04:58

what about debug logs? have you tried enabling those?

roklenarcic20:04:39

debug logs where?

currentoor20:04:12

what happens when you `

(comp/any->app app.application/SPA)

roklenarcic20:04:14

there seem to be some sort of logs here, in the style of: 2timbre_support.cljs:80 DEBUG [com.fulcrologic.fulcro.algorithms.tx-processing:?] - Scheduling a render

roklenarcic20:04:31

I get a massive map

currentoor21:04:45

do you have a custom

:global-eql-transform
set?

roklenarcic21:04:02

no..

(df/load! app.application/SPA :main-user UserInfo)
=> #uuid"20e5a6a5-4bc2-4efb-b12f-1d50ad0ccced"

currentoor21:04:19

hmm interesting so it is getting queued

roklenarcic21:04:16

yeah but I cannot see any tx or anything in the inspect

currentoor21:04:44

have you tried reloading the page? maybe the request queue is hosed?

roklenarcic21:04:24

doesn’t seem to change anything

currentoor21:04:36

very strange i’ve never seen this happen…

currentoor21:04:43

what about other queries?

currentoor21:04:53

i’ll try something similar in my app

roklenarcic21:04:09

The thing is that if I put the same line on a button it works

currentoor21:04:29

i’m starting up my app, then i’ll try it

currentoor21:04:13

what about the query tab in the inspector, if you use that does it work?

roklenarcic21:04:37

yes that works

currentoor21:04:56

(let [app @app-atom]
  (df/load! app :ucv/config nil))
that works for me in the repl

currentoor21:04:30

i can’t think of what else could be wrong

currentoor21:04:45

@U0CKQ19AQ will probably have a better idea

roklenarcic21:04:51

seems like shutting down non-main builds and restarting REPL helped

roklenarcic21:04:06

looks like I have problems with multiple shadow-cljs builds, perhaps conflicting config

roklenarcic21:04:58

thanks for your help

currentoor22:04:42

glad you figured it out

roklenarcic21:04:47

what’s the best way to prevent form-state part of query from being sent to the remote? Do you specify :without #{:com.fulcrologic.fulcro.algorithms.form-state/config} at each load or do you have something more general?

currentoor22:04:45

we use the :global-eql-transform

currentoor22:04:28

@U66G3SGP5 here’s our implementation

currentoor22:04:08

this elides a bunch of stuff by default (including anything with ui in the namespace

currentoor22:04:25

and also adds in the query for tracing

cjmurphy01:04:19

Thanks for that. I tried to put it into my own code but am getting a bewildering 'Use of undeclared Var' message. Do you mind giving us the imports as well because I think that will help.

cjmurphy05:04:12

I fixed it with another file almost exactly the same, copy and pasted and manually edited. No idea. Bad invisible character??

currentoor17:04:39

@U0D5RN0S1 no idea, but this question comes up so often, maybe this snippet with requires should be put in book

currentoor17:04:55

@U0CKQ19AQ want me to do that?

tony.kay17:04:07

if you want to.

currentoor17:04:19

yeah then we can link to that if someone asks, instead of making a snippet every time