-
Notifications
You must be signed in to change notification settings - Fork 49.3k
[Flight] Add Web Stream support to the Flight Server in Node #33474
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
Conversation
da96321
to
68b7bdb
Compare
68b7bdb
to
3732f37
Compare
packages/react-server-dom-webpack/src/server/ReactFlightDOMServerNode.js
Outdated
Show resolved
Hide resolved
return stream; | ||
} | ||
|
||
function createFakeWritableFromNodeReadable(readable: any): Writable { |
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.
function createFakeWritableFromNodeReadable(readable: any): Writable { | |
function createFakeWritableFromNodeReadable(readable: Readable): Writable { |
packages/react-server-dom-turbopack/src/server/ReactFlightDOMServerNode.js
Outdated
Show resolved
Hide resolved
return stream; | ||
} | ||
|
||
function createFakeWritableFromNodeReadable(readable: any): Writable { |
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.
function createFakeWritableFromNodeReadable(readable: any): Writable { | |
function createFakeWritableFromNodeReadable(readable: Readable): Writable { |
chunk = textEncoder.encode(chunk); | ||
} | ||
controller.enqueue(chunk); | ||
// in web streams there is no backpressure so we can alwas write more |
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.
// in web streams there is no backpressure so we can alwas write more | |
// in web streams there is no backpressure so we can always write more |
return stream; | ||
} | ||
|
||
function createFakeWritableFromNodeReadable(readable: any): Writable { |
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.
function createFakeWritableFromNodeReadable(readable: any): Writable { | |
function createFakeWritableFromNodeReadable(readable: Readable): Writable { |
packages/react-server-dom-parcel/src/server/ReactFlightDOMServerNode.js
Outdated
Show resolved
Hide resolved
packages/react-server-dom-parcel/src/server/ReactFlightDOMServerNode.js
Outdated
Show resolved
Hide resolved
This was missed in facebook#33474. We're adding the new exports to the server entries only. The client entries don't need to be changed because they use `export *`.
This was missed in facebook#33474.
This needs some tweaks to the implementation and a conversion but simple enough.