|
10 | 10 | export type SideEffectTag = number;
|
11 | 11 |
|
12 | 12 | // Don't change these two values. They're used by React Dev Tools.
|
13 |
| -export const NoEffect = /* */ 0b000000000000000; |
14 |
| -export const PerformedWork = /* */ 0b000000000000001; |
| 13 | +export const NoEffect = /* */ 0b0000000000000000; |
| 14 | +export const PerformedWork = /* */ 0b0000000000000001; |
15 | 15 |
|
16 | 16 | // You can change the rest (and add more).
|
17 |
| -export const Placement = /* */ 0b000000000000010; |
18 |
| -export const Update = /* */ 0b000000000000100; |
19 |
| -export const PlacementAndUpdate = /* */ 0b000000000000110; |
20 |
| -export const Deletion = /* */ 0b000000000001000; |
21 |
| -export const ContentReset = /* */ 0b000000000010000; |
22 |
| -export const Callback = /* */ 0b000000000100000; |
23 |
| -export const DidCapture = /* */ 0b000000001000000; |
24 |
| -export const Ref = /* */ 0b000000010000000; |
25 |
| -export const Snapshot = /* */ 0b000000100000000; |
26 |
| -export const Passive = /* */ 0b000001000000000; |
27 |
| -export const PassiveUnmountPendingDev = /* */ 0b010000000000000; |
28 |
| -export const Hydrating = /* */ 0b000010000000000; |
29 |
| -export const HydratingAndUpdate = /* */ 0b000010000000100; |
| 17 | +export const Placement = /* */ 0b0000000000000010; |
| 18 | +export const Update = /* */ 0b0000000000000100; |
| 19 | +export const PlacementAndUpdate = /* */ 0b0000000000000110; |
| 20 | +export const Deletion = /* */ 0b0000000000001000; |
| 21 | +export const ContentReset = /* */ 0b0000000000010000; |
| 22 | +export const Callback = /* */ 0b0000000000100000; |
| 23 | +export const DidCapture = /* */ 0b0000000001000000; |
| 24 | +export const Ref = /* */ 0b0000000010000000; |
| 25 | +export const Snapshot = /* */ 0b0000000100000000; |
| 26 | +export const Passive = /* */ 0b0000001000000000; |
| 27 | +export const PassiveUnmountPendingDev = /* */ 0b0010000000000000; |
| 28 | +export const Hydrating = /* */ 0b0000010000000000; |
| 29 | +export const HydratingAndUpdate = /* */ 0b0000010000000100; |
30 | 30 |
|
31 | 31 | // Passive & Update & Callback & Ref & Snapshot
|
32 |
| -export const LifecycleEffectMask = /* */ 0b000001110100100; |
| 32 | +export const LifecycleEffectMask = /* */ 0b0000001110100100; |
33 | 33 |
|
34 | 34 | // Union of all host effects
|
35 |
| -export const HostEffectMask = /* */ 0b000011111111111; |
| 35 | +export const HostEffectMask = /* */ 0b0000011111111111; |
36 | 36 |
|
37 | 37 | // These are not really side effects, but we still reuse this field.
|
38 |
| -export const Incomplete = /* */ 0b000100000000000; |
39 |
| -export const ShouldCapture = /* */ 0b001000000000000; |
40 |
| -export const ForceUpdateForLegacySuspense = /* */ 0b100000000000000; |
| 38 | +export const Incomplete = /* */ 0b0000100000000000; |
| 39 | +export const ShouldCapture = /* */ 0b0001000000000000; |
| 40 | +export const ForceUpdateForLegacySuspense = /* */ 0b0100000000000000; |
| 41 | + |
| 42 | +// Static tags describe aspects of a fiber that are not specific to a render, |
| 43 | +// e.g. a fiber uses a passive effect (even if there are no updates on this particular render). |
| 44 | +// This enables us to defer more work in the unmount case, |
| 45 | +// since we can defer traversing the tree during layout to look for Passive effects, |
| 46 | +// and instead rely on the static flag as a signal that there may be cleanup work. |
| 47 | +export const PassiveStatic = /* */ 0b1000000000000000; |
41 | 48 |
|
42 | 49 | // Union of side effect groupings as pertains to subtreeTag
|
43 |
| -export const BeforeMutationMask = /* */ 0b000001100001010; |
44 |
| -export const MutationMask = /* */ 0b000010010011110; |
45 |
| -export const LayoutMask = /* */ 0b000000010100100; |
46 |
| -export const PassiveMask = /* */ 0b000001000000000; |
| 50 | +export const BeforeMutationMask = /* */ 0b0000001100001010; |
| 51 | +export const MutationMask = /* */ 0b0000010010011110; |
| 52 | +export const LayoutMask = /* */ 0b0000000010100100; |
| 53 | +export const PassiveMask = /* */ 0b1000001000000000; |
| 54 | + |
| 55 | +// Union of tags that don't get reset on clones. |
| 56 | +// This allows certain concepts to persist without recalculting them, |
| 57 | +// e.g. whether a subtree contains passive effects or portals. |
| 58 | +export const StaticMask = /* */ 0b1000000000000000; |
0 commit comments