relayjs / relay-examples

A collection of sample Relay applications
MIT License
1.14k stars 430 forks source link

[WIP] Possible evolution of the Relay integration with Next.js #269

Closed alunyov closed 1 year ago

alunyov commented 1 year ago

Note: This is WIP and not ready to be merged. I’m sharing for feedback and adjustments on the direction.

Summary:

Not sure if it’s working:

alunyov commented 1 year ago

Also, worth noting: this version publish of the same query payload 3 times (maybe more): two times on the server, for SC and under each RelayRoot. And then on the client, under RelayClientRoot.

sibelius commented 1 year ago

Can we find a way to use the same function “useFragment” on both client and server?

alunyov commented 1 year ago

Can we find a way to use the same function “useFragment” on both client and server?

Well, since readFragmentData this is not part of the core framework, you can name it useFragment, but for the sake of example, and to be explicit (and avoid possible confusion) I named it differently.

a-marcel commented 1 year ago

Lächeln Am 11. Jan. 2023, 13:41 +0100 schrieb Andrey Lunyov @.***>:

Can we find a way to use the same function “useFragment” on both client and server? Well, since readFragmentData this is not part of the core framework, you can name it useFragment, but for the sake of example, and to be explicit (and avoid possible confusion) I named it differently. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

alunyov commented 1 year ago

Ugh... Accidentally pushed this to the main branch. Already reverted, I'll resubmit PR.

alunyov commented 1 year ago

Re-opened as https://github.com/relayjs/relay-examples/pull/270