-
Notifications
You must be signed in to change notification settings - Fork 172
Feat readable body #486
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
Feat readable body #486
Conversation
🦋 Changeset detectedLatest commit: 38a5df6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just 1 comment, otherwise my tiny grain of salt LGTM
|
||
export function emptyReadableStream(): ReadableStream { | ||
if (process.env.OPEN_NEXT_FORCE_NON_EMPTY_RESPONSE === "true") { | ||
return Readable.toWeb(Readable.from(["SOMETHING"])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be an empty string or does it have to be a non-empty string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty string didn't work, we could have used new Uint8Array(8)
but since it is used as a delimiter for the header part of the string i fear that this could introduce other issue later ( being misinterpreted by the streaming server )
f97b2e3
to
38a5df6
Compare
This PR change the body of
InternalResult
fromstring
toReadableStream
.This allow for edge runtime function to use streaming, and it is necessary to prepare for PPR.
This should also remove the need to add a
fakeStream
in non streaming wrapper as the stream is now always consumed if you return a body.