@@ -62,7 +62,7 @@ type SuspenseBoundary = {
6262 pendingTasks: number, // when it reaches zero we can show this boundary's content
6363 completedSegments: Array<Segment>, // completed but not yet flushed segments.
6464 byteSize: number, // used to determine whether to inline children boundaries.
65- fallbackAbortableTask : Set<Task>, // used to cancel task on the fallback if the boundary completes or gets canceled.
65+ fallbackAbortableTasks : Set<Task>, // used to cancel task on the fallback if the boundary completes or gets canceled.
6666};
6767
6868type Task = {
@@ -107,8 +107,8 @@ type Request = {
107107 allPendingTasks: number, // when it reaches zero, we can close the connection.
108108 pendingRootTasks: number, // when this reaches zero, we've finished at least the root boundary.
109109 completedRootSegment: null | Segment, // Completed but not yet flushed root segments.
110- abortableTask : Set<Task>,
111- pingedTask : Array<Task>,
110+ abortableTasks : Set<Task>,
111+ pingedTasks : Array<Task>,
112112 // Queues to flush in order of priority
113113 clientRenderedBoundaries: Array<SuspenseBoundary>, // Errored or client rendered but not yet flushed.
114114 completedBoundaries: Array<SuspenseBoundary>, // Completed but not yet fully flushed boundaries to show.
@@ -151,7 +151,7 @@ export function createRequest(
151151 onCompleteAll: () => void = noop,
152152 onReadyToStream: () => void = noop,
153153): Request {
154- const pingedTask = [];
154+ const pingedTasks = [];
155155 const abortSet: Set<Task> = new Set();
156156 const request = {
157157 destination,
@@ -162,8 +162,8 @@ export function createRequest(
162162 allPendingTasks: 0,
163163 pendingRootTasks: 0,
164164 completedRootSegment: null,
165- abortableTask : abortSet,
166- pingedTask: pingedTask ,
165+ abortableTasks : abortSet,
166+ pingedTasks: pingedTasks ,
167167 clientRenderedBoundaries: [],
168168 completedBoundaries: [],
169169 partialBoundaries: [],
@@ -184,21 +184,21 @@ export function createRequest(
184184 rootContext,
185185 null,
186186 );
187- pingedTask .push(rootTask);
187+ pingedTasks .push(rootTask);
188188 return request;
189189}
190190
191191function pingTask(request: Request, task: Task): void {
192- const pingedTask = request.pingedTask ;
193- pingedTask .push(task);
194- if (pingedTask .length === 1) {
192+ const pingedTasks = request.pingedTasks ;
193+ pingedTasks .push(task);
194+ if (pingedTasks .length === 1) {
195195 scheduleWork(() => performWork(request));
196196 }
197197}
198198
199199function createSuspenseBoundary(
200200 request: Request,
201- fallbackAbortableTask : Set<Task>,
201+ fallbackAbortableTasks : Set<Task>,
202202): SuspenseBoundary {
203203 return {
204204 id: createSuspenseBoundaryID(request.responseState),
@@ -208,7 +208,7 @@ function createSuspenseBoundary(
208208 forceClientRender: false,
209209 completedSegments: [],
210210 byteSize: 0,
211- fallbackAbortableTask ,
211+ fallbackAbortableTasks ,
212212 };
213213}
214214
@@ -385,7 +385,7 @@ function renderNode(request: Request, task: Task, node: ReactNodeList): void {
385385 // no parent segment so there's nothing to wait on.
386386 contentRootSegment.parentFlushed = true;
387387
388- // Currently this is running synchronously. We could instead schedule this to pingedTask .
388+ // Currently this is running synchronously. We could instead schedule this to pingedTasks .
389389 // I suspect that there might be some efficiency benefits from not creating the suspended task
390390 // and instead just using the stack if possible.
391391 // TODO: Call this directly instead of messing with saving and restoring contexts.
@@ -430,7 +430,7 @@ function renderNode(request: Request, task: Task, node: ReactNodeList): void {
430430 );
431431 // TODO: This should be queued at a separate lower priority queue so that we only task
432432 // on preparing fallbacks if we don't have any more main content to task on.
433- request.pingedTask .push(suspendedFallbackTask);
433+ request.pingedTasks .push(suspendedFallbackTask);
434434 } else {
435435 throw new Error('Not yet implemented element type.');
436436 }
@@ -501,8 +501,8 @@ function abortTask(task: Task): void {
501501
502502 // If this boundary was still pending then we haven't already cancelled its fallbacks.
503503 // We'll need to abort the fallbacks, which will also error that parent boundary.
504- boundary.fallbackAbortableTask .forEach(abortTask, request);
505- boundary.fallbackAbortableTask .clear();
504+ boundary.fallbackAbortableTasks .forEach(abortTask, request);
505+ boundary.fallbackAbortableTasks .clear();
506506
507507 if (!boundary.forceClientRender) {
508508 boundary.forceClientRender = true;
@@ -541,8 +541,8 @@ function finishedTask(
541541 } else if (boundary.pendingTasks === 0) {
542542 // This must have been the last segment we were waiting on. This boundary is now complete.
543543 // We can now cancel any pending task on the fallback since we won't need to show it anymore.
544- boundary.fallbackAbortableTask .forEach(abortTaskSoft, request);
545- boundary.fallbackAbortableTask .clear();
544+ boundary.fallbackAbortableTasks .forEach(abortTaskSoft, request);
545+ boundary.fallbackAbortableTasks .clear();
546546 if (segment.parentFlushed) {
547547 // Our parent segment already flushed, so we need to schedule this segment to be emitted.
548548 boundary.completedSegments.push(segment);
@@ -625,13 +625,13 @@ function performWork(request: Request): void {
625625 ReactCurrentDispatcher.current = Dispatcher;
626626
627627 try {
628- const pingedTask = request.pingedTask ;
628+ const pingedTasks = request.pingedTasks ;
629629 let i;
630- for (i = 0; i < pingedTask .length; i++) {
631- const task = pingedTask [i];
630+ for (i = 0; i < pingedTasks .length; i++) {
631+ const task = pingedTasks [i];
632632 retryTask(request, task);
633633 }
634- pingedTask .splice(0, i);
634+ pingedTasks .splice(0, i);
635635 if (request.status === FLOWING) {
636636 flushCompletedQueues(request);
637637 }
@@ -953,14 +953,14 @@ function flushCompletedQueues(request: Request): void {
953953 flushBuffered(destination);
954954 if (
955955 request.allPendingTasks === 0 &&
956- request.pingedTask .length === 0 &&
956+ request.pingedTasks .length === 0 &&
957957 request.clientRenderedBoundaries.length === 0 &&
958958 request.completedBoundaries.length === 0
959959 // We don't need to check any partially completed segments because
960960 // either they have pending task or they're complete.
961961 ) {
962962 if (__DEV__) {
963- if (request.abortableTask .size !== 0) {
963+ if (request.abortableTasks .size !== 0) {
964964 console.error(
965965 'There was still abortable task at the root when we closed. This is a bug in React.',
966966 );
@@ -992,9 +992,9 @@ export function startFlowing(request: Request): void {
992992// This is called to early terminate a request. It puts all pending boundaries in client rendered state.
993993export function abort(request: Request): void {
994994 try {
995- const abortableTask = request.abortableTask ;
996- abortableTask .forEach(abortTask, request);
997- abortableTask .clear();
995+ const abortableTasks = request.abortableTasks ;
996+ abortableTasks .forEach(abortTask, request);
997+ abortableTasks .clear();
998998 if (request.status === FLOWING) {
999999 flushCompletedQueues(request);
10001000 }
0 commit comments