Skip to content

Commit 4bc465a

Browse files
authored
Rename Controls to PipeableStream (#24286)
This type isn't exported so it's technically not public. This object mimics a ReadableStream. Currently this is safe to destructure and call separately but I'm not sure that's even guaranteed. It should probably be treated as a class in docs.
1 parent ece5295 commit 4bc465a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/react-dom/src/server/ReactDOMFizzServerNode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type Options = {|
4646
onError?: (error: mixed) => void,
4747
|};
4848

49-
type Controls = {|
49+
type PipeableStream = {|
5050
// Cancel any pending I/O and put anything remaining into
5151
// client rendered mode.
5252
abort(): void,
@@ -76,7 +76,7 @@ function createRequestImpl(children: ReactNodeList, options: void | Options) {
7676
function renderToPipeableStream(
7777
children: ReactNodeList,
7878
options?: Options,
79-
): Controls {
79+
): PipeableStream {
8080
const request = createRequestImpl(children, options);
8181
let hasStartedFlowing = false;
8282
startWork(request);

packages/react-server-dom-webpack/src/ReactFlightDOMServerNode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type Options = {
2626
onError?: (error: mixed) => void,
2727
};
2828

29-
type Controls = {|
29+
type PipeableStream = {|
3030
pipe<T: Writable>(destination: T): T,
3131
|};
3232

@@ -35,7 +35,7 @@ function renderToPipeableStream(
3535
webpackMap: BundlerConfig,
3636
options?: Options,
3737
context?: Array<[string, ServerContextJSONValue]>,
38-
): Controls {
38+
): PipeableStream {
3939
const request = createRequest(
4040
model,
4141
webpackMap,

0 commit comments

Comments
 (0)