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: fix ssr flight stream injection by buffering #457

Merged
merged 8 commits into from
Jun 28, 2024

Conversation

hi-ogawa
Copy link
Owner

@hi-ogawa hi-ogawa commented Jun 28, 2024

Investigating cf e2e error in #456.

It looks like it's not guaranteed that </body> would shows up nicely in a single chunk...

[injectStreamScript] { i: 2, chunk: 'body></html>' }
[injectStreamScript] { i: 3, chunk: '' }

Let's revive StreamTransfer removed in hi-ogawa/experiments#26.
EDIT: Well, this has a problem for two-pass ssr...


Not sure but Next.js might be relying on buffering to somehow ensure tag to be not split?
https://github.com/vercel/next.js/blob/b2eafbf6b3550b1f0d643c326515814610747532/packages/next/src/server/stream-utils/node-web-streams-helper.ts#L382-L387

Copy link
Owner Author

hi-ogawa commented Jun 28, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @hi-ogawa and the rest of your teammates on Graphite Graphite

@hi-ogawa hi-ogawa marked this pull request as ready for review June 28, 2024 08:04
@hi-ogawa hi-ogawa changed the title fix: fix injectStreamScript fix: fix ssr flight stream injection Jun 28, 2024
@hi-ogawa hi-ogawa changed the title fix: fix ssr flight stream injection fix: fix ssr flight stream injection by buffering Jun 28, 2024
@hi-ogawa hi-ogawa force-pushed the chore-debug-cf branch 3 times, most recently from 1237902 to 64c7568 Compare June 28, 2024 09:28
@hi-ogawa hi-ogawa merged commit d1b24c7 into feat-loading Jun 28, 2024
6 checks passed
@hi-ogawa hi-ogawa deleted the chore-debug-cf branch June 28, 2024 09:28
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.

1 participant