|
10 | 10 | export type Flags = number; |
11 | 11 |
|
12 | 12 | // Don't change these two values. They're used by React Dev Tools. |
13 | | -export const NoFlags = /* */ 0b000000000000000000; |
14 | | -export const PerformedWork = /* */ 0b000000000000000001; |
| 13 | +export const NoFlags = /* */ 0b0000000000000000000; |
| 14 | +export const PerformedWork = /* */ 0b0000000000000000001; |
15 | 15 |
|
16 | 16 | // You can change the rest (and add more). |
17 | | -export const Placement = /* */ 0b000000000000000010; |
18 | | -export const Update = /* */ 0b000000000000000100; |
19 | | -export const PlacementAndUpdate = /* */ 0b000000000000000110; |
20 | | -export const Deletion = /* */ 0b000000000000001000; |
21 | | -export const ContentReset = /* */ 0b000000000000010000; |
22 | | -export const Callback = /* */ 0b000000000000100000; |
23 | | -export const DidCapture = /* */ 0b000000000001000000; |
24 | | -export const Ref = /* */ 0b000000000010000000; |
25 | | -export const Snapshot = /* */ 0b000000000100000000; |
26 | | -export const Passive = /* */ 0b000000001000000000; |
27 | | -// TODO (effects) Remove this bit once the new reconciler is synced to the old. |
28 | | -export const PassiveUnmountPendingDev = /* */ 0b000010000000000000; |
29 | | -export const Hydrating = /* */ 0b000000010000000000; |
30 | | -export const HydratingAndUpdate = /* */ 0b000000010000000100; |
| 17 | +export const Placement = /* */ 0b0000000000000000010; |
| 18 | +export const Update = /* */ 0b0000000000000000100; |
| 19 | +export const PlacementAndUpdate = /* */ 0b0000000000000000110; |
| 20 | +export const Deletion = /* */ 0b0000000000000001000; |
| 21 | +export const ContentReset = /* */ 0b0000000000000010000; |
| 22 | +export const Callback = /* */ 0b0000000000000100000; |
| 23 | +export const DidCapture = /* */ 0b0000000000001000000; |
| 24 | +export const Ref = /* */ 0b0000000000010000000; |
| 25 | +export const Snapshot = /* */ 0b0000000000100000000; |
| 26 | +export const Passive = /* */ 0b0000000001000000000; |
| 27 | +export const Hydrating = /* */ 0b0000000010000000000; |
| 28 | +export const HydratingAndUpdate = /* */ 0b0000000010000000100; |
| 29 | +export const Visibility = /* */ 0b0000000100000000000; |
31 | 30 |
|
32 | 31 | // Passive & Update & Callback & Ref & Snapshot |
33 | | -export const LifecycleEffectMask = /* */ 0b000000001110100100; |
| 32 | +export const LifecycleEffectMask = /* */ 0b0000000001110100100; |
34 | 33 |
|
35 | 34 | // Union of all host effects |
36 | | -export const HostEffectMask = /* */ 0b000000011111111111; |
| 35 | +export const HostEffectMask = /* */ 0b0000000111111111111; |
37 | 36 |
|
38 | 37 | // These are not really side effects, but we still reuse this field. |
39 | | -export const Incomplete = /* */ 0b000000100000000000; |
40 | | -export const ShouldCapture = /* */ 0b000001000000000000; |
41 | | -export const ForceUpdateForLegacySuspense = /* */ 0b000100000000000000; |
| 38 | +export const Incomplete = /* */ 0b0000001000000000000; |
| 39 | +export const ShouldCapture = /* */ 0b0000010000000000000; |
| 40 | +// TODO (effects) Remove this bit once the new reconciler is synced to the old. |
| 41 | +export const PassiveUnmountPendingDev = /* */ 0b0000100000000000000; |
| 42 | +export const ForceUpdateForLegacySuspense = /* */ 0b0001000000000000000; |
42 | 43 |
|
43 | 44 | // Static tags describe aspects of a fiber that are not specific to a render, |
44 | 45 | // e.g. a fiber uses a passive effect (even if there are no updates on this particular render). |
45 | 46 | // This enables us to defer more work in the unmount case, |
46 | 47 | // since we can defer traversing the tree during layout to look for Passive effects, |
47 | 48 | // and instead rely on the static flag as a signal that there may be cleanup work. |
48 | | -export const PassiveStatic = /* */ 0b001000000000000000; |
| 49 | +export const PassiveStatic = /* */ 0b0010000000000000000; |
49 | 50 |
|
50 | 51 | // Union of side effect groupings as pertains to subtreeFlags |
51 | | -// TODO: Don't need to visit Placement during BeforeMutation phase |
52 | 52 | // TODO: Only need to visit Deletions during BeforeMutation phase if an element |
53 | 53 | // is focused. |
54 | | -export const BeforeMutationMask = /* */ 0b000000000100001010; |
55 | | -export const MutationMask = /* */ 0b000000010010011110; |
56 | | -export const LayoutMask = /* */ 0b000000000010100100; |
57 | | -export const PassiveMask = /* */ 0b000000001000001000; |
| 54 | +export const BeforeMutationMask = /* */ 0b0000000100100001000; |
| 55 | +export const MutationMask = /* */ 0b0000000110010011110; |
| 56 | +export const LayoutMask = /* */ 0b0000000000010100100; |
| 57 | +export const PassiveMask = /* */ 0b0000000001000001000; |
58 | 58 |
|
59 | 59 | // Union of tags that don't get reset on clones. |
60 | 60 | // This allows certain concepts to persist without recalculting them, |
61 | 61 | // e.g. whether a subtree contains passive effects or portals. |
62 | | -export const StaticMask = /* */ 0b001000000000000000; |
| 62 | +export const StaticMask = /* */ 0b0010000000000000000; |
63 | 63 |
|
64 | 64 | // These flags allow us to traverse to fibers that have effects on mount |
65 | 65 | // without traversing the entire tree after every commit for |
66 | 66 | // double invoking |
67 | | -export const MountLayoutDev = /* */ 0b010000000000000000; |
68 | | -export const MountPassiveDev = /* */ 0b100000000000000000; |
| 67 | +export const MountLayoutDev = /* */ 0b0100000000000000000; |
| 68 | +export const MountPassiveDev = /* */ 0b1000000000000000000; |
0 commit comments