Fork me on GitHub
#fulcro
<
2019-06-25
>
ro603:06:07

I'm trying to get a modal working from react-modal (https://github.com/reactjs/react-modal), but when I set up a workspace defcard, I get an Invalid join, {:ui/root nil} error. Google brought back nothing on that. I can post some of the code, but even a hint of what that error might mean would help.

ro604:06:47

The card shows up in the workspace UI, but fails to mount. Here's the stacktrace:

"Error: Invalid join, {:ui/root nil}
    at new cljs$core$ExceptionInfo ()
    at Function.cljs$core$IFn$_invoke$arity$3 ()
    at Function.cljs$core$IFn$_invoke$arity$2 ()
    at 
    at Object.fulcro$client$impl$parser$join__GT_ast [as join__GT_ast] ()
    at Object.fulcro$client$impl$parser$expr__GT_ast [as expr__GT_ast] ()
    at fulcro$client$impl$parser$parser_$_self_$_step ()
    at 
    at 
    at Object.cljs$core$IReduce$_reduce$arity$3 ()"

Lennart Buit05:06:58

I don’t know whether this could be related, but modals tend to use react portals, which are rendered elsewhere in the real dom than that they are rendered in the virtual: https://reactjs.org/docs/portals.html

maxt09:06:48

I have a weird situation in Fulcro Inspect where the State after of my last transaction doesn't match with the DB. Could anyone take a guess at what could be causing that?

maxt09:06:52

I have a few elements that mysteriously (at least to me) got removed from my DB. I can confirm that with the history slider. But when I try to use the transaction view to debug it, I can't find it there.

maxt09:06:26

Doesn't post-mutations show up in the Transactions tab? I found the mysterious change and it was done in a post mutation step, which I can't seem to find any traces of in the Transactions tab.

hmaurer11:06:07

@maxt are you on Fulcro 2 or Fulcro 3?

mitchelkuijpers14:06:23

Wow we are just playing with Ghostwheel, How do people us this in Fulcro components? Would be pretty cool if you could just add ^::g/trace to a component to quickly see all the bindings

tony.kay15:06:53

@robert.mather.rmm The error message means your join is invalid 😜 On your query. You have something in your root after [{:ui/root HERE}] that is returning nil.

tony.kay15:06:19

@maxt Inspect is a chrome extension. It does not have access to your db. The client-preload watches the state atom and sends deltas to the extension (for speed). The diff algorithm is optimized for Fulcro normalized dbs, and also the data has to be serializable, or it just sends a placeholder for it. All sorts of things “could be” going wrong.

tony.kay15:06:40

On post mutations: don’t remember…would have to look at the source. Most likely not: post mutations in F2 are a hack internally and not real mutations.

tony.kay15:06:25

I don’t remember at the moment how I’ve addressed that in F3…pretty sure post mutations are real mutations there, with full support for everything (including remotes), which they cannot manage in 2

tony.kay15:06:20

@mitchelkuijpers I personally use gw all over the place, but not in components…what would you like there? I personally have not even tried the tracing, because I mostly wanted it for consistent control of instrumentation and shorter notation. Be interested in your thoughts for F3. Are you suggesting the trace affect render?

mitchelkuijpers15:06:16

Yes that is exactly what I mean

mitchelkuijpers15:06:37

I just tried it out for a function and it is very handy to quickly spot bugs

mitchelkuijpers15:06:20

But we just started using it last week, and the automatic outstrument is extremely usefull during development

tony.kay15:06:39

yeah…other than I found a bug in it that makes it unusable in F3 😞

tony.kay15:06:51

goes into an inf loop on certain multi-arity cases

tony.kay15:06:07

submitted bug report…but have not had time to make a simple repro for them

mitchelkuijpers15:06:13

Ah that sucks, is it solvable?

tony.kay15:06:16

don’t know

mitchelkuijpers15:06:17

Yeah that can take a lot of time

tony.kay15:06:42

so, you realize that render is a js function getting just “this”

tony.kay15:06:56

and that props and such are “hooked onto” that js object at string keys

tony.kay15:06:02

would trace still do anything useful?

mitchelkuijpers15:06:07

Ah yeah probably not

mitchelkuijpers15:06:16

it looks at all the bindings in scope in a function

mitchelkuijpers15:06:37

So that would make it really tough to use then

mitchelkuijpers15:06:44

Not sure if it's pluggable somehow

tony.kay15:06:44

yeah, the “bindings” are done in a manufactured let from the macro

tony.kay15:06:14

(render [this] (let [props (prim/props this) ...] ...)) is what render looks like for real

mitchelkuijpers15:06:23

Ah that might work

mitchelkuijpers15:06:01

Not sure if it's pluggable, and or usefull enough

mitchelkuijpers15:06:20

But maybe first try trace out, it is really handy

mitchelkuijpers15:06:58

Sorry gotta go but will look at it, and think about it some more

mitchelkuijpers15:06:28

It might work, it can also trace anonymous functions

tony.kay15:06:52

cool, you can always fork the repo/macro and drop in metadata

mitchelkuijpers08:06:00

So I played around and ran into a problem that Fulcro uses a 0.4.0-SNAPSHOT and there is no artifact for ghostwheel.tracer with the same version and 0.3.9 seems to not be compatible. But I found out that there is this macro in ghostwheel: https://cljdoc.org/d/gnl/ghostwheel/0.3.9/api/ghostwheel.core#%7C%3E And we could make a Option for Component where you can give it ::g/trace 3 and it wraps the render code inside of |>. Would you take a PR for that? Btw the codebase in Fulcro3 feels very simple when compared with Fulcro2

tony.kay15:06:31

Yeah, all that Om Next complexity was just noise…nice to finally clean it up.

tony.kay06:06:04

Sorry, I never responded to your question. The answer is “conditionally yes”: - The change has to be supported by his stubs library so it is elided when disabled. In fact, you can already do that as a “library concern” in Fulcro 3…see render-middleware option of app/fulcro-app.

tony.kay06:06:42

but I’m also not opposed to it being in the core wrapping code for cljs render

mitchelkuijpers06:06:32

Ah cool, will look at both options

mitchelkuijpers06:06:46

But first I have to find a ghostwheel.trace 0.4.0-SNAPSHOT

mitchelkuijpers06:06:55

But I cannot find a repository for it..

tony.kay06:06:46

yeah, I don’t use trace (yet)…I needed 0.4.0 to get gw/>def, which allows me to easily elide specs when I elide ghostwheel.

tony.kay06:06:52

shrinks code size a lot

mitchelkuijpers06:06:04

Yeah I found that in the commit history, that is interesting

mitchelkuijpers06:06:27

That is also very nice to create UI component specs for dev

exit221:06:19

Is the new fc3 template to be cloned or is it available as a lein template?

tony.kay21:06:15

probably not maintaining a lein template anymore

tony.kay21:06:04

I’m having to cut down how much I maintain. A lot of ancillary things like that are not of personal importance to my use of Fulcro…community maintenance will be required for such things

👍 16
Abhinav Sharma03:06:05

I do think that once a project has that initial push by the lead dev, it should be the entire community who takes up the task of maintaining and updating the ecosystem.

Abhinav Sharma03:06:05

I do think that once a project has that initial push by the lead dev, it should be the entire community who takes up the task of maintaining and updating the ecosystem.