Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support relay v16 + refactor useForceUpdate + react v18 strict #268

Merged
merged 15 commits into from
Jan 11, 2024

Conversation

morrys
Copy link
Member

@morrys morrys commented Dec 12, 2023

Include:

@morrys
Copy link
Member Author

morrys commented Dec 12, 2023

Hi @gkaindl, @eMerzh, @Lalitha-Iyer,
I just released version 9.0.0-rc.3
Your feedback would be very useful as in this release I added the optimization of useForceUpdate in order to manage the forceUpdate carried out after rendering but before the actual mount.
And a change to useQuery and useOssFragment to handle double rendering in development mode caused by react strict (non-production issue)

I also updated the example project https://github.com/relay-tools/relay-hooks/tree/master/examples/relay-hook-example/pagination-nextjs-ssr to the latest releases of nextjs, relay and react in strict mode.

@eMerzh
Copy link

eMerzh commented Dec 12, 2023

@morrys thaaanks :)
the forceUpdate seems to be good from here... but i still have #263
not sure if it was fixed in earlier version or not 🤔

@morrys
Copy link
Member Author

morrys commented Dec 12, 2023

@eMerzh very curious, I integrated into this PR the other one where you didn't have the problem
#256 (comment)

did you run relay-compiler again?

@eMerzh
Copy link

eMerzh commented Dec 13, 2023

i'm really really sorry, yeah it seems i didn't test properly or soemthing change?

anyways, i tried to dig it ...
and using usePagination + loadPrevious(10)

with a fragment beeing @refetchable on a Node ... make it break..

https://github.com/relay-tools/relay-hooks/pull/268/files#diff-3478363f24e7381f9b3f144c18b1c2f8f5f1dc73c968d65c4ef9da948b6d6f2aR574
identifierInfo is null there... but if i take refetchMetadata instead... it sees to go further and identifierQueryVariableName doesn't seems to exists? 🤔

@morrys
Copy link
Member Author

morrys commented Dec 13, 2023

It seems like a problem with the files generated by the compiler or different versions of relay-runtime.

Do you check in the generated file if you have this?

"refetch": {
       "connection": {
         "forward": {
           "count": "count",
           "cursor": "after"
         },
         "backward": null,
         "path": (v0/*: any*/)
       },
       "fragmentPathInResult": [
         "node"
       ],
       "operation": require('./ReactRelayPaginationContainerUserFragmentRefetchQuery.graphql'),
       "identifierInfo": {
         "identifierField": "id",
         "identifierQueryVariableName": "id"
       }
     }

@eMerzh
Copy link

eMerzh commented Dec 13, 2023

omg 😮‍💨 🤦 ...
my compiler stayed on 15.0.0 ... after fixing it, everything is good to go 👏

Copy link

@aleksandrlat aleksandrlat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do it! Thank you!

@Lalitha-Iyer
Copy link
Contributor

Verified relay-hooks@9.0.0-rc.3 with relay-runtime@16.0.0 and relay-compiler@^16.0.0 on our code base. Don't see any functional or performance issues. Thanks for tagging me !

@morrys
Copy link
Member Author

morrys commented Dec 29, 2023

Perfect, as soon as I can I'll merge and release version 9.0.0 :)

Thanks you all

@morrys morrys merged commit 3616d93 into master Jan 11, 2024
2 checks passed
@morrys morrys deleted the relay-v16-forceupdate-refactor branch January 11, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants