-
Notifications
You must be signed in to change notification settings - Fork 45.6k
/
ReactFiberReconciler.js
138 lines (133 loc) · 5.5 KB
/
ReactFiberReconciler.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
import {enableNewReconciler} from 'shared/ReactFeatureFlags';
// The entry file imports either the old or new version of the reconciler.
// During build and testing, this indirection is always shimmed with the actual
// modules, otherwise both reconcilers would be initialized. So this is really
// only here for Flow purposes.
import {
createContainer as createContainer_old,
updateContainer as updateContainer_old,
batchedEventUpdates as batchedEventUpdates_old,
batchedUpdates as batchedUpdates_old,
unbatchedUpdates as unbatchedUpdates_old,
deferredUpdates as deferredUpdates_old,
discreteUpdates as discreteUpdates_old,
flushDiscreteUpdates as flushDiscreteUpdates_old,
flushControlled as flushControlled_old,
flushSync as flushSync_old,
flushPassiveEffects as flushPassiveEffects_old,
IsThisRendererActing as IsThisRendererActing_old,
getPublicRootInstance as getPublicRootInstance_old,
attemptSynchronousHydration as attemptSynchronousHydration_old,
attemptUserBlockingHydration as attemptUserBlockingHydration_old,
attemptContinuousHydration as attemptContinuousHydration_old,
attemptHydrationAtCurrentPriority as attemptHydrationAtCurrentPriority_old,
findHostInstance as findHostInstance_old,
findHostInstanceWithWarning as findHostInstanceWithWarning_old,
findHostInstanceWithNoPortals as findHostInstanceWithNoPortals_old,
shouldSuspend as shouldSuspend_old,
injectIntoDevTools as injectIntoDevTools_old,
act as act_old,
createPortal as createPortal_old,
} from './ReactFiberReconciler.old';
import {
createContainer as createContainer_new,
updateContainer as updateContainer_new,
batchedEventUpdates as batchedEventUpdates_new,
batchedUpdates as batchedUpdates_new,
unbatchedUpdates as unbatchedUpdates_new,
deferredUpdates as deferredUpdates_new,
discreteUpdates as discreteUpdates_new,
flushDiscreteUpdates as flushDiscreteUpdates_new,
flushControlled as flushControlled_new,
flushSync as flushSync_new,
flushPassiveEffects as flushPassiveEffects_new,
IsThisRendererActing as IsThisRendererActing_new,
getPublicRootInstance as getPublicRootInstance_new,
attemptSynchronousHydration as attemptSynchronousHydration_new,
attemptUserBlockingHydration as attemptUserBlockingHydration_new,
attemptContinuousHydration as attemptContinuousHydration_new,
attemptHydrationAtCurrentPriority as attemptHydrationAtCurrentPriority_new,
findHostInstance as findHostInstance_new,
findHostInstanceWithWarning as findHostInstanceWithWarning_new,
findHostInstanceWithNoPortals as findHostInstanceWithNoPortals_new,
shouldSuspend as shouldSuspend_new,
injectIntoDevTools as injectIntoDevTools_new,
act as act_new,
createPortal as createPortal_new,
} from './ReactFiberReconciler.new';
export const createContainer = enableNewReconciler
? createContainer_new
: createContainer_old;
export const updateContainer = enableNewReconciler
? updateContainer_new
: updateContainer_old;
export const batchedEventUpdates = enableNewReconciler
? batchedEventUpdates_new
: batchedEventUpdates_old;
export const batchedUpdates = enableNewReconciler
? batchedUpdates_new
: batchedUpdates_old;
export const unbatchedUpdates = enableNewReconciler
? unbatchedUpdates_new
: unbatchedUpdates_old;
export const deferredUpdates = enableNewReconciler
? deferredUpdates_new
: deferredUpdates_old;
export const discreteUpdates = enableNewReconciler
? discreteUpdates_new
: discreteUpdates_old;
export const flushDiscreteUpdates = enableNewReconciler
? flushDiscreteUpdates_new
: flushDiscreteUpdates_old;
export const flushControlled = enableNewReconciler
? flushControlled_new
: flushControlled_old;
export const flushSync = enableNewReconciler ? flushSync_new : flushSync_old;
export const flushPassiveEffects = enableNewReconciler
? flushPassiveEffects_new
: flushPassiveEffects_old;
export const IsThisRendererActing = enableNewReconciler
? IsThisRendererActing_new
: IsThisRendererActing_old;
export const getPublicRootInstance = enableNewReconciler
? getPublicRootInstance_new
: getPublicRootInstance_old;
export const attemptSynchronousHydration = enableNewReconciler
? attemptSynchronousHydration_new
: attemptSynchronousHydration_old;
export const attemptUserBlockingHydration = enableNewReconciler
? attemptUserBlockingHydration_new
: attemptUserBlockingHydration_old;
export const attemptContinuousHydration = enableNewReconciler
? attemptContinuousHydration_new
: attemptContinuousHydration_old;
export const attemptHydrationAtCurrentPriority = enableNewReconciler
? attemptHydrationAtCurrentPriority_new
: attemptHydrationAtCurrentPriority_old;
export const findHostInstance = enableNewReconciler
? findHostInstance_new
: findHostInstance_old;
export const findHostInstanceWithWarning = enableNewReconciler
? findHostInstanceWithWarning_new
: findHostInstanceWithWarning_old;
export const findHostInstanceWithNoPortals = enableNewReconciler
? findHostInstanceWithNoPortals_new
: findHostInstanceWithNoPortals_old;
export const shouldSuspend = enableNewReconciler
? shouldSuspend_new
: shouldSuspend_old;
export const injectIntoDevTools = enableNewReconciler
? injectIntoDevTools_new
: injectIntoDevTools_old;
export const act = enableNewReconciler ? act_new : act_old;
export const createPortal = enableNewReconciler
? createPortal_new
: createPortal_old;