@samitouri / QOS-React-2 / commits / fc3b6a4118

Fix a few typos (#22154)

Co-authored-by: Bowen Li <bowen31337@gmail.com>

Bowen committed Aug 23, 2021 at 04:11 UTC fc3b6a4118de30ae76f67c2be3d463679c11f4b7
25 files changed +59 -59
packages/react-reconciler/src/ReactFiberBeginWork.new.js
+2 -2
@@ -1901,7 +1901,7 @@ function shouldRemainOnFallback(
1901 if (current !== null) {
1902 const suspenseState: SuspenseState = current.memoizedState;
1903 if (suspenseState === null) {
1904 - // Currently showing content. Don't hide it, even if ForceSuspenseFallack
1904 + // Currently showing content. Don't hide it, even if ForceSuspenseFallback
1905 // is true. More precise name might be "ForceRemainSuspenseFallback".
1906 // Note: This is a factoring smell. Can't remain on a fallback if there's
1907 // no fallback to remain on.
@@ -1973,7 +1973,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
1973 pushSuspenseContext(workInProgress, suspenseContext);
1974
1975 // OK, the next part is confusing. We're about to reconcile the Suspense
1976 - // boundary's children. This involves some custom reconcilation logic. Two
1976 + // boundary's children. This involves some custom reconciliation logic. Two
1977 // main reasons this is so complicated.
1978 //
1979 // First, Legacy Mode has different semantics for backwards compatibility. The
packages/react-reconciler/src/ReactFiberBeginWork.old.js
+2 -2
@@ -1901,7 +1901,7 @@ function shouldRemainOnFallback(
1901 if (current !== null) {
1902 const suspenseState: SuspenseState = current.memoizedState;
1903 if (suspenseState === null) {
1904 - // Currently showing content. Don't hide it, even if ForceSuspenseFallack
1904 + // Currently showing content. Don't hide it, even if ForceSuspenseFallback
1905 // is true. More precise name might be "ForceRemainSuspenseFallback".
1906 // Note: This is a factoring smell. Can't remain on a fallback if there's
1907 // no fallback to remain on.
@@ -1973,7 +1973,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
1973 pushSuspenseContext(workInProgress, suspenseContext);
1974
1975 // OK, the next part is confusing. We're about to reconcile the Suspense
1976 - // boundary's children. This involves some custom reconcilation logic. Two
1976 + // boundary's children. This involves some custom reconciliation logic. Two
1977 // main reasons this is so complicated.
1978 //
1979 // First, Legacy Mode has different semantics for backwards compatibility. The
packages/react-reconciler/src/ReactFiberCommitWork.new.js
+1 -1
@@ -2095,7 +2095,7 @@ function commitMutationEffectsOnFiber(finishedWork: Fiber, root: FiberRoot) {
2095 // TODO: The factoring of this phase could probably be improved. Consider
2096 // switching on the type of work before checking the flags. That's what
2097 // we do in all the other phases. I think this one is only different
2098 - // because of the shared reconcilation logic below.
2098 + // because of the shared reconciliation logic below.
2099 const flags = finishedWork.flags;
2100
2101 if (flags & ContentReset) {
packages/react-reconciler/src/ReactFiberCommitWork.old.js
+1 -1
@@ -2095,7 +2095,7 @@ function commitMutationEffectsOnFiber(finishedWork: Fiber, root: FiberRoot) {
2095 // TODO: The factoring of this phase could probably be improved. Consider
2096 // switching on the type of work before checking the flags. That's what
2097 // we do in all the other phases. I think this one is only different
2098 - // because of the shared reconcilation logic below.
2098 + // because of the shared reconciliation logic below.
2099 const flags = finishedWork.flags;
2100
2101 if (flags & ContentReset) {
packages/react-reconciler/src/ReactFiberCompleteWork.new.js
+7 -7
@@ -1231,7 +1231,7 @@ function completeWork(
1231
1232 // If this is a newly suspended tree, it might not get committed as
1233 // part of the second pass. In that case nothing will subscribe to
1234 - // its thennables. Instead, we'll transfer its thennables to the
1234 + // its thenables. Instead, we'll transfer its thenables to the
1235 // SuspenseList so that it can retry if they resolve.
1236 // There might be multiple of these in the list but since we're
1237 // going to wait for all of them anyway, it doesn't really matter
@@ -1241,9 +1241,9 @@ function completeWork(
1241 // We might bail out of the loop before finding any but that
1242 // doesn't matter since that means that the other boundaries that
1243 // we did find already has their listeners attached.
1244 - const newThennables = suspended.updateQueue;
1245 - if (newThennables !== null) {
1246 - workInProgress.updateQueue = newThennables;
1244 + const newThenables = suspended.updateQueue;
1245 + if (newThenables !== null) {
1246 + workInProgress.updateQueue = newThenables;
1247 workInProgress.flags |= Update;
1248 }
1249
@@ -1303,9 +1303,9 @@ function completeWork(
1303
1304 // Ensure we transfer the update queue to the parent so that it doesn't
1305 // get lost if this row ends up dropped during a second pass.
1306 - const newThennables = suspended.updateQueue;
1307 - if (newThennables !== null) {
1308 - workInProgress.updateQueue = newThennables;
1306 + const newThenables = suspended.updateQueue;
1307 + if (newThenables !== null) {
1308 + workInProgress.updateQueue = newThenables;
1309 workInProgress.flags |= Update;
1310 }
1311
packages/react-reconciler/src/ReactFiberCompleteWork.old.js
+7 -7
@@ -1231,7 +1231,7 @@ function completeWork(
1231
1232 // If this is a newly suspended tree, it might not get committed as
1233 // part of the second pass. In that case nothing will subscribe to
1234 - // its thennables. Instead, we'll transfer its thennables to the
1234 + // its thenables. Instead, we'll transfer its thenables to the
1235 // SuspenseList so that it can retry if they resolve.
1236 // There might be multiple of these in the list but since we're
1237 // going to wait for all of them anyway, it doesn't really matter
@@ -1241,9 +1241,9 @@ function completeWork(
1241 // We might bail out of the loop before finding any but that
1242 // doesn't matter since that means that the other boundaries that
1243 // we did find already has their listeners attached.
1244 - const newThennables = suspended.updateQueue;
1245 - if (newThennables !== null) {
1246 - workInProgress.updateQueue = newThennables;
1244 + const newThenables = suspended.updateQueue;
1245 + if (newThenables !== null) {
1246 + workInProgress.updateQueue = newThenables;
1247 workInProgress.flags |= Update;
1248 }
1249
@@ -1303,9 +1303,9 @@ function completeWork(
1303
1304 // Ensure we transfer the update queue to the parent so that it doesn't
1305 // get lost if this row ends up dropped during a second pass.
1306 - const newThennables = suspended.updateQueue;
1307 - if (newThennables !== null) {
1308 - workInProgress.updateQueue = newThennables;
1306 + const newThenables = suspended.updateQueue;
1307 + if (newThenables !== null) {
1308 + workInProgress.updateQueue = newThenables;
1309 workInProgress.flags |= Update;
1310 }
1311
packages/react-reconciler/src/ReactFiberFlags.js
+2 -2
@@ -62,7 +62,7 @@ export const MountPassiveDev = /* */ 0b10000000000000000000000;
62 // don't contain effects, by checking subtreeFlags.
63
64 export const BeforeMutationMask =
65 - // TODO: Remove Update flag from before mutation phase by re-landing Visiblity
65 + // TODO: Remove Update flag from before mutation phase by re-landing Visibility
66 // flag logic (see #20043)
67 Update |
68 Snapshot |
@@ -88,6 +88,6 @@ export const LayoutMask = Update | Callback | Ref | Visibility;
88 export const PassiveMask = Passive | ChildDeletion;
89
90 // Union of tags that don't get reset on clones.
91 -// This allows certain concepts to persist without recalculting them,
91 +// This allows certain concepts to persist without recalculating them,
92 // e.g. whether a subtree contains passive effects or portals.
93 export const StaticMask = LayoutStatic | PassiveStatic | RefStatic;
packages/react-reconciler/src/ReactFiberHooks.new.js
+6 -6
@@ -449,7 +449,7 @@ export function renderWithHooks<Props, SecondArg>(
449 }
450
451 // We can assume the previous dispatcher is always this one, since we set it
452 - // at the beginning of the render phase and there's no re-entrancy.
452 + // at the beginning of the render phase and there's no re-entrance.
453 ReactCurrentDispatcher.current = ContextOnlyDispatcher;
454
455 if (__DEV__) {
@@ -553,7 +553,7 @@ export function bailoutHooks(
553
554 export function resetHooksAfterThrow(): void {
555 // We can assume the previous dispatcher is always this one, since we set it
556 - // at the beginning of the render phase and there's no re-entrancy.
556 + // at the beginning of the render phase and there's no re-entrance.
557 ReactCurrentDispatcher.current = ContextOnlyDispatcher;
558
559 if (didScheduleRenderPhaseUpdate) {
@@ -934,7 +934,7 @@ type MutableSourceMemoizedState<Source, Snapshot> = {|
934 subscribe: MutableSourceSubscribeFn<Source, Snapshot>,
935 |};
936
937 -function readFromUnsubcribedMutableSource<Source, Snapshot>(
937 +function readFromUnsubscribedMutableSource<Source, Snapshot>(
938 root: FiberRoot,
939 source: MutableSource<Source>,
940 getSnapshot: MutableSourceGetSnapshotFn<Source, Snapshot>,
@@ -1074,7 +1074,7 @@ function useMutableSource<Source, Snapshot>(
1074
1075 // eslint-disable-next-line prefer-const
1076 let [currentSnapshot, setSnapshot] = dispatcher.useState(() =>
1077 - readFromUnsubcribedMutableSource(root, source, getSnapshot),
1077 + readFromUnsubscribedMutableSource(root, source, getSnapshot),
1078 );
1079 let snapshot = currentSnapshot;
1080
@@ -1208,7 +1208,7 @@ function useMutableSource<Source, Snapshot>(
1208 ): any);
1209 stateHook.queue = newQueue;
1210 stateHook.baseQueue = null;
1211 - snapshot = readFromUnsubcribedMutableSource(root, source, getSnapshot);
1211 + snapshot = readFromUnsubscribedMutableSource(root, source, getSnapshot);
1212 stateHook.memoizedState = stateHook.baseState = snapshot;
1213 }
1214
@@ -1949,7 +1949,7 @@ function dispatchAction<S, A>(
1949 // This is the first update. Create a circular list.
1950 update.next = update;
1951 // At the end of the current render, this queue's interleaved updates will
1952 - // be transfered to the pending queue.
1952 + // be transferred to the pending queue.
1953 pushInterleavedQueue(queue);
1954 } else {
1955 update.next = interleaved.next;
packages/react-reconciler/src/ReactFiberHooks.old.js
+6 -6
@@ -449,7 +449,7 @@ export function renderWithHooks<Props, SecondArg>(
449 }
450
451 // We can assume the previous dispatcher is always this one, since we set it
452 - // at the beginning of the render phase and there's no re-entrancy.
452 + // at the beginning of the render phase and there's no re-entrance.
453 ReactCurrentDispatcher.current = ContextOnlyDispatcher;
454
455 if (__DEV__) {
@@ -553,7 +553,7 @@ export function bailoutHooks(
553
554 export function resetHooksAfterThrow(): void {
555 // We can assume the previous dispatcher is always this one, since we set it
556 - // at the beginning of the render phase and there's no re-entrancy.
556 + // at the beginning of the render phase and there's no re-entrance.
557 ReactCurrentDispatcher.current = ContextOnlyDispatcher;
558
559 if (didScheduleRenderPhaseUpdate) {
@@ -934,7 +934,7 @@ type MutableSourceMemoizedState<Source, Snapshot> = {|
934 subscribe: MutableSourceSubscribeFn<Source, Snapshot>,
935 |};
936
937 -function readFromUnsubcribedMutableSource<Source, Snapshot>(
937 +function readFromUnsubscribedMutableSource<Source, Snapshot>(
938 root: FiberRoot,
939 source: MutableSource<Source>,
940 getSnapshot: MutableSourceGetSnapshotFn<Source, Snapshot>,
@@ -1074,7 +1074,7 @@ function useMutableSource<Source, Snapshot>(
1074
1075 // eslint-disable-next-line prefer-const
1076 let [currentSnapshot, setSnapshot] = dispatcher.useState(() =>
1077 - readFromUnsubcribedMutableSource(root, source, getSnapshot),
1077 + readFromUnsubscribedMutableSource(root, source, getSnapshot),
1078 );
1079 let snapshot = currentSnapshot;
1080
@@ -1208,7 +1208,7 @@ function useMutableSource<Source, Snapshot>(
1208 ): any);
1209 stateHook.queue = newQueue;
1210 stateHook.baseQueue = null;
1211 - snapshot = readFromUnsubcribedMutableSource(root, source, getSnapshot);
1211 + snapshot = readFromUnsubscribedMutableSource(root, source, getSnapshot);
1212 stateHook.memoizedState = stateHook.baseState = snapshot;
1213 }
1214
@@ -1949,7 +1949,7 @@ function dispatchAction<S, A>(
1949 // This is the first update. Create a circular list.
1950 update.next = update;
1951 // At the end of the current render, this queue's interleaved updates will
1952 - // be transfered to the pending queue.
1952 + // be transferred to the pending queue.
1953 pushInterleavedQueue(queue);
1954 } else {
1955 update.next = interleaved.next;
packages/react-reconciler/src/ReactFiberInterleavedUpdates.new.js
+1 -1
@@ -12,7 +12,7 @@ import type {SharedQueue as ClassQueue} from './ReactUpdateQueue.new';
12
13 // An array of all update queues that received updates during the current
14 // render. When this render exits, either because it finishes or because it is
15 -// interrupted, the interleaved updates will be transfered onto the main part
15 +// interrupted, the interleaved updates will be transferred onto the main part
16 // of the queue.
17 let interleavedQueues: Array<
18 HookQueue<any, any> | ClassQueue<any>,
packages/react-reconciler/src/ReactFiberInterleavedUpdates.old.js
+1 -1
@@ -12,7 +12,7 @@ import type {SharedQueue as ClassQueue} from './ReactUpdateQueue.old';
12
13 // An array of all update queues that received updates during the current
14 // render. When this render exits, either because it finishes or because it is
15 -// interrupted, the interleaved updates will be transfered onto the main part
15 +// interrupted, the interleaved updates will be transferred onto the main part
16 // of the queue.
17 let interleavedQueues: Array<
18 HookQueue<any, any> | ClassQueue<any>,
packages/react-reconciler/src/ReactFiberNewContext.new.js
+3 -3
@@ -192,7 +192,7 @@ function propagateContextChange_eager<T>(
192 context: ReactContext<T>,
193 renderLanes: Lanes,
194 ): void {
195 - // Only used by eager implemenation
195 + // Only used by eager implementation
196 if (enableLazyContextPropagation) {
197 return;
198 }
@@ -322,7 +322,7 @@ function propagateContextChanges<T>(
322 renderLanes: Lanes,
323 forcePropagateEntireTree: boolean,
324 ): void {
325 - // Only used by lazy implemenation
325 + // Only used by lazy implementation
326 if (!enableLazyContextPropagation) {
327 return;
328 }
@@ -351,7 +351,7 @@ function propagateContextChanges<T>(
351 if (dependency.context === context) {
352 // Match! Schedule an update on this fiber.
353
354 - // In the lazy implemenation, don't mark a dirty flag on the
354 + // In the lazy implementation, don't mark a dirty flag on the
355 // dependency itself. Not all changes are propagated, so we can't
356 // rely on the propagation function alone to determine whether
357 // something has changed; the consumer will check. In the future, we
packages/react-reconciler/src/ReactFiberNewContext.old.js
+3 -3
@@ -192,7 +192,7 @@ function propagateContextChange_eager<T>(
192 context: ReactContext<T>,
193 renderLanes: Lanes,
194 ): void {
195 - // Only used by eager implemenation
195 + // Only used by eager implementation
196 if (enableLazyContextPropagation) {
197 return;
198 }
@@ -322,7 +322,7 @@ function propagateContextChanges<T>(
322 renderLanes: Lanes,
323 forcePropagateEntireTree: boolean,
324 ): void {
325 - // Only used by lazy implemenation
325 + // Only used by lazy implementation
326 if (!enableLazyContextPropagation) {
327 return;
328 }
@@ -351,7 +351,7 @@ function propagateContextChanges<T>(
351 if (dependency.context === context) {
352 // Match! Schedule an update on this fiber.
353
354 - // In the lazy implemenation, don't mark a dirty flag on the
354 + // In the lazy implementation, don't mark a dirty flag on the
355 // dependency itself. Not all changes are propagated, so we can't
356 // rely on the propagation function alone to determine whether
357 // something has changed; the consumer will check. In the future, we
packages/react-reconciler/src/ReactFiberReconciler.new.js
+1 -1
@@ -381,7 +381,7 @@ function markRetryLaneImpl(fiber: Fiber, retryLane: Lane) {
381 }
382 }
383
384 -// Increases the priority of thennables when they resolve within this boundary.
384 +// Increases the priority of thenables when they resolve within this boundary.
385 function markRetryLaneIfNotHydrated(fiber: Fiber, retryLane: Lane) {
386 markRetryLaneImpl(fiber, retryLane);
387 const alternate = fiber.alternate;
packages/react-reconciler/src/ReactFiberReconciler.old.js
+1 -1
@@ -381,7 +381,7 @@ function markRetryLaneImpl(fiber: Fiber, retryLane: Lane) {
381 }
382 }
383
384 -// Increases the priority of thennables when they resolve within this boundary.
384 +// Increases the priority of thenables when they resolve within this boundary.
385 function markRetryLaneIfNotHydrated(fiber: Fiber, retryLane: Lane) {
386 markRetryLaneImpl(fiber, retryLane);
387 const alternate = fiber.alternate;
packages/react-reconciler/src/ReactFiberSyncTaskQueue.new.js
+1 -1
@@ -50,7 +50,7 @@ export function flushSyncCallbacksOnlyInLegacyMode() {
50
51 export function flushSyncCallbacks() {
52 if (!isFlushingSyncQueue && syncQueue !== null) {
53 - // Prevent re-entrancy.
53 + // Prevent re-entrance.
54 isFlushingSyncQueue = true;
55 let i = 0;
56 const previousUpdatePriority = getCurrentUpdatePriority();
packages/react-reconciler/src/ReactFiberSyncTaskQueue.old.js
+1 -1
@@ -50,7 +50,7 @@ export function flushSyncCallbacksOnlyInLegacyMode() {
50
51 export function flushSyncCallbacks() {
52 if (!isFlushingSyncQueue && syncQueue !== null) {
53 - // Prevent re-entrancy.
53 + // Prevent re-entrance.
54 isFlushingSyncQueue = true;
55 let i = 0;
56 const previousUpdatePriority = getCurrentUpdatePriority();
packages/react-reconciler/src/ReactUpdateQueue.new.js
+1 -1
@@ -230,7 +230,7 @@ export function enqueueUpdate<State>(
230 // This is the first update. Create a circular list.
231 update.next = update;
232 // At the end of the current render, this queue's interleaved updates will
233 - // be transfered to the pending queue.
233 + // be transferred to the pending queue.
234 pushInterleavedQueue(sharedQueue);
235 } else {
236 update.next = interleaved.next;
packages/react-reconciler/src/ReactUpdateQueue.old.js
+1 -1
@@ -230,7 +230,7 @@ export function enqueueUpdate<State>(
230 // This is the first update. Create a circular list.
231 update.next = update;
232 // At the end of the current render, this queue's interleaved updates will
233 - // be transfered to the pending queue.
233 + // be transferred to the pending queue.
234 pushInterleavedQueue(sharedQueue);
235 } else {
236 update.next = interleaved.next;
packages/react-reconciler/src/__tests__/ReactEffectOrdering-test.js
+2 -2
@@ -32,7 +32,7 @@ describe('ReactHooksWithNoopRenderer', () => {
32 useLayoutEffect = React.useLayoutEffect;
33 });
34
35 - test('layout unmmouts on deletion are fired in parent -> child order', async () => {
35 + test('layout unmounts on deletion are fired in parent -> child order', async () => {
36 const root = ReactNoop.createRoot();
37
38 function Parent() {
@@ -59,7 +59,7 @@ describe('ReactHooksWithNoopRenderer', () => {
59 expect(Scheduler).toHaveYielded(['Unmount parent', 'Unmount child']);
60 });
61
62 - test('passive unmmouts on deletion are fired in parent -> child order', async () => {
62 + test('passive unmounts on deletion are fired in parent -> child order', async () => {
63 const root = ReactNoop.createRoot();
64
65 function Parent() {
packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js
+1 -1
@@ -1517,7 +1517,7 @@ describe('ReactHooksWithNoopRenderer', () => {
1517 });
1518 });
1519
1520 - it('does not show a warning when a component updates a childs state from within passive unmount function', () => {
1520 + it('does not show a warning when a component updates a child state from within passive unmount function', () => {
1521 function Parent() {
1522 Scheduler.unstable_yieldValue('Parent');
1523 const updaterRef = useRef(null);
packages/react-reconciler/src/__tests__/useMutableSource-test.internal.js
+5 -5
@@ -179,7 +179,7 @@ describe('useMutableSource', () => {
179 source.value = 'two';
180 expect(Scheduler).toFlushAndYieldThrough(['a:two', 'b:two']);
181
182 - // Umounting a component should remove its subscription.
182 + // Unmounting a component should remove its subscription.
183 ReactNoop.renderToRootWithID(
184 <>
185 <Component
@@ -196,7 +196,7 @@ describe('useMutableSource', () => {
196 ReactNoop.flushPassiveEffects();
197 expect(source.listenerCount).toBe(1);
198
199 - // Umounting a root should remove the remaining event listeners
199 + // Unmounting a root should remove the remaining event listeners
200 ReactNoop.unmountRootWithID('root');
201 expect(Scheduler).toFlushAndYield([]);
202 ReactNoop.flushPassiveEffects();
@@ -1789,7 +1789,7 @@ describe('useMutableSource', () => {
1789
1790 if (__DEV__) {
1791 // See https://github.com/facebook/react/issues/19948
1792 - describe('side effecte detection', () => {
1792 + describe('side effects detection', () => {
1793 it('should throw if a mutable source is mutated during render', () => {
1794 const source = createSource(0);
1795 const mutableSource = createMutableSource(
@@ -1805,7 +1805,7 @@ describe('useMutableSource', () => {
1805 defaultSubscribe,
1806 );
1807 Scheduler.unstable_yieldValue('MutateDuringRead:' + value);
1808 - // Note that mutating an exeternal value during render is a side effect and is not supported.
1808 + // Note that mutating an external value during render is a side effect and is not supported.
1809 source.value = mutatedValueInRender++;
1810 return null;
1811 }
@@ -1848,7 +1848,7 @@ describe('useMutableSource', () => {
1848 defaultSubscribe,
1849 );
1850 Scheduler.unstable_yieldValue('MutateDuringRead:' + value);
1851 - // Note that mutating an exeternal value during render is a side effect and is not supported.
1851 + // Note that mutating an external value during render is a side effect and is not supported.
1852 if (value === 'initial') {
1853 source.value = 'updated';
1854 }
packages/react/src/ReactAct.js
+1 -1
@@ -203,7 +203,7 @@ let isFlushing = false;
203 function flushActQueue(queue) {
204 if (__DEV__) {
205 if (!isFlushing) {
206 - // Prevent re-entrancy.
206 + // Prevent re-entrance.
207 isFlushing = true;
208 let i = 0;
209 try {
packages/scheduler/src/forks/Scheduler.js
+1 -1
@@ -78,7 +78,7 @@ var isSchedulerPaused = false;
78 var currentTask = null;
79 var currentPriorityLevel = NormalPriority;
80
81 -// This is set while performing work, to prevent re-entrancy.
81 +// This is set while performing work, to prevent re-entrance.
82 var isPerformingWork = false;
83
84 var isHostCallbackScheduled = false;
packages/scheduler/src/forks/SchedulerMock.js
+1 -1
@@ -62,7 +62,7 @@ var isSchedulerPaused = false;
62 var currentTask = null;
63 var currentPriorityLevel = NormalPriority;
64
65 -// This is set while performing work, to prevent re-entrancy.
65 +// This is set while performing work, to prevent re-entrance.
66 var isPerformingWork = false;
67
68 var isHostCallbackScheduled = false;