Skip to content

Commit 19535db

Browse files
committed
Rename enableSwipeTransition to enableGestureTransition
To align with the new API name.
1 parent 13f9c5a commit 19535db

16 files changed

+42
-42
lines changed

packages/react-reconciler/src/ReactFiberHooks.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import {
4242
enableLegacyCache,
4343
disableLegacyMode,
4444
enableNoCloningMemoCache,
45-
enableSwipeTransition,
45+
enableGestureTransition,
4646
} from 'shared/ReactFeatureFlags';
4747
import {
4848
REACT_CONTEXT_TYPE,
@@ -165,7 +165,7 @@ export type Update<S, A> = {
165165
hasEagerState: boolean,
166166
eagerState: S | null,
167167
next: Update<S, A>,
168-
gesture: null | ScheduledGesture, // enableSwipeTransition
168+
gesture: null | ScheduledGesture, // enableGestureTransition
169169
};
170170

171171
export type UpdateQueue<S, A> = {
@@ -1374,7 +1374,7 @@ function updateReducerImpl<S, A>(
13741374
? !isSubsetOfLanes(getWorkInProgressRootRenderLanes(), updateLane)
13751375
: !isSubsetOfLanes(renderLanes, updateLane);
13761376

1377-
if (enableSwipeTransition && updateLane === GestureLane) {
1377+
if (enableGestureTransition && updateLane === GestureLane) {
13781378
// This is a gesture optimistic update. It should only be considered as part of the
13791379
// rendered state while rendering the gesture lane and if the rendering the associated
13801380
// ScheduledGesture.
@@ -2159,7 +2159,7 @@ function runActionStateAction<S, P>(
21592159
// This is a fork of startTransition
21602160
const prevTransition = ReactSharedInternals.T;
21612161
const currentTransition: Transition = ({}: any);
2162-
if (enableSwipeTransition) {
2162+
if (enableGestureTransition) {
21632163
currentTransition.gesture = null;
21642164
}
21652165
if (enableTransitionTracing) {
@@ -3041,7 +3041,7 @@ function startTransition<S>(
30413041

30423042
const prevTransition = ReactSharedInternals.T;
30433043
const currentTransition: Transition = ({}: any);
3044-
if (enableSwipeTransition) {
3044+
if (enableGestureTransition) {
30453045
currentTransition.gesture = null;
30463046
}
30473047
if (enableTransitionTracing) {
@@ -3269,7 +3269,7 @@ export function requestFormReset(formFiber: Fiber) {
32693269
'fix, move to an action, or wrap with startTransition.',
32703270
);
32713271
}
3272-
} else if (enableSwipeTransition && transition.gesture) {
3272+
} else if (enableGestureTransition && transition.gesture) {
32733273
throw new Error(
32743274
'Cannot requestFormReset() inside a startGestureTransition. ' +
32753275
'There should be no side-effects associated with starting a ' +
@@ -3646,7 +3646,7 @@ function dispatchOptimisticSetState<S, A>(
36463646
// For regular Transitions an optimistic update commits synchronously.
36473647
// For gesture Transitions an optimistic update commits on the GestureLane.
36483648
const lane =
3649-
enableSwipeTransition && transition !== null && transition.gesture
3649+
enableGestureTransition && transition !== null && transition.gesture
36503650
? GestureLane
36513651
: SyncLane;
36523652
const update: Update<S, A> = {
@@ -3687,7 +3687,7 @@ function dispatchOptimisticSetState<S, A>(
36873687
scheduleUpdateOnFiber(root, fiber, lane);
36883688
// Optimistic updates are always synchronous, so we don't need to call
36893689
// entangleTransitionUpdate here.
3690-
if (enableSwipeTransition && transition !== null) {
3690+
if (enableGestureTransition && transition !== null) {
36913691
const provider = transition.gesture;
36923692
if (provider !== null) {
36933693
// If this was a gesture, ensure we have a scheduled gesture and that

packages/react-reconciler/src/ReactFiberRoot.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
enableUpdaterTracking,
3434
enableTransitionTracing,
3535
disableLegacyMode,
36-
enableSwipeTransition,
36+
enableGestureTransition,
3737
} from 'shared/ReactFeatureFlags';
3838
import {initializeUpdateQueue} from './ReactFiberClassUpdateQueue';
3939
import {LegacyRoot, ConcurrentRoot} from './ReactRootTags';
@@ -98,7 +98,7 @@ function FiberRootNode(
9898

9999
this.formState = formState;
100100

101-
if (enableSwipeTransition) {
101+
if (enableGestureTransition) {
102102
this.pendingGestures = null;
103103
this.stoppingGestures = null;
104104
this.gestureClone = null;

packages/react-reconciler/src/ReactFiberRootScheduler.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
enableComponentPerformanceTrack,
2121
enableSiblingPrerendering,
2222
enableYieldingBeforePassive,
23-
enableSwipeTransition,
23+
enableGestureTransition,
2424
} from 'shared/ReactFeatureFlags';
2525
import {
2626
NoLane,
@@ -214,7 +214,7 @@ function flushSyncWorkAcrossRoots_impl(
214214
);
215215
if (
216216
(includesSyncLane(nextLanes) ||
217-
(enableSwipeTransition && isGestureRender(nextLanes))) &&
217+
(enableGestureTransition && isGestureRender(nextLanes))) &&
218218
!checkIfRootIsPrerendering(root, nextLanes)
219219
) {
220220
// This root has pending sync work. Flush it now.
@@ -300,7 +300,7 @@ function processRootScheduleInMicrotask() {
300300
// Common case: we're not treating any extra lanes as synchronous, so we
301301
// can just check if the next lanes are sync.
302302
includesSyncLane(nextLanes) ||
303-
(enableSwipeTransition && isGestureRender(nextLanes))
303+
(enableGestureTransition && isGestureRender(nextLanes))
304304
) {
305305
mightHavePendingSyncWork = true;
306306
}

packages/react-reconciler/src/ReactFiberTransition.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import type {ScheduledGesture} from './ReactFiberGestureScheduler';
2020

2121
import {
2222
enableTransitionTracing,
23-
enableSwipeTransition,
23+
enableGestureTransition,
2424
} from 'shared/ReactFeatureFlags';
2525
import {isPrimaryRenderer} from './ReactFiberConfig';
2626
import {createCursor, push, pop} from './ReactFiberStack';
@@ -106,7 +106,7 @@ function chainGestureCancellation(
106106
};
107107
}
108108

109-
if (enableSwipeTransition) {
109+
if (enableGestureTransition) {
110110
const prevOnStartGestureTransitionFinish = ReactSharedInternals.G;
111111
ReactSharedInternals.G = function onStartGestureTransitionFinishForReconciler(
112112
transition: Transition,

packages/react-reconciler/src/ReactFiberWorkLoop.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import {
5151
enableYieldingBeforePassive,
5252
enableThrottledScheduling,
5353
enableViewTransition,
54-
enableSwipeTransition,
54+
enableGestureTransition,
5555
} from 'shared/ReactFeatureFlags';
5656
import {resetOwnerStackLimit} from 'shared/ReactOwnerStackReset';
5757
import ReactSharedInternals from 'shared/ReactSharedInternals';
@@ -753,7 +753,7 @@ export function requestUpdateLane(fiber: Fiber): Lane {
753753

754754
const transition = requestCurrentTransition();
755755
if (transition !== null) {
756-
if (enableSwipeTransition) {
756+
if (enableGestureTransition) {
757757
if (transition.gesture) {
758758
throw new Error(
759759
'Cannot setState on regular state inside a startGestureTransition. ' +
@@ -1451,7 +1451,7 @@ function commitRootWhenReady(
14511451
const subtreeFlags = finishedWork.subtreeFlags;
14521452
const isViewTransitionEligible =
14531453
enableViewTransition && includesOnlyViewTransitionEligibleLanes(lanes); // TODO: Use a subtreeFlag to optimize.
1454-
const isGestureTransition = enableSwipeTransition && isGestureRender(lanes);
1454+
const isGestureTransition = enableGestureTransition && isGestureRender(lanes);
14551455
const maySuspendCommit =
14561456
subtreeFlags & ShouldSuspendCommit ||
14571457
(subtreeFlags & BothVisibilityAndMaySuspendCommit) ===
@@ -1470,7 +1470,7 @@ function commitRootWhenReady(
14701470
if (isViewTransitionEligible || isGestureTransition) {
14711471
// If we're stopping gestures we don't have to wait for any pending
14721472
// view transition. We'll stop it when we commit.
1473-
if (!enableSwipeTransition || root.stoppingGestures === null) {
1473+
if (!enableGestureTransition || root.stoppingGestures === null) {
14741474
suspendOnActiveViewTransition(root.containerInfo);
14751475
}
14761476
}
@@ -3297,7 +3297,7 @@ function commitRoot(
32973297
if (enableSchedulingProfiler) {
32983298
markCommitStopped();
32993299
}
3300-
if (enableSwipeTransition) {
3300+
if (enableGestureTransition) {
33013301
// Stop any gestures that were completed and is now being reverted.
33023302
if (root.stoppingGestures !== null) {
33033303
stopCompletedGestures(root);
@@ -3331,7 +3331,7 @@ function commitRoot(
33313331
const concurrentlyUpdatedLanes = getConcurrentlyUpdatedLanes();
33323332
remainingLanes = mergeLanes(remainingLanes, concurrentlyUpdatedLanes);
33333333

3334-
if (enableSwipeTransition && root.pendingGestures === null) {
3334+
if (enableGestureTransition && root.pendingGestures === null) {
33353335
// Gestures don't clear their lanes while the gesture is still active but it
33363336
// might not be scheduled to do any more renders and so we shouldn't schedule
33373337
// any more gesture lane work until a new gesture is scheduled.
@@ -3379,7 +3379,7 @@ function commitRoot(
33793379
pendingSuspendedCommitReason = suspendedCommitReason;
33803380
}
33813381

3382-
if (enableSwipeTransition && isGestureRender(lanes)) {
3382+
if (enableGestureTransition && isGestureRender(lanes)) {
33833383
// This is a special kind of render that doesn't commit regular effects.
33843384
commitGestureOnRoot(
33853385
root,
@@ -3505,7 +3505,7 @@ function commitRoot(
35053505
}
35063506

35073507
let willStartViewTransition = shouldStartViewTransition;
3508-
if (enableSwipeTransition) {
3508+
if (enableGestureTransition) {
35093509
// Stop any gestures that were completed and is now being committed.
35103510
if (root.stoppingGestures !== null) {
35113511
stopCompletedGestures(root);
@@ -3944,7 +3944,7 @@ function commitGestureOnRoot(
39443944
}
39453945

39463946
function flushGestureMutations(): void {
3947-
if (!enableSwipeTransition) {
3947+
if (!enableGestureTransition) {
39483948
return;
39493949
}
39503950
if (pendingEffectsStatus !== PENDING_GESTURE_MUTATION_PHASE) {
@@ -3973,7 +3973,7 @@ function flushGestureMutations(): void {
39733973
}
39743974

39753975
function flushGestureAnimations(): void {
3976-
if (!enableSwipeTransition) {
3976+
if (!enableGestureTransition) {
39773977
return;
39783978
}
39793979
// If we get canceled before we start we might not have applied

packages/react-reconciler/src/ReactInternalTypes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ type BaseFiberRootProperties = {
280280

281281
formState: ReactFormState<any, any> | null,
282282

283-
// enableSwipeTransition only
283+
// enableGestureTransition only
284284
pendingGestures: null | ScheduledGesture,
285285
stoppingGestures: null | ScheduledGesture,
286286
gestureClone: null | Instance,

packages/react/src/ReactClient.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export {
126126
// enableViewTransition
127127
REACT_VIEW_TRANSITION_TYPE as unstable_ViewTransition,
128128
addTransitionType as unstable_addTransitionType,
129-
// enableSwipeTransition
129+
// enableGestureTransition
130130
startGestureTransition as unstable_startGestureTransition,
131131
// DEV-only
132132
useId,

packages/react/src/ReactSharedInternalsClient.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import type {GestureProvider, GestureOptions} from 'shared/ReactTypes';
1515

1616
import {
1717
enableViewTransition,
18-
enableSwipeTransition,
18+
enableGestureTransition,
1919
} from 'shared/ReactFeatureFlags';
2020

2121
export type SharedStateClient = {
@@ -58,7 +58,7 @@ const ReactSharedInternals: SharedStateClient = ({
5858
T: null,
5959
S: null,
6060
}: any);
61-
if (enableSwipeTransition) {
61+
if (enableGestureTransition) {
6262
ReactSharedInternals.G = null;
6363
}
6464
if (enableViewTransition) {

packages/react/src/ReactStartTransition.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ import ReactSharedInternals from 'shared/ReactSharedInternals';
1818

1919
import {
2020
enableTransitionTracing,
21-
enableSwipeTransition,
21+
enableGestureTransition,
2222
} from 'shared/ReactFeatureFlags';
2323

2424
import reportGlobalError from 'shared/reportGlobalError';
2525

2626
export type Transition = {
27-
gesture: null | GestureProvider, // enableSwipeTransition
27+
gesture: null | GestureProvider, // enableGestureTransition
2828
name: null | string, // enableTransitionTracing only
2929
startTime: number, // enableTransitionTracing only
3030
_updatedFibers: Set<Fiber>, // DEV-only
@@ -37,7 +37,7 @@ export function startTransition(
3737
): void {
3838
const prevTransition = ReactSharedInternals.T;
3939
const currentTransition: Transition = ({}: any);
40-
if (enableSwipeTransition) {
40+
if (enableGestureTransition) {
4141
currentTransition.gesture = null;
4242
}
4343
if (enableTransitionTracing) {
@@ -76,10 +76,10 @@ export function startGestureTransition(
7676
scope: () => void,
7777
options?: GestureOptions & StartTransitionOptions,
7878
): () => void {
79-
if (!enableSwipeTransition) {
79+
if (!enableGestureTransition) {
8080
// eslint-disable-next-line react-internal/prod-error-codes
8181
throw new Error(
82-
'startGestureTransition should not be exported when the enableSwipeTransition flag is off.',
82+
'startGestureTransition should not be exported when the enableGestureTransition flag is off.',
8383
);
8484
}
8585
if (provider == null) {
@@ -92,7 +92,7 @@ export function startGestureTransition(
9292
}
9393
const prevTransition = ReactSharedInternals.T;
9494
const currentTransition: Transition = ({}: any);
95-
if (enableSwipeTransition) {
95+
if (enableGestureTransition) {
9696
currentTransition.gesture = provider;
9797
}
9898
if (enableTransitionTracing) {

packages/shared/ReactFeatureFlags.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const enableHalt = __EXPERIMENTAL__;
9292

9393
export const enableViewTransition = __EXPERIMENTAL__;
9494

95-
export const enableSwipeTransition = __EXPERIMENTAL__;
95+
export const enableGestureTransition = __EXPERIMENTAL__;
9696

9797
export const enableScrollEndPolyfill = __EXPERIMENTAL__;
9898

packages/shared/forks/ReactFeatureFlags.native-fb.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const enableHydrationLaneScheduling = true;
8080
export const enableYieldingBeforePassive = false;
8181
export const enableThrottledScheduling = false;
8282
export const enableViewTransition = false;
83-
export const enableSwipeTransition = false;
83+
export const enableGestureTransition = false;
8484
export const enableScrollEndPolyfill = true;
8585
export const enableFragmentRefs = false;
8686
export const ownerStackLimit = 1e4;

packages/shared/forks/ReactFeatureFlags.native-oss.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const enableYieldingBeforePassive = false;
7070

7171
export const enableThrottledScheduling = false;
7272
export const enableViewTransition = false;
73-
export const enableSwipeTransition = false;
73+
export const enableGestureTransition = false;
7474
export const enableFastAddPropertiesInDiffing = false;
7575
export const enableLazyPublicInstanceInFabric = false;
7676
export const enableScrollEndPolyfill = true;

packages/shared/forks/ReactFeatureFlags.test-renderer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const enableYieldingBeforePassive = true;
6969

7070
export const enableThrottledScheduling = false;
7171
export const enableViewTransition = false;
72-
export const enableSwipeTransition = false;
72+
export const enableGestureTransition = false;
7373
export const enableFastAddPropertiesInDiffing = true;
7474
export const enableLazyPublicInstanceInFabric = false;
7575
export const enableScrollEndPolyfill = true;

packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const enableHydrationLaneScheduling = true;
6666
export const enableYieldingBeforePassive = false;
6767
export const enableThrottledScheduling = false;
6868
export const enableViewTransition = false;
69-
export const enableSwipeTransition = false;
69+
export const enableGestureTransition = false;
7070
export const enableFastAddPropertiesInDiffing = false;
7171
export const enableLazyPublicInstanceInFabric = false;
7272
export const enableScrollEndPolyfill = true;

packages/shared/forks/ReactFeatureFlags.test-renderer.www.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const enableYieldingBeforePassive = false;
8080

8181
export const enableThrottledScheduling = false;
8282
export const enableViewTransition = false;
83-
export const enableSwipeTransition = false;
83+
export const enableGestureTransition = false;
8484
export const enableFastAddPropertiesInDiffing = false;
8585
export const enableLazyPublicInstanceInFabric = false;
8686
export const enableScrollEndPolyfill = true;

packages/shared/forks/ReactFeatureFlags.www.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export const enableShallowPropDiffing = false;
111111

112112
export const enableLazyPublicInstanceInFabric = false;
113113

114-
export const enableSwipeTransition = false;
114+
export const enableGestureTransition = false;
115115

116116
export const ownerStackLimit = 1e4;
117117

0 commit comments

Comments
 (0)