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

fix: static generated RSC x-component and response type selection #99

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

lazarv
Copy link
Owner

@lazarv lazarv commented Dec 16, 2024

This PR fixes issues around static generated RSC x-component files and how response type selection works to send an RSC payload. The response type selection needs to be on par with the static generation to maintain the same solution for both static and dynamic rendering.

Changes request payload to select RSC rendering. Instead of using HTTP headers, the framework now uses an URL pathname suffix, including outlet name and remote or standard RSC rendering and static generation uses the same format in filenames. This fixes #95.

Adds build options to enable compression (GZip and Brotli) and opt-out of static RSC rendering, see more about this in the updated docs.

Adds static export option to render a single outlet. This is mainly to keep consistency with the URL format right now, but might be a useful feature for SSG.

Updates the deployment Adapter API to not copy compressed files by default, but copy static RSC files and also the Vercel adapter to add the necessary
Content-Type header for static .x-component files. This fixes #94.

Removes the standalone route option and mode as it was not really useful and there are other ways to achieve the same functionality.

Copy link

✅ Documentation preview deployed to: https://react-server-docs-kkgqzss2j-lazarv-team.vercel.app

@lazarv lazarv merged commit 138ef89 into main Dec 17, 2024
8 checks passed
@lazarv lazarv deleted the fix/ssg-rsc-x-component branch December 17, 2024 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant