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(handler): return promise of stream with allReady #1083

Merged
merged 3 commits into from
Dec 22, 2024

Conversation

dai-shi
Copy link
Owner

@dai-shi dai-shi commented Dec 22, 2024

Fixes #1082
Reverts #1078

Copy link

vercel bot commented Dec 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview Dec 22, 2024 1:59am

Copy link

codesandbox-ci bot commented Dec 22, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@dai-shi dai-shi marked this pull request as ready for review December 22, 2024 01:30
@dai-shi
Copy link
Owner Author

dai-shi commented Dec 22, 2024

I think we can revert #1078 with this change. cc @rmarscher

@dai-shi dai-shi mentioned this pull request Dec 22, 2024
@dai-shi dai-shi merged commit f529c50 into main Dec 22, 2024
26 checks passed
@dai-shi dai-shi deleted the fix/handler-utils-to-return-stream-promise branch December 22, 2024 02:16
@rmarscher
Copy link
Contributor

I think we can revert #1078 with this change. cc @rmarscher

allReady waits for all of the suspense boundaries to render. #1078 just waits for the first chunk to start sending. They are not the same. I think it's best to keep the waitForFirstByte to allow more flexibility with running server-side code before the first suspense boundary.

@dai-shi
Copy link
Owner Author

dai-shi commented Dec 22, 2024

I think we can revert #1078 with this change. cc @rmarscher

allReady waits for all of the suspense boundaries to render. #1078 just waits for the first chunk to start sending. They are not the same. I think it's best to keep the waitForFirstByte to allow more flexibility with running server-side code before the first suspense boundary.

I understand it's not the same, but waitForFirstChunk is very limited either.
Isn't it correct that handler now behaves like how rsc/ssr did previously?


If waitForFirstChunk is truly what peopole want, I think it can be implemented with a separate middleware.

@rmarscher
Copy link
Contributor

Isn't it correct that handler now behaves like how rsc/ssr did previously?

Ah, ok. Yes. I just tested with v0.21.10. This is great. The handleRequest promise now waits on the
initial entry layout and page render functions. If I add a suspense boundary to a layout, it will send the outer shell when it is ready. Perfect.

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.

2 participants