DEMO rsc vite ssr minimal (do not merge) #10277
Closed
+90
−152
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Don't look at the diff. It's pretty meaningless.I cleaned it up!What I've done is try to get a minimal reproduction example going. So I've pretty much put all our SSR+RSC logic in the main
runFeServer
file. If you strip away all the FW stuff we do there actually isn't that much to it 🙂To see what's going on here, first get the
test-project-rsc-external-packages-and-cells
project running onmain
. Fromweb/dist/client/assets
you need the built version ofAboutCounter
, something likeweb/dist/client/assets/rsc-AboutCounter.tsx-2-ChTgbQz5.mjs
.Now check out this PR.
Find
packages/vite/src/runFeServer.ts
and update the path toAboutCounter
in both two places in the flight data at the bottom of that file to match the path on your computer.Do a clean rebuild of the framework, then tarsync to your test project.
Now build and serve the test project and go to http://localhost:8910
...and you should see it fail 😆
Now here comes the total hack 😃
Go to the built version of
AboutCounter
and change the React import at the top to look like thisserve
your test project again, and this time if you go to localhost:8910 it should work! You should get the SSRed version of the About page.