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

DEMO rsc vite ssr minimal (do not merge) #10277

Closed
wants to merge 2 commits into from

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Mar 23, 2024

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 on main. From web/dist/client/assets you need the built version of AboutCounter, something like web/dist/client/assets/rsc-AboutCounter.tsx-2-ChTgbQz5.mjs.

Now check out this PR.
Find packages/vite/src/runFeServer.ts and update the path to AboutCounter 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 😆
image

Now here comes the total hack 😃

Go to the built version of AboutCounter and change the React import at the top to look like this
image

serve 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.

@Tobbe Tobbe force-pushed the tobbe-rsc-vite-ssr-minimal branch from 9a8c39e to 4b1337c Compare March 23, 2024 17:16
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.

None yet

1 participant