Skip to content

Commit 0a3c321

Browse files
committed
Rename GestureProvider to GestureTimeline
This clarifies that this is the refined internal type. Currently they're the same thing but won't be forever.
1 parent 6cf35d5 commit 0a3c321

File tree

9 files changed

+19
-18
lines changed

9 files changed

+19
-18
lines changed

packages/react-art/src/ReactFiberConfigART.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,10 @@ export function createViewTransitionInstance(
508508
return null;
509509
}
510510

511-
export type GestureProvider = null;
511+
export type GestureTimeline = null;
512512

513513
export function subscribeToGestureDirection(
514-
provider: GestureProvider,
514+
provider: GestureTimeline,
515515
directionCallback: (direction: boolean) => void,
516516
): () => void {
517517
throw new Error('useSwipeTransition is not yet supported in react-art.');

packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,10 +1478,10 @@ export function createViewTransitionInstance(
14781478
};
14791479
}
14801480

1481-
export type GestureProvider = AnimationTimeline; // TODO: More provider types.
1481+
export type GestureTimeline = AnimationTimeline; // TODO: More provider types.
14821482

14831483
export function subscribeToGestureDirection(
1484-
provider: GestureProvider,
1484+
provider: GestureTimeline,
14851485
directionCallback: (direction: boolean) => void,
14861486
): () => void {
14871487
const time = provider.currentTime;

packages/react-native-renderer/src/ReactFiberConfigNative.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,10 +605,10 @@ export function createViewTransitionInstance(
605605
return null;
606606
}
607607

608-
export type GestureProvider = null;
608+
export type GestureTimeline = null;
609609

610610
export function subscribeToGestureDirection(
611-
provider: GestureProvider,
611+
provider: GestureTimeline,
612612
directionCallback: (direction: boolean) => void,
613613
): () => void {
614614
throw new Error('useSwipeTransition is not yet supported in React Native.');

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export type FormInstance = Instance;
9595

9696
export type ViewTransitionInstance = null | {name: string, ...};
9797

98-
export type GestureProvider = null;
98+
export type GestureTimeline = null;
9999

100100
const NO_CONTEXT = {};
101101
const UPPERCASE_CONTEXT = {};
@@ -797,7 +797,7 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
797797
},
798798

799799
subscribeToGestureDirection(
800-
provider: GestureProvider,
800+
provider: GestureTimeline,
801801
directionCallback: (direction: boolean) => void,
802802
): () => void {
803803
return () => {};

packages/react-reconciler/src/ReactFiberConfigWithNoMutation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ export const hasInstanceAffectedParent = shim;
4848
export const startViewTransition = shim;
4949
export type ViewTransitionInstance = null | {name: string, ...};
5050
export const createViewTransitionInstance = shim;
51-
export type GestureProvider = any;
51+
export type GestureTimeline = any;
5252
export const subscribeToGestureDirection = shim;

packages/react-reconciler/src/ReactFiberGestureScheduler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
*/
99

1010
import type {FiberRoot} from './ReactInternalTypes';
11-
import type {GestureProvider} from 'shared/ReactTypes';
11+
import type {GestureTimeline} from './ReactFiberConfig';
1212

1313
import {GestureLane} from './ReactFiberLane';
1414
import {ensureRootIsScheduled} from './ReactFiberRootScheduler';
1515
import {subscribeToGestureDirection} from './ReactFiberConfig';
1616

1717
// This type keeps track of any scheduled or active gestures.
1818
export type ScheduledGesture = {
19-
provider: GestureProvider,
19+
provider: GestureTimeline,
2020
count: number, // The number of times this same provider has been started.
2121
direction: boolean, // false = previous, true = next
2222
cancel: () => void, // Cancel the subscription to direction change.
@@ -26,7 +26,7 @@ export type ScheduledGesture = {
2626

2727
export function scheduleGesture(
2828
root: FiberRoot,
29-
provider: GestureProvider,
29+
provider: GestureTimeline,
3030
initialDirection: boolean,
3131
): ScheduledGesture {
3232
let prev = root.gestures;

packages/react-reconciler/src/ReactFiberHooks.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import type {
2727
import type {Lanes, Lane} from './ReactFiberLane';
2828
import type {HookFlags} from './ReactHookEffectTags';
2929
import type {Flags} from './ReactFiberFlags';
30-
import type {TransitionStatus} from './ReactFiberConfig';
30+
import type {TransitionStatus, GestureTimeline} from './ReactFiberConfig';
3131
import type {ScheduledGesture} from './ReactFiberGestureScheduler';
3232

3333
import {
@@ -3997,13 +3997,14 @@ function startGesture(
39973997
// Noop.
39983998
};
39993999
}
4000+
const gestureTimeline: GestureTimeline = gestureProvider;
40004001
const scheduledGesture = scheduleGesture(
40014002
root,
4002-
gestureProvider,
4003+
gestureTimeline,
40034004
queue.initialDirection,
40044005
);
40054006
// Add this particular instance to the queue.
4006-
// We add multiple of the same provider even if they get batched so
4007+
// We add multiple of the same timeline even if they get batched so
40074008
// that if we cancel one but not the other we can keep track of this.
40084009
// Order doesn't matter but we insert in the beginning to avoid two fields.
40094010
const update: SwipeTransitionGestureUpdate = {

packages/react-reconciler/src/forks/ReactFiberConfig.custom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export opaque type FormInstance = mixed;
4343
export type ViewTransitionInstance = null | {name: string, ...};
4444
export opaque type InstanceMeasurement = mixed;
4545
export type EventResponder = any;
46-
export type GestureProvider = any;
46+
export type GestureTimeline = any;
4747

4848
export const rendererVersion = $$$config.rendererVersion;
4949
export const rendererPackageName = $$$config.rendererPackageName;

packages/react-test-renderer/src/ReactFiberConfigTestHost.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,10 @@ export function getInstanceFromNode(mockNode: Object): Object | null {
391391
return null;
392392
}
393393

394-
export type GestureProvider = null;
394+
export type GestureTimeline = null;
395395

396396
export function subscribeToGestureDirection(
397-
provider: GestureProvider,
397+
provider: GestureTimeline,
398398
directionCallback: (direction: boolean) => void,
399399
): () => void {
400400
return () => {};

0 commit comments

Comments
 (0)