-
-
Notifications
You must be signed in to change notification settings - Fork 446
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
major(next): support Next 13 and React Server Components #3214
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
b49a779
to
3bccbb5
Compare
e1113f3
to
e034ab9
Compare
e034ab9
to
858d647
Compare
858d647
to
3bc13af
Compare
e77dbf4
to
bfc8fe8
Compare
f6a6e9f
to
6f5b10c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor questions. Sourcemaps question is the only relevant for publishing and correctness.
We're missing TSDocs for the public APIs, but I think I can add those later on before publishing as well
Should I copy the EDIT: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 I haven't tested this in code, but I think we can release this as a prerelease and see what happens 😄 Wdyt?
Co-authored-by: Phil Pluckthun <phil@kitten.sh>
f20edaa
to
6a361c8
Compare
Resolves #3208
Resolves #3219
Summary
This creates a new package
@urql/next
(and replacesnext-urql
), the goal is to achieve good Next 13 support.In essence this creates two new entry points
@urql/next
the entry points for components rendered on the server and hydrated on the client, this uses a few next-internals to hydrate data as DOM streams to the client@urql/next/rsc
this solely intends to create a client that can be used and shared acrossserver components. The sharing method is
react.cache
You can play with an example here the main idea is that in Next we need a way to retrieve context values on the client so they can be shared. During the stream the values will be flushed, we use this to ensure we have all the data we need. In the example you can see that we have two suspense boundaries, neither will initiate a fetch on the client but instead you'll see a
script
tag get populated twice, one for each boundary. We read these<script
tags and add them to the ssr-exchange.TODO:
<script />
"use client"
to the@urql/next
entry-pointtext/event-stream
andmultipart/mixed
, do we just remove@defer
and@stream
during ssr? Or can we add a mechanism that ensures these are handled correctly i.e. by means of auseFragment
-like mechanism throwing promises as wellHaving an awkward problem where it's not letting me create a changeset on my fork 😅
People can still use
next-urql
for the old next supported ways