Skip to content

Commit 56c9487

Browse files
author
Brian Vaughn
committed
Cleaned up tepmorary PassiveUnmountPendingDev DEV flag
1 parent 60182d6 commit 56c9487

File tree

3 files changed

+23
-43
lines changed

3 files changed

+23
-43
lines changed

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

-9
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ import {
7777
MutationMask,
7878
LayoutMask,
7979
PassiveMask,
80-
PassiveUnmountPendingDev,
8180
} from './ReactFiberFlags';
8281
import getComponentNameFromFiber from 'react-reconciler/src/getComponentNameFromFiber';
8382
import invariant from 'shared/invariant';
@@ -2341,14 +2340,6 @@ function commitPassiveUnmountEffects_complete() {
23412340
}
23422341

23432342
function commitPassiveUnmountOnFiber(finishedWork: Fiber): void {
2344-
if (__DEV__) {
2345-
finishedWork.flags &= ~PassiveUnmountPendingDev;
2346-
const alternate = finishedWork.alternate;
2347-
if (alternate !== null) {
2348-
alternate.flags &= ~PassiveUnmountPendingDev;
2349-
}
2350-
}
2351-
23522343
switch (finishedWork.tag) {
23532344
case FunctionComponent:
23542345
case ForwardRef:

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

-9
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ import {
7777
MutationMask,
7878
LayoutMask,
7979
PassiveMask,
80-
PassiveUnmountPendingDev,
8180
} from './ReactFiberFlags';
8281
import getComponentNameFromFiber from 'react-reconciler/src/getComponentNameFromFiber';
8382
import invariant from 'shared/invariant';
@@ -2341,14 +2340,6 @@ function commitPassiveUnmountEffects_complete() {
23412340
}
23422341

23432342
function commitPassiveUnmountOnFiber(finishedWork: Fiber): void {
2344-
if (__DEV__) {
2345-
finishedWork.flags &= ~PassiveUnmountPendingDev;
2346-
const alternate = finishedWork.alternate;
2347-
if (alternate !== null) {
2348-
alternate.flags &= ~PassiveUnmountPendingDev;
2349-
}
2350-
}
2351-
23522343
switch (finishedWork.tag) {
23532344
case FunctionComponent:
23542345
case ForwardRef:

packages/react-reconciler/src/ReactFiberFlags.js

+23-25
Original file line numberDiff line numberDiff line change
@@ -12,51 +12,49 @@ import {enableCreateEventHandleAPI} from 'shared/ReactFeatureFlags';
1212
export type Flags = number;
1313

1414
// Don't change these two values. They're used by React Dev Tools.
15-
export const NoFlags = /* */ 0b0000000000000000000000;
16-
export const PerformedWork = /* */ 0b0000000000000000000001;
15+
export const NoFlags = /* */ 0b000000000000000000000;
16+
export const PerformedWork = /* */ 0b000000000000000000001;
1717

1818
// You can change the rest (and add more).
19-
export const Placement = /* */ 0b0000000000000000000010;
20-
export const Update = /* */ 0b0000000000000000000100;
19+
export const Placement = /* */ 0b000000000000000000010;
20+
export const Update = /* */ 0b000000000000000000100;
2121
export const PlacementAndUpdate = /* */ Placement | Update;
22-
export const Deletion = /* */ 0b0000000000000000001000;
23-
export const ChildDeletion = /* */ 0b0000000000000000010000;
24-
export const ContentReset = /* */ 0b0000000000000000100000;
25-
export const Callback = /* */ 0b0000000000000001000000;
26-
export const DidCapture = /* */ 0b0000000000000010000000;
27-
export const Ref = /* */ 0b0000000000000100000000;
28-
export const Snapshot = /* */ 0b0000000000001000000000;
29-
export const Passive = /* */ 0b0000000000010000000000;
30-
export const Hydrating = /* */ 0b0000000000100000000000;
22+
export const Deletion = /* */ 0b000000000000000001000;
23+
export const ChildDeletion = /* */ 0b000000000000000010000;
24+
export const ContentReset = /* */ 0b000000000000000100000;
25+
export const Callback = /* */ 0b000000000000001000000;
26+
export const DidCapture = /* */ 0b000000000000010000000;
27+
export const Ref = /* */ 0b000000000000100000000;
28+
export const Snapshot = /* */ 0b000000000001000000000;
29+
export const Passive = /* */ 0b000000000010000000000;
30+
export const Hydrating = /* */ 0b000000000100000000000;
3131
export const HydratingAndUpdate = /* */ Hydrating | Update;
32-
export const Visibility = /* */ 0b0000000001000000000000;
32+
export const Visibility = /* */ 0b000000001000000000000;
3333

3434
export const LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot;
3535

3636
// Union of all commit flags (flags with the lifetime of a particular commit)
37-
export const HostEffectMask = /* */ 0b0000000001111111111111;
37+
export const HostEffectMask = /* */ 0b000000001111111111111;
3838

3939
// These are not really side effects, but we still reuse this field.
40-
export const Incomplete = /* */ 0b0000000010000000000000;
41-
export const ShouldCapture = /* */ 0b0000000100000000000000;
42-
// TODO (effects) Remove this bit once the new reconciler is synced to the old.
43-
export const PassiveUnmountPendingDev = /* */ 0b0000001000000000000000;
44-
export const ForceUpdateForLegacySuspense = /* */ 0b0000010000000000000000;
45-
export const DidPropagateContext = /* */ 0b0000100000000000000000;
46-
export const NeedsPropagation = /* */ 0b0001000000000000000000;
40+
export const Incomplete = /* */ 0b000000010000000000000;
41+
export const ShouldCapture = /* */ 0b000000100000000000000;
42+
export const ForceUpdateForLegacySuspense = /* */ 0b000001000000000000000;
43+
export const DidPropagateContext = /* */ 0b000010000000000000000;
44+
export const NeedsPropagation = /* */ 0b000100000000000000000;
4745

4846
// Static tags describe aspects of a fiber that are not specific to a render,
4947
// e.g. a fiber uses a passive effect (even if there are no updates on this particular render).
5048
// This enables us to defer more work in the unmount case,
5149
// since we can defer traversing the tree during layout to look for Passive effects,
5250
// and instead rely on the static flag as a signal that there may be cleanup work.
53-
export const PassiveStatic = /* */ 0b0010000000000000000000;
51+
export const PassiveStatic = /* */ 0b001000000000000000000;
5452

5553
// These flags allow us to traverse to fibers that have effects on mount
5654
// without traversing the entire tree after every commit for
5755
// double invoking
58-
export const MountLayoutDev = /* */ 0b0100000000000000000000;
59-
export const MountPassiveDev = /* */ 0b1000000000000000000000;
56+
export const MountLayoutDev = /* */ 0b010000000000000000000;
57+
export const MountPassiveDev = /* */ 0b100000000000000000000;
6058

6159
// Groups of flags that are used in the commit phase to skip over trees that
6260
// don't contain effects, by checking subtreeFlags.

0 commit comments

Comments
 (0)