-
Notifications
You must be signed in to change notification settings - Fork 323
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
Build a version of server components that works in Vite and Workers runtimes #249
Comments
There are two type of way
I am not exactly sure what to do with 1, but for two I am curious to explore loading the correct module base on file post fix. ie. if the file importing it is |
So I've been tinkering with the offical RSC and found out it directly crashes when a Provider is used. Since our dev project is full of providers, I'm testing with a dummy app without any providers (we are supposed to remove them anyway). The whole tree looks like this (CartIcon is the only Client Component): <div>
<div>hello!</div>
<CartIcon />
</div> RSC response using our custom RSC implementation (in main branch):
RSC response using the official implementation:
The only different is that the official approach is missing However, when adding Suspense to the root of the dummy app, this happens. RSC response using our custom RSC implementation (with Suspense):
RSC response using the official implementation:
@wizardlyhel @jplhomer Do you think these differences are normal? Is the Suspense supposed to appear in the payload of the official implementation? 🤔 NOTE: this is still using our custom logic in the browser to parse the RSC response, that's why I'm passing "named" instead of "chunks". |
@frandiox Yep you're spot-on. Additionally, the official RSC implementation uses |
Blocked by:
|
Update: Since |
Fix multiple option variants and available filter
This might be packaged into React core as a sibling package to
react-server-dom-webpack
, e.g.react-server-dom-vite
. Alternatively, it might be a standalone plugin or package. It depends on what direction the core team decides and what other meta-frameworks do (like Next.js).react-server
flag is present.pipeToNodeWritable
React function on the server, which generates the RSC responseOutstanding questions:
react-server
context? React usesnode --conditions react-server
. Do we need two separate server builds or dev processes (this seems inefficient)? Is there a better way to do this?react-server
condition going to work in a Workers runtime, where a single bundle is present and executed in a v8 isolate? How is this going to work?Note: This is a bit of a moving target, as we've recently embarked on a mission to help React bundle client components more efficiently: facebook/react#22314
So whatever we build for Vite should match the output of those explorations.
The text was updated successfully, but these errors were encountered: