Fork me on GitHub
#fulcro
<
2018-10-02
>
tony.kay04:10:39

@currentoor So I’ve verified that 2.6.5 on clojars has the changes.

tony.kay04:10:44

did you figure it out?

currentoor04:10:26

Not yet, I’ll verify tomorrow

tony.kay04:10:55

ok. Check primitives.cljc in your copy…defui and ui should be at the bottom

tony.kay04:10:10

that’s an easy way to tell if the source your’e using has the change

wilkerlucio13:10:35

@tony.kay @thheller I just tried upgrading to 2.6.5 here, and I found that something with refresh got broken with it in some scenarios, I need to pinpoint more, but on some cases the data is not refreshed and I'm getting blank renderings on some sections, reverting to 2.6.4 fixed it

veddha14:10:01

someone know how to take route-param to component?

tony.kay14:10:37

@veddha.riady won’t the route param just be the ID of the target? Or, if you have multiple params, you can simply use bidi to parse the URI. Complex routing behaviors are meant to be implemented in mutations of your own, by composing mutation helpers from the routing ns

tony.kay14:10:43

@wilkerlucio Good to know…I tested it somewhat against my app, and it also didn’t look like the patch should change anything…does it happen on components that override lifecycle methods, and if so, which lifecycle method(s)?

veddha15:10:12

@tony.kay i want to take route-params and render that from component

tony.kay15:10:12

@veddha.riady what I said before: any behaviors beyond showing a screen are up to you. The route params themselves can be parsed out with bidi from the URI, and if you’ve already got things routing, then your database will have a reflection of that interpretation (e.g. as an ident pointing to a screen). If you want to make that data visible on the UI, you just need to either interpret it in your own mutation, or read it out of the database and interpret it in the UI.

tony.kay15:10:03

A more feature-rich UI routing system is beyond the scope of the base library, but would be easy to implement on top of it. For example, I could imagine setting up feature rich macros that let you define all sorts of things ranging from data loading to UI layout…but again, too much of a feature creep for the base library.

tony.kay15:10:57

The existing routing primitives are just that: primitive. They keep you from having to write a union query component, help a bit with dynamic code loading, and reduce boilerplate for the common case.

tony.kay15:10:44

@wilkerlucio Can you confirm that you cleaned your project and browser caches?

wilkerlucio15:10:43

Im away from computer now, but I confirmed it multiple times, switched version and back about 3 times, the issue was consistent

wilkerlucio15:10:58

the case is after a load to get data and display in a modal

wilkerlucio15:10:27

the code works fine on workspaces, but on the real app it was calling the modal with blank props after load

wilkerlucio15:10:39

but forcing a root refresh renders correctlu after that

tony.kay15:10:44

super strange.

wilkerlucio15:10:18

so it might something inderect, needs some depth on the query to reproduce, thats my current guess

tony.kay15:10:06

basically all the optimization does is replace duplicate versions of the default lifecycle methods with a single shared one

wilkerlucio15:10:03

maybe its having different closures or something

tony.kay15:10:50

I wonder if there’s a problem with the hook-up and one isn’t getting installed properly…could corrupt the indexes if so. Hm…closures…guess that’s possible, but I think they only use this

wilkerlucio15:10:32

and in this case the main component doest override any lifecycles

wilkerlucio15:10:41

(the componente being loaded)

tony.kay15:10:22

I’ve placed a warning on the FUlcro README for now until we diagnose.

tony.kay15:10:49

I did notice that @thheller patch no longer clones the React prototype…but that didn’t seem problematic to me…but then I didn’t write that original bit of code. It came from Om Next.

thheller15:10:28

hey. hmm this is odd. goog.object/extend is basically the same as goog.object/clone. It just copies properties from one object to another

thheller15:10:38

and does so for multiple objects

tony.kay15:10:52

yeah, it looked sane to me

tony.kay15:10:34

next time might be better not to move things around in source…sure would be nice to see a clean diff.

thheller15:10:07

I had to move it since the new prototype accesses functions in that ns

tony.kay15:10:44

why wouldn’t declare work?

thheller15:10:10

declare is icky in CLJS since it messes up callsites

thheller15:10:24

unless you manually provide arglists ...

thheller15:10:37

(in upcoming version. not yet releaed)

tony.kay15:10:02

Things to love and hate in all languages I guess

thheller15:10:45

hmm would love to help track this down though. not sure where to start though

tony.kay15:10:56

agreed…min repro would be helpful

thheller16:10:36

@wilkerlucio is this in dev or release only or both?

tony.kay16:10:26

we have some hints: It misbehaves on a targeted refresh. This means it is looking up props by ident to run a targeted query and property patch. This also uses the metadata about UI path embedded in the props.

wilkerlucio16:10:38

the issue happens in both dev and release builds

wilkerlucio16:10:13

@tony.kay it does use targetted refresh on my example

tony.kay16:10:59

@wilkerlucio yep..only way a root refresh would work, but not one after a load I could think of. 🙂

wilkerlucio16:10:39

ah, sorry I mean the targetted in terms of load, its load with custom :target

wilkerlucio16:10:09

I can try making a min repro later

wilkerlucio16:10:16

just detected it this morning

tony.kay16:10:18

that’s probably not relevant. I mean that it is an optimized render, which requires that get-ident works on the component

tony.kay16:10:43

and that the path metadata isn’t missing

tony.kay16:10:30

Is the modal coming up while the data is loading? E.g. is this a new UI element that is coming in with a load?

wilkerlucio16:10:24

the modal shows immediatly after user click, it opens showing a loading spinner

wilkerlucio16:10:38

the spinner shows fine, the problem is after the load is merged

wilkerlucio16:10:48

the component gets blank props

wilkerlucio16:10:12

if I force a root render right after that (using inspect) it rendes correctly

tony.kay16:10:06

right…so what happens on refresh is: 1. The optimal render looks up the ident of the compontn to refresh 2. It runs an ident-join query on that component 3. It patches the result of that query onto the tree of old props 4. It re-renders from root, and S.C.U. short-circiuts everything but that path.

tony.kay16:10:39

(3) requires that it find the correct path…but I can guess that (3) is OK, because otherwise you’d get the old props.

tony.kay16:10:50

That leads me to believe that get-ident on that component is failing.

tony.kay16:10:37

any ID weirdness there? E.g. is the ID of the component changing as a result of the load?

wilkerlucio16:10:14

no, the id is fixed, the entity is already loaded, its just pulling more data

wilkerlucio16:10:54

yeah, I do have that

wilkerlucio16:10:15

but I dont think its it

tony.kay16:10:18

If you get a chance, you might add some debug statements into the Fulcro source in the default lifecycle methods and see if anything is going wrong.

wilkerlucio16:10:39

because I debugged the props of the component that calls the modal, and props are wrong there too

tony.kay16:10:41

and in the optimal-render, to see where it is screwing up…my guess is the ident is wrong

tony.kay16:10:22

“the props are wrong there too”…meaning other problems, or just that the ones are missing ?

tony.kay16:10:56

I need to go, but let me know if you get more info.

wilkerlucio16:10:04

it gets a blank map instead of the props its supposed to have (blank or nil, have to check, still afk)

wilkerlucio16:10:12

ok, I’ll try to find some time to look more into it later