-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Node.js Stream support (#65704)
WIP - 1:1 implementation of stream helpers utility file to support Node.js streams. Uses multiplex pattern. Also includes minor testing where necessary. --------- Co-authored-by: Josh Story <[email protected]>
- Loading branch information
1 parent
67ed8e4
commit f846f7c
Showing
25 changed files
with
1,359 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import type { Readable } from 'node:stream' | ||
import { RSC_CONTENT_TYPE_HEADER } from '../../client/components/app-router-headers' | ||
import RenderResult from '../render-result' | ||
|
||
/** | ||
* Flight Response is always set to RSC_CONTENT_TYPE_HEADER to ensure it does not get interpreted as HTML. | ||
*/ | ||
export class FlightRenderResult extends RenderResult { | ||
constructor(response: string | ReadableStream<Uint8Array>) { | ||
constructor(response: string | ReadableStream<Uint8Array> | Readable) { | ||
super(response, { contentType: RSC_CONTENT_TYPE_HEADER, metadata: {} }) | ||
} | ||
} |
Oops, something went wrong.