Skip to content

Commit b8cfda1

Browse files
authored
changed Transitions type to Array<Transition> (#24249)
Changed the Transitions type to Array<Transition> because Transitions was confusing
1 parent c89a15c commit b8cfda1

9 files changed

+14
-24
lines changed

packages/react-reconciler/src/ReactFiberLane.new.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
*/
99

1010
import type {FiberRoot} from './ReactInternalTypes';
11-
import type {
12-
Transition,
13-
Transitions,
14-
} from './ReactFiberTracingMarkerComponent.new';
11+
import type {Transition} from './ReactFiberTracingMarkerComponent.new';
1512

1613
// TODO: Ideally these types would be opaque but that doesn't work well with
1714
// our reconciler fork infra, since these leak into non-reconciler packages.
@@ -824,7 +821,7 @@ export function addTransitionToLanesMap(
824821
export function getTransitionsForLanes(
825822
root: FiberRoot,
826823
lanes: Lane | Lanes,
827-
): Transitions | null {
824+
): Array<Transition> | null {
828825
if (!enableTransitionTracing) {
829826
return null;
830827
}

packages/react-reconciler/src/ReactFiberLane.old.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
*/
99

1010
import type {FiberRoot} from './ReactInternalTypes';
11-
import type {
12-
Transition,
13-
Transitions,
14-
} from './ReactFiberTracingMarkerComponent.old';
11+
import type {Transition} from './ReactFiberTracingMarkerComponent.old';
1512

1613
// TODO: Ideally these types would be opaque but that doesn't work well with
1714
// our reconciler fork infra, since these leak into non-reconciler packages.
@@ -824,7 +821,7 @@ export function addTransitionToLanesMap(
824821
export function getTransitionsForLanes(
825822
root: FiberRoot,
826823
lanes: Lane | Lanes,
827-
): Transitions | null {
824+
): Array<Transition> | null {
828825
if (!enableTransitionTracing) {
829826
return null;
830827
}

packages/react-reconciler/src/ReactFiberRoot.new.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import type {
1515
} from './ReactInternalTypes';
1616
import type {RootTag} from './ReactRootTags';
1717
import type {Cache} from './ReactFiberCacheComponent.new';
18-
import type {Transitions} from './ReactFiberTracingMarkerComponent.new';
18+
import type {Transition} from './ReactFiberTracingMarkerComponent.new';
1919

2020
import {noTimeout, supportsHydration} from './ReactFiberHostConfig';
2121
import {createHostRootFiber} from './ReactFiber.new';
@@ -42,7 +42,7 @@ export type RootState = {
4242
element: any,
4343
isDehydrated: boolean,
4444
cache: Cache,
45-
transitions: Transitions | null,
45+
transitions: Array<Transition> | null,
4646
};
4747

4848
function FiberRootNode(

packages/react-reconciler/src/ReactFiberRoot.old.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import type {
1515
} from './ReactInternalTypes';
1616
import type {RootTag} from './ReactRootTags';
1717
import type {Cache} from './ReactFiberCacheComponent.old';
18-
import type {Transitions} from './ReactFiberTracingMarkerComponent.old';
18+
import type {Transition} from './ReactFiberTracingMarkerComponent.old';
1919

2020
import {noTimeout, supportsHydration} from './ReactFiberHostConfig';
2121
import {createHostRootFiber} from './ReactFiber.old';
@@ -42,7 +42,7 @@ export type RootState = {
4242
element: any,
4343
isDehydrated: boolean,
4444
cache: Cache,
45-
transitions: Transitions | null,
45+
transitions: Array<Transition> | null,
4646
};
4747

4848
function FiberRootNode(

packages/react-reconciler/src/ReactFiberTracingMarkerComponent.new.js

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ export type BatchConfigTransition = {
3434
_updatedFibers?: Set<Fiber>,
3535
};
3636

37-
export type Transitions = Array<Transition> | null;
38-
3937
export type TransitionCallback = 0 | 1;
4038

4139
export const TransitionStart = 0;

packages/react-reconciler/src/ReactFiberTracingMarkerComponent.old.js

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ export type BatchConfigTransition = {
3434
_updatedFibers?: Set<Fiber>,
3535
};
3636

37-
export type Transitions = Array<Transition> | null;
38-
3937
export type TransitionCallback = 0 | 1;
4038

4139
export const TransitionStart = 0;

packages/react-reconciler/src/ReactFiberWorkLoop.new.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import type {EventPriority} from './ReactEventPriorities.new';
1818
import type {
1919
PendingTransitionCallbacks,
2020
TransitionObject,
21-
Transitions,
21+
Transition,
2222
} from './ReactFiberTracingMarkerComponent.new';
2323

2424
import {
@@ -325,7 +325,7 @@ let workInProgressRootRenderTargetTime: number = Infinity;
325325
// suspense heuristics and opt out of rendering more content.
326326
const RENDER_TIMEOUT_MS = 500;
327327

328-
let workInProgressTransitions: Transitions | null = null;
328+
let workInProgressTransitions: Array<Transition> | null = null;
329329
export function getWorkInProgressTransitions() {
330330
return workInProgressTransitions;
331331
}

packages/react-reconciler/src/ReactFiberWorkLoop.old.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import type {EventPriority} from './ReactEventPriorities.old';
1818
import type {
1919
PendingTransitionCallbacks,
2020
TransitionObject,
21-
Transitions,
21+
Transition,
2222
} from './ReactFiberTracingMarkerComponent.old';
2323

2424
import {
@@ -325,7 +325,7 @@ let workInProgressRootRenderTargetTime: number = Infinity;
325325
// suspense heuristics and opt out of rendering more content.
326326
const RENDER_TIMEOUT_MS = 500;
327327

328-
let workInProgressTransitions: Transitions | null = null;
328+
let workInProgressTransitions: Array<Transition> | null = null;
329329
export function getWorkInProgressTransitions() {
330330
return workInProgressTransitions;
331331
}

packages/react-reconciler/src/ReactInternalTypes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import type {Lane, Lanes, LaneMap} from './ReactFiberLane.old';
2626
import type {RootTag} from './ReactRootTags';
2727
import type {TimeoutHandle, NoTimeout} from './ReactFiberHostConfig';
2828
import type {Cache} from './ReactFiberCacheComponent.old';
29-
import type {Transitions} from './ReactFiberTracingMarkerComponent.new';
29+
import type {Transition} from './ReactFiberTracingMarkerComponent.new';
3030

3131
// Unwind Circular: moved from ReactFiberHooks.old
3232
export type HookType =
@@ -320,7 +320,7 @@ export type TransitionTracingCallbacks = {
320320
// The following fields are only used in transition tracing in Profile builds
321321
type TransitionTracingOnlyFiberRootProperties = {|
322322
transitionCallbacks: null | TransitionTracingCallbacks,
323-
transitionLanes: Array<Transitions>,
323+
transitionLanes: Array<Array<Transition> | null>,
324324
|};
325325

326326
// Exported FiberRoot type includes all properties,

0 commit comments

Comments
 (0)