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 global $R #1188

Merged
merged 5 commits into from
Dec 28, 2023
Merged

Fix global $R #1188

merged 5 commits into from
Dec 28, 2023

Conversation

lxsmnsyc
Copy link
Member

@lxsmnsyc lxsmnsyc commented Dec 27, 2023

A mistake we made is that $R only generates if we are actually serializing any data on the server. The mistake here is that we won't know if a server function, which is dependent on the same variable, would be called on the client-side.

This fix ensures that server function responses are guaranteed to have $R to be initialized.

Fixes #1186

edit:

This PR also fixes an issue with server function streaming responses (not necessarily for Promises but for AsyncIterators)

@nksaraf nksaraf merged commit 4747547 into main Dec 28, 2023
1 check passed
@lxsmnsyc lxsmnsyc deleted the seroval-global-r branch December 28, 2023 12:04
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.

[Bug?]: use server works only if start: { ssr: false } is set
3 participants