Skip to content

Commit 0fa77e1

Browse files
committed
Rename to progressiveChunkSize
1 parent 6092c1b commit 0fa77e1

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818

1919
type Options = {
2020
signal?: AbortSignal,
21-
maxBoundarySize?: number,
21+
progressiveChunkSize?: number,
2222
};
2323

2424
function renderToReadableStream(
@@ -39,7 +39,7 @@ function renderToReadableStream(
3939
request = createRequest(
4040
children,
4141
controller,
42-
options ? options.maxBoundarySize : undefined,
42+
options ? options.progressiveChunkSize : undefined,
4343
);
4444
startWork(request);
4545
},

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function createDrainHandler(destination, request) {
2222
}
2323

2424
type Options = {
25-
maxBoundarySize?: number,
25+
progressiveChunkSize?: number,
2626
};
2727

2828
type Controls = {
@@ -39,7 +39,7 @@ function pipeToNodeWritable(
3939
const request = createRequest(
4040
children,
4141
destination,
42-
options ? options.maxBoundarySize : undefined,
42+
options ? options.progressiveChunkSize : undefined,
4343
);
4444
let hasStartedFlowing = false;
4545
startWork(request);

packages/react-noop-renderer/src/ReactNoopServer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ const ReactNoopServer = ReactFizzServer({
211211
});
212212

213213
type Options = {
214-
maxBoundarySize?: number,
214+
progressiveChunkSize?: number,
215215
};
216216

217217
function render(children: React$Element<any>, options?: Options): Destination {
@@ -227,7 +227,7 @@ function render(children: React$Element<any>, options?: Options): Destination {
227227
const request = ReactNoopServer.createRequest(
228228
children,
229229
destination,
230-
options ? options.maxBoundarySize : undefined,
230+
options ? options.progressiveChunkSize : undefined,
231231
);
232232
ReactNoopServer.startWork(request);
233233
ReactNoopServer.startFlowing(request);

packages/react-server/src/ReactFizzServer.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const CLOSED = 2;
9999
type Request = {
100100
+destination: Destination,
101101
+responseState: ResponseState,
102-
+maxBoundarySize: number,
102+
+progressiveChunkSize: number,
103103
status: 0 | 1 | 2,
104104
nextSegmentId: number,
105105
allPendingWork: number, // when it reaches zero, we can close the connection.
@@ -128,19 +128,19 @@ type Request = {
128128
// about 12.5kb of content per 500ms. Not counting starting latency for the first
129129
// paint.
130130
// 500 * 1024 / 8 * .8 * 0.5 / 2
131-
const DEFAULT_MAX_BOUNDARY_SIZE = 12800;
131+
const DEFAULT_PROGRESSIVE_CHUNK_SIZE = 12800;
132132

133133
export function createRequest(
134134
children: ReactNodeList,
135135
destination: Destination,
136-
maxBoundarySize: number = DEFAULT_MAX_BOUNDARY_SIZE,
136+
progressiveChunkSize: number = DEFAULT_PROGRESSIVE_CHUNK_SIZE,
137137
): Request {
138138
const pingedWork = [];
139139
const abortSet: Set<SuspendedWork> = new Set();
140140
const request = {
141141
destination,
142142
responseState: createResponseState(),
143-
maxBoundarySize,
143+
progressiveChunkSize,
144144
status: BUFFERING,
145145
nextSegmentId: 0,
146146
allPendingWork: 0,
@@ -660,7 +660,7 @@ function flushSegment(
660660
flushSubtree(request, destination, segment);
661661

662662
return writeEndSuspenseBoundary(destination);
663-
} else if (boundary.byteSize > request.maxBoundarySize) {
663+
} else if (boundary.byteSize > request.progressiveChunkSize) {
664664
// This boundary is large and will be emitted separately so that we can progressively show
665665
// other content. We add it to the queue during the flush because we have to ensure that
666666
// the parent flushes first so that there's something to inject it into.

0 commit comments

Comments
 (0)