Fork me on GitHub
#fulcro
<
2018-04-16
>
cjmurphy05:04:53

@wilkerlucio Fulcro Inspect sends nil through in the props of components. This means that if you have assertions, such as that a particular scalar field is not nil, or anything else really, they will all be triggered when using Fulcro Inspect. Is this the way it is supposed to happen? Something that can't be helped?

wilkerlucio05:04:07

@cjmurphy hello, not sure what you mean by sends nil though in the props, you mean like scanning a map asserting that nothing is nil?

cjmurphy05:04:25

Yes - a particular thing inside the map that should always be there. I might be checking boolean? for instance.

wilkerlucio05:04:02

how is that affecting you? you try to run (s/valid?) and it breaks on spec keys?

cjmurphy05:04:18

Nothing to do with spec!

cjmurphy05:04:24

Just an assert

cjmurphy05:04:40

assert inside a render

wilkerlucio05:04:09

but why are you validating the spec render calls thenselves, it's some global instrumentation?

cjmurphy05:04:08

No it is something very simple. Nothing complicated, just asserting.

wilkerlucio05:04:36

but where? I'm trying to understand why are you hitting the inspect code in the process

cjmurphy05:04:32

I don't know either.

cjmurphy05:04:22

I didn't have Fulcro Inspect there but then wanted to use it, so put it in, then it triggered all my crude assert-style validation.

wilkerlucio05:04:33

where is your assertion placed?

cjmurphy05:04:54

Of any defsc.

cjmurphy05:04:06

Not the root no.

wilkerlucio05:04:37

what the assert looks like?

cjmurphy05:04:30

(assert (string? the-name))

cjmurphy05:04:27

the-name is coming through as nil.

cjmurphy05:04:45

the-name is a prop that has gone into a generic component. Without Fulcro Inspect all is fine.

wilkerlucio05:04:49

I don't understand how that can be happening, because how a inspect prop is getting on your component?

cjmurphy06:04:08

Why do you mention the word spec?

cjmurphy06:04:17

This has nothing to do with spec.

wilkerlucio06:04:22

sorry, still awaking here, I mean inspect šŸ˜›

cjmurphy06:04:09

It is not an inspect prop.

cjmurphy06:04:26

It is a prop from my application.

cjmurphy06:04:06

It seems that Fulcro Inspect is running the root factory method - sticking the props in. I guess this is part of what Fulcro Inspect does.

cjmurphy06:04:25

My application's root factory method.

cjmurphy06:04:58

It is like it is doing it without grabbing the initial state.

wilkerlucio06:04:15

can you please send the line you are looking in?

cjmurphy06:04:32

And essentially my asserts are checking that initial state is getting to all the places it is supposed to.

cjmurphy06:04:53

I'm not looking at any lines of Fulcro Inspect.

cjmurphy06:04:07

I was guessing, like I said.

cjmurphy06:04:26

It seems you don't expect this behaviour. Can I just put an issue up showing code where the asserts are fired? It should be something quite simple.

wilkerlucio06:04:24

ok, would be nice with an reproducing example, I'm still not really getting it

wilkerlucio06:04:34

humm, wait, there is one place where we call your factory

wilkerlucio06:04:42

and that is on the dom preview

wilkerlucio06:04:59

anyway, open the issue so we can track there

cjmurphy06:04:49

Will do so soon.

tony.kay06:04:39

Iā€™ve just uploaded a video called ā€œUnderstanding Fulcroā€ and added it to the watch list. Iā€™m not sure exactly where it should goā€¦I realized that a lot of people would probably benefit from an overall look at the core mechanism and design of Fulcro so they could more easily ā€œget itā€ without having to completely learn it. Iā€™d be interested in feedback, of course. It is hard for me to know if such videos are really helpful, since I know it so well. The target audience is any interested developer, so in that sense, I hope that it is comprehensible to anyone with very basic Clojure knowledge. https://youtu.be/nlT45ikSEOE

parrot 32
šŸ‘ 4
sundarj16:04:16

just finished watching it. thought it was excellent, a great addition to the collection šŸ™‚

troglotit15:04:45

Is there an api to query from outside of defscs? I want to have my non-fulcro code being able to do something based on state and to query fulcro-client, instead of passing state from defscā€™s to that my non-fulcro code

tony.kay15:04:59

@troglotit db->tree, merge-component!, transact! can all be combined in external code. If youā€™ve saved your client in an atom, then the :reconciler is just in it at that key. You can use app-state on the reconciler to get the state atomā€¦and then running db->tree on that will do it.

exit217:04:18

@tony.kay is there a version that supports legacy defui? So that I donā€™t need to refactor every component?

currentoor17:04:53

thatā€™s in the latest version too

currentoor17:04:22

I still use defui in some of the older parts of my codebase

tony.kay17:04:27

defui is just fully supportedā€¦`defsc` is just cleaner with error checking. Sorry, I was encouraging you to port for reasons unrelated to necessity

exit217:04:07

ah okay! the errors must have been something else then, I thought it may have been because defui wasnā€™t defsc

tony.kay17:04:30

they are two different macros, but both are supported

tony.kay17:04:26

they all do