Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed Transitions type to Array<Transition> #24249

Merged
merged 1 commit into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions packages/react-reconciler/src/ReactFiberLane.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
*/

import type {FiberRoot} from './ReactInternalTypes';
import type {
Transition,
Transitions,
} from './ReactFiberTracingMarkerComponent.new';
import type {Transition} from './ReactFiberTracingMarkerComponent.new';

// TODO: Ideally these types would be opaque but that doesn't work well with
// our reconciler fork infra, since these leak into non-reconciler packages.
Expand Down Expand Up @@ -824,7 +821,7 @@ export function addTransitionToLanesMap(
export function getTransitionsForLanes(
root: FiberRoot,
lanes: Lane | Lanes,
): Transitions | null {
): Array<Transition> | null {
if (!enableTransitionTracing) {
return null;
}
Expand Down
7 changes: 2 additions & 5 deletions packages/react-reconciler/src/ReactFiberLane.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
*/

import type {FiberRoot} from './ReactInternalTypes';
import type {
Transition,
Transitions,
} from './ReactFiberTracingMarkerComponent.old';
import type {Transition} from './ReactFiberTracingMarkerComponent.old';

// TODO: Ideally these types would be opaque but that doesn't work well with
// our reconciler fork infra, since these leak into non-reconciler packages.
Expand Down Expand Up @@ -824,7 +821,7 @@ export function addTransitionToLanesMap(
export function getTransitionsForLanes(
root: FiberRoot,
lanes: Lane | Lanes,
): Transitions | null {
): Array<Transition> | null {
if (!enableTransitionTracing) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberRoot.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
} from './ReactInternalTypes';
import type {RootTag} from './ReactRootTags';
import type {Cache} from './ReactFiberCacheComponent.new';
import type {Transitions} from './ReactFiberTracingMarkerComponent.new';
import type {Transition} from './ReactFiberTracingMarkerComponent.new';

import {noTimeout, supportsHydration} from './ReactFiberHostConfig';
import {createHostRootFiber} from './ReactFiber.new';
Expand All @@ -42,7 +42,7 @@ export type RootState = {
element: any,
isDehydrated: boolean,
cache: Cache,
transitions: Transitions | null,
transitions: Array<Transition> | null,
};

function FiberRootNode(
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberRoot.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
} from './ReactInternalTypes';
import type {RootTag} from './ReactRootTags';
import type {Cache} from './ReactFiberCacheComponent.old';
import type {Transitions} from './ReactFiberTracingMarkerComponent.old';
import type {Transition} from './ReactFiberTracingMarkerComponent.old';

import {noTimeout, supportsHydration} from './ReactFiberHostConfig';
import {createHostRootFiber} from './ReactFiber.old';
Expand All @@ -42,7 +42,7 @@ export type RootState = {
element: any,
isDehydrated: boolean,
cache: Cache,
transitions: Transitions | null,
transitions: Array<Transition> | null,
};

function FiberRootNode(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ export type BatchConfigTransition = {
_updatedFibers?: Set<Fiber>,
};

export type Transitions = Array<Transition> | null;

export type TransitionCallback = 0 | 1;

export const TransitionStart = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ export type BatchConfigTransition = {
_updatedFibers?: Set<Fiber>,
};

export type Transitions = Array<Transition> | null;

export type TransitionCallback = 0 | 1;

export const TransitionStart = 0;
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberWorkLoop.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {EventPriority} from './ReactEventPriorities.new';
import type {
PendingTransitionCallbacks,
TransitionObject,
Transitions,
Transition,
} from './ReactFiberTracingMarkerComponent.new';

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

let workInProgressTransitions: Transitions | null = null;
let workInProgressTransitions: Array<Transition> | null = null;
export function getWorkInProgressTransitions() {
return workInProgressTransitions;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactFiberWorkLoop.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {EventPriority} from './ReactEventPriorities.old';
import type {
PendingTransitionCallbacks,
TransitionObject,
Transitions,
Transition,
} from './ReactFiberTracingMarkerComponent.old';

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

let workInProgressTransitions: Transitions | null = null;
let workInProgressTransitions: Array<Transition> | null = null;
export function getWorkInProgressTransitions() {
return workInProgressTransitions;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/ReactInternalTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import type {Lane, Lanes, LaneMap} from './ReactFiberLane.old';
import type {RootTag} from './ReactRootTags';
import type {TimeoutHandle, NoTimeout} from './ReactFiberHostConfig';
import type {Cache} from './ReactFiberCacheComponent.old';
import type {Transitions} from './ReactFiberTracingMarkerComponent.new';
import type {Transition} from './ReactFiberTracingMarkerComponent.new';

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

// Exported FiberRoot type includes all properties,
Expand Down