react-dom 15.4.0-rc.3 → 15.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-dom-server.js +420 -364
- package/dist/react-dom-server.min.js +5 -5
- package/dist/react-dom.js +519 -464
- package/dist/react-dom.min.js +5 -5
- package/lib/EventPluginHub.js +27 -0
- package/lib/PooledClass.js +1 -13
- package/lib/ReactChildFiber.js +7 -9
- package/lib/ReactCompositeComponent.js +3 -3
- package/lib/ReactDOMComponent.js +10 -4
- package/lib/ReactDOMComponentTree.js +8 -1
- package/lib/ReactDOMInput.js +11 -1
- package/lib/ReactDOMTextarea.js +9 -3
- package/lib/ReactDOMUMDEntry.js +10 -9
- package/lib/ReactDebugTool.js +5 -6
- package/lib/ReactFiber.js +9 -9
- package/lib/ReactFiberBeginWork.js +26 -31
- package/lib/ReactFiberCommitWork.js +5 -7
- package/lib/ReactFiberCompleteWork.js +13 -14
- package/lib/ReactFiberReconciler.js +5 -8
- package/lib/ReactFiberRoot.js +2 -4
- package/lib/ReactFiberScheduler.js +13 -20
- package/lib/ReactHostComponent.js +1 -9
- package/lib/ReactInstanceType.js +9 -10
- package/lib/ReactOwner.js +2 -2
- package/lib/ReactPerf.js +45 -45
- package/lib/ReactReconciler.js +2 -2
- package/lib/ReactRef.js +5 -5
- package/lib/ReactReifiedYield.js +2 -4
- package/lib/ReactShallowRenderer.js +3 -4
- package/lib/ReactTestUtils.js +2 -2
- package/lib/ReactVersion.js +1 -1
- package/lib/ResponderTouchHistoryStore.js +3 -3
- package/lib/SimpleEventPlugin.js +1 -16
- package/lib/getNextDebugID.js +20 -0
- package/lib/instantiateReactComponent.js +13 -4
- package/lib/renderSubtreeIntoContainer.js +1 -2
- package/package.json +2 -2
package/lib/EventPluginHub.js
CHANGED
|
@@ -60,6 +60,28 @@ var getDictionaryKey = function (inst) {
|
|
|
60
60
|
return '.' + inst._rootNodeID;
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
+
function isInteractive(tag) {
|
|
64
|
+
return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function shouldPreventMouseEvent(name, type, props) {
|
|
68
|
+
switch (name) {
|
|
69
|
+
case 'onClick':
|
|
70
|
+
case 'onClickCapture':
|
|
71
|
+
case 'onDoubleClick':
|
|
72
|
+
case 'onDoubleClickCapture':
|
|
73
|
+
case 'onMouseDown':
|
|
74
|
+
case 'onMouseDownCapture':
|
|
75
|
+
case 'onMouseMove':
|
|
76
|
+
case 'onMouseMoveCapture':
|
|
77
|
+
case 'onMouseUp':
|
|
78
|
+
case 'onMouseUpCapture':
|
|
79
|
+
return !!(props.disabled && isInteractive(type));
|
|
80
|
+
default:
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
63
85
|
/**
|
|
64
86
|
* This is a unified interface for event plugins to be installed and configured.
|
|
65
87
|
*
|
|
@@ -128,7 +150,12 @@ var EventPluginHub = {
|
|
|
128
150
|
* @return {?function} The stored callback.
|
|
129
151
|
*/
|
|
130
152
|
getListener: function (inst, registrationName) {
|
|
153
|
+
// TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
|
|
154
|
+
// live here; needs to be moved to a better place soon
|
|
131
155
|
var bankForRegistrationName = listenerBank[registrationName];
|
|
156
|
+
if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, inst._currentElement.props)) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
132
159
|
var key = getDictionaryKey(inst);
|
|
133
160
|
return bankForRegistrationName && bankForRegistrationName[key];
|
|
134
161
|
},
|
package/lib/PooledClass.js
CHANGED
|
@@ -66,17 +66,6 @@ var fourArgumentPooler = function (a1, a2, a3, a4) {
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
|
|
70
|
-
var Klass = this;
|
|
71
|
-
if (Klass.instancePool.length) {
|
|
72
|
-
var instance = Klass.instancePool.pop();
|
|
73
|
-
Klass.call(instance, a1, a2, a3, a4, a5);
|
|
74
|
-
return instance;
|
|
75
|
-
} else {
|
|
76
|
-
return new Klass(a1, a2, a3, a4, a5);
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
69
|
var standardReleaser = function (instance) {
|
|
81
70
|
var Klass = this;
|
|
82
71
|
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
|
|
@@ -116,8 +105,7 @@ var PooledClass = {
|
|
|
116
105
|
oneArgumentPooler: oneArgumentPooler,
|
|
117
106
|
twoArgumentPooler: twoArgumentPooler,
|
|
118
107
|
threeArgumentPooler: threeArgumentPooler,
|
|
119
|
-
fourArgumentPooler: fourArgumentPooler
|
|
120
|
-
fiveArgumentPooler: fiveArgumentPooler
|
|
108
|
+
fourArgumentPooler: fourArgumentPooler
|
|
121
109
|
};
|
|
122
110
|
|
|
123
111
|
module.exports = PooledClass;
|
package/lib/ReactChildFiber.js
CHANGED
|
@@ -13,19 +13,17 @@
|
|
|
13
13
|
|
|
14
14
|
var REACT_ELEMENT_TYPE = require('./ReactElementSymbol');
|
|
15
15
|
|
|
16
|
-
var _require = require('./ReactCoroutine')
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var REACT_YIELD_TYPE = _require.REACT_YIELD_TYPE;
|
|
20
|
-
|
|
16
|
+
var _require = require('./ReactCoroutine'),
|
|
17
|
+
REACT_COROUTINE_TYPE = _require.REACT_COROUTINE_TYPE,
|
|
18
|
+
REACT_YIELD_TYPE = _require.REACT_YIELD_TYPE;
|
|
21
19
|
|
|
22
20
|
var ReactFiber = require('./ReactFiber');
|
|
23
21
|
var ReactReifiedYield = require('./ReactReifiedYield');
|
|
24
22
|
|
|
25
|
-
var cloneFiber = ReactFiber.cloneFiber
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
var cloneFiber = ReactFiber.cloneFiber,
|
|
24
|
+
createFiberFromElement = ReactFiber.createFiberFromElement,
|
|
25
|
+
createFiberFromCoroutine = ReactFiber.createFiberFromCoroutine,
|
|
26
|
+
createFiberFromYield = ReactFiber.createFiberFromYield;
|
|
29
27
|
var createReifiedYield = ReactReifiedYield.createReifiedYield;
|
|
30
28
|
|
|
31
29
|
|
|
@@ -232,7 +232,7 @@ var ReactCompositeComponent = {
|
|
|
232
232
|
// Since plain JS classes are defined without any special initialization
|
|
233
233
|
// logic, we can not catch common errors early. Therefore, we have to
|
|
234
234
|
// catch them here, at initialization time, instead.
|
|
235
|
-
process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
|
|
235
|
+
process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
|
|
236
236
|
process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
|
|
237
237
|
process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;
|
|
238
238
|
process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;
|
|
@@ -841,10 +841,10 @@ var ReactCompositeComponent = {
|
|
|
841
841
|
* @final
|
|
842
842
|
* @private
|
|
843
843
|
*/
|
|
844
|
-
attachRef: function (ref, component
|
|
844
|
+
attachRef: function (ref, component) {
|
|
845
845
|
var inst = this.getPublicInstance();
|
|
846
846
|
!(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : _prodInvariant('110') : void 0;
|
|
847
|
-
var publicComponentInstance = component.getPublicInstance(
|
|
847
|
+
var publicComponentInstance = component.getPublicInstance();
|
|
848
848
|
if (process.env.NODE_ENV !== 'production') {
|
|
849
849
|
var componentName = component && component.getName ? component.getName() : 'a component';
|
|
850
850
|
process.env.NODE_ENV !== 'production' ? warning(publicComponentInstance != null || component._compositeType !== CompositeTypes.StatelessFunctional, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0;
|
package/lib/ReactDOMComponent.js
CHANGED
|
@@ -681,12 +681,18 @@ ReactDOMComponent.Mixin = {
|
|
|
681
681
|
} else {
|
|
682
682
|
var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
|
|
683
683
|
var childrenToUse = contentToUse != null ? null : props.children;
|
|
684
|
+
// TODO: Validate that text is allowed as a child of this node
|
|
684
685
|
if (contentToUse != null) {
|
|
685
|
-
//
|
|
686
|
-
|
|
687
|
-
|
|
686
|
+
// Avoid setting textContent when the text is empty. In IE11 setting
|
|
687
|
+
// textContent on a text area will cause the placeholder to not
|
|
688
|
+
// show within the textarea until it has been focused and blurred again.
|
|
689
|
+
// https://github.com/facebook/react/issues/6731#issuecomment-254874553
|
|
690
|
+
if (contentToUse !== '') {
|
|
691
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
692
|
+
setAndValidateContentChildDev.call(this, contentToUse);
|
|
693
|
+
}
|
|
694
|
+
DOMLazyTree.queueText(lazyTree, contentToUse);
|
|
688
695
|
}
|
|
689
|
-
DOMLazyTree.queueText(lazyTree, contentToUse);
|
|
690
696
|
} else if (childrenToUse != null) {
|
|
691
697
|
var mountImages = this.mountChildren(childrenToUse, transaction, context);
|
|
692
698
|
for (var i = 0; i < mountImages.length; i++) {
|
|
@@ -22,6 +22,13 @@ var Flags = ReactDOMComponentFlags;
|
|
|
22
22
|
|
|
23
23
|
var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Check if a given node should be cached.
|
|
27
|
+
*/
|
|
28
|
+
function shouldPrecacheNode(node, nodeID) {
|
|
29
|
+
return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' ';
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
/**
|
|
26
33
|
* Drill down (through composites and empty components) until we get a host or
|
|
27
34
|
* host text component.
|
|
@@ -87,7 +94,7 @@ function precacheChildNodes(inst, node) {
|
|
|
87
94
|
}
|
|
88
95
|
// We assume the child nodes are in the same order as the child instances.
|
|
89
96
|
for (; childNode !== null; childNode = childNode.nextSibling) {
|
|
90
|
-
if (
|
|
97
|
+
if (shouldPrecacheNode(childNode, childID)) {
|
|
91
98
|
precacheNode(childInst, childNode);
|
|
92
99
|
continue outer;
|
|
93
100
|
}
|
package/lib/ReactDOMInput.js
CHANGED
|
@@ -157,7 +157,17 @@ var ReactDOMInput = {
|
|
|
157
157
|
}
|
|
158
158
|
} else {
|
|
159
159
|
if (props.value == null && props.defaultValue != null) {
|
|
160
|
-
|
|
160
|
+
// In Chrome, assigning defaultValue to certain input types triggers input validation.
|
|
161
|
+
// For number inputs, the display value loses trailing decimal points. For email inputs,
|
|
162
|
+
// Chrome raises "The specified value <x> is not a valid email address".
|
|
163
|
+
//
|
|
164
|
+
// Here we check to see if the defaultValue has actually changed, avoiding these problems
|
|
165
|
+
// when the user is inputting text
|
|
166
|
+
//
|
|
167
|
+
// https://github.com/facebook/react/issues/7253
|
|
168
|
+
if (node.defaultValue !== '' + props.defaultValue) {
|
|
169
|
+
node.defaultValue = '' + props.defaultValue;
|
|
170
|
+
}
|
|
161
171
|
}
|
|
162
172
|
if (props.checked == null && props.defaultChecked != null) {
|
|
163
173
|
node.defaultChecked = !!props.defaultChecked;
|
package/lib/ReactDOMTextarea.js
CHANGED
|
@@ -137,9 +137,15 @@ var ReactDOMTextarea = {
|
|
|
137
137
|
// This is in postMount because we need access to the DOM node, which is not
|
|
138
138
|
// available until after the component has mounted.
|
|
139
139
|
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
node.value
|
|
140
|
+
var textContent = node.textContent;
|
|
141
|
+
|
|
142
|
+
// Only set node.value if textContent is equal to the expected
|
|
143
|
+
// initial value. In IE10/IE11 there is a bug where the placeholder attribute
|
|
144
|
+
// will populate textContent as well.
|
|
145
|
+
// https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
|
|
146
|
+
if (textContent === inst._wrapperState.initialValue) {
|
|
147
|
+
node.value = textContent;
|
|
148
|
+
}
|
|
143
149
|
}
|
|
144
150
|
};
|
|
145
151
|
|
package/lib/ReactDOMUMDEntry.js
CHANGED
|
@@ -10,23 +10,24 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
var
|
|
14
|
-
|
|
13
|
+
var React = require('react/lib/React');
|
|
15
14
|
var ReactDOM = require('./ReactDOM');
|
|
16
15
|
|
|
17
|
-
var ReactDOMUMDEntry =
|
|
18
|
-
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
|
|
19
|
-
ReactInstanceMap: require('./ReactInstanceMap')
|
|
20
|
-
}
|
|
21
|
-
}, ReactDOM);
|
|
16
|
+
var ReactDOMUMDEntry = ReactDOM;
|
|
22
17
|
|
|
23
18
|
if (process.env.NODE_ENV !== 'production') {
|
|
24
|
-
|
|
19
|
+
ReactDOMUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
|
|
25
20
|
// ReactPerf and ReactTestUtils currently only work with the DOM renderer
|
|
26
21
|
// so we expose them from here, but only in DEV mode.
|
|
27
22
|
ReactPerf: require('./ReactPerf'),
|
|
28
23
|
ReactTestUtils: require('./ReactTestUtils')
|
|
29
|
-
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Inject ReactDOM into React for the addons UMD build that depends on ReactDOM (TransitionGroup).
|
|
28
|
+
// We can remove this after we deprecate and remove the addons UMD build.
|
|
29
|
+
if (React.addons) {
|
|
30
|
+
React.__SECRET_INJECTED_REACT_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOMUMDEntry;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
module.exports = ReactDOMUMDEntry;
|
package/lib/ReactDebugTool.js
CHANGED
|
@@ -164,12 +164,11 @@ function pauseCurrentLifeCycleTimer() {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
function resumeCurrentLifeCycleTimer() {
|
|
167
|
-
var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop()
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
var timerType = _lifeCycleTimerStack$.timerType;
|
|
167
|
+
var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(),
|
|
168
|
+
startTime = _lifeCycleTimerStack$.startTime,
|
|
169
|
+
nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime,
|
|
170
|
+
debugID = _lifeCycleTimerStack$.debugID,
|
|
171
|
+
timerType = _lifeCycleTimerStack$.timerType;
|
|
173
172
|
|
|
174
173
|
var nestedFlushDuration = performanceNow() - nestedFlushStartTime;
|
|
175
174
|
currentTimerStartTime = startTime;
|
package/lib/ReactFiber.js
CHANGED
|
@@ -12,16 +12,15 @@
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
14
|
var ReactTypeOfWork = require('./ReactTypeOfWork');
|
|
15
|
-
var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent,
|
|
16
|
+
ClassComponent = ReactTypeOfWork.ClassComponent,
|
|
17
|
+
HostContainer = ReactTypeOfWork.HostContainer,
|
|
18
|
+
HostComponent = ReactTypeOfWork.HostComponent,
|
|
19
|
+
CoroutineComponent = ReactTypeOfWork.CoroutineComponent,
|
|
20
|
+
YieldComponent = ReactTypeOfWork.YieldComponent;
|
|
21
21
|
|
|
22
|
-
var _require = require('./ReactPriorityLevel')
|
|
23
|
-
|
|
24
|
-
var NoWork = _require.NoWork;
|
|
22
|
+
var _require = require('./ReactPriorityLevel'),
|
|
23
|
+
NoWork = _require.NoWork;
|
|
25
24
|
|
|
26
25
|
// An Instance is shared between all versions of a component. We can easily
|
|
27
26
|
// break this out into a separate object to avoid copying so much to the
|
|
@@ -32,6 +31,7 @@ var NoWork = _require.NoWork;
|
|
|
32
31
|
// A Fiber is work on a Component that needs to be done or was done. There can
|
|
33
32
|
// be more than one per component.
|
|
34
33
|
|
|
34
|
+
|
|
35
35
|
// This is a constructor of a POJO instead of a constructor function for a few
|
|
36
36
|
// reasons:
|
|
37
37
|
// 1) Nobody should add any instance methods on this. Instance methods can be
|
|
@@ -11,37 +11,33 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var _require = require('./ReactChildFiber')
|
|
14
|
+
var _require = require('./ReactChildFiber'),
|
|
15
|
+
reconcileChildFibers = _require.reconcileChildFibers,
|
|
16
|
+
reconcileChildFibersInPlace = _require.reconcileChildFibersInPlace,
|
|
17
|
+
cloneChildFibers = _require.cloneChildFibers;
|
|
15
18
|
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
var cloneChildFibers = _require.cloneChildFibers;
|
|
19
|
-
|
|
20
|
-
var _require2 = require('./ReactPriorityLevel');
|
|
21
|
-
|
|
22
|
-
var LowPriority = _require2.LowPriority;
|
|
19
|
+
var _require2 = require('./ReactPriorityLevel'),
|
|
20
|
+
LowPriority = _require2.LowPriority;
|
|
23
21
|
|
|
24
22
|
var ReactTypeOfWork = require('./ReactTypeOfWork');
|
|
25
|
-
var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var _require3 = require('./ReactPriorityLevel')
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var addCallbackToQueue = _require4.addCallbackToQueue;
|
|
44
|
-
var mergeUpdateQueue = _require4.mergeUpdateQueue;
|
|
23
|
+
var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent,
|
|
24
|
+
FunctionalComponent = ReactTypeOfWork.FunctionalComponent,
|
|
25
|
+
ClassComponent = ReactTypeOfWork.ClassComponent,
|
|
26
|
+
HostContainer = ReactTypeOfWork.HostContainer,
|
|
27
|
+
HostComponent = ReactTypeOfWork.HostComponent,
|
|
28
|
+
CoroutineComponent = ReactTypeOfWork.CoroutineComponent,
|
|
29
|
+
CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase,
|
|
30
|
+
YieldComponent = ReactTypeOfWork.YieldComponent;
|
|
31
|
+
|
|
32
|
+
var _require3 = require('./ReactPriorityLevel'),
|
|
33
|
+
NoWork = _require3.NoWork,
|
|
34
|
+
OffscreenPriority = _require3.OffscreenPriority;
|
|
35
|
+
|
|
36
|
+
var _require4 = require('./ReactFiberUpdateQueue'),
|
|
37
|
+
createUpdateQueue = _require4.createUpdateQueue,
|
|
38
|
+
addToQueue = _require4.addToQueue,
|
|
39
|
+
addCallbackToQueue = _require4.addCallbackToQueue,
|
|
40
|
+
mergeUpdateQueue = _require4.mergeUpdateQueue;
|
|
45
41
|
|
|
46
42
|
var ReactInstanceMap = require('./ReactInstanceMap');
|
|
47
43
|
|
|
@@ -103,9 +99,8 @@ module.exports = function (config, getScheduler) {
|
|
|
103
99
|
}
|
|
104
100
|
|
|
105
101
|
function scheduleUpdate(fiber, updateQueue, priorityLevel) {
|
|
106
|
-
var _getScheduler = getScheduler()
|
|
107
|
-
|
|
108
|
-
var scheduleDeferredWork = _getScheduler.scheduleDeferredWork;
|
|
102
|
+
var _getScheduler = getScheduler(),
|
|
103
|
+
scheduleDeferredWork = _getScheduler.scheduleDeferredWork;
|
|
109
104
|
|
|
110
105
|
fiber.updateQueue = updateQueue;
|
|
111
106
|
// Schedule update on the alternate as well, since we don't know which tree
|
|
@@ -12,14 +12,12 @@
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
14
|
var ReactTypeOfWork = require('./ReactTypeOfWork');
|
|
15
|
-
var ClassComponent = ReactTypeOfWork.ClassComponent
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var _require = require('./ReactFiberUpdateQueue');
|
|
20
|
-
|
|
21
|
-
var callCallbacks = _require.callCallbacks;
|
|
15
|
+
var ClassComponent = ReactTypeOfWork.ClassComponent,
|
|
16
|
+
HostContainer = ReactTypeOfWork.HostContainer,
|
|
17
|
+
HostComponent = ReactTypeOfWork.HostComponent;
|
|
22
18
|
|
|
19
|
+
var _require = require('./ReactFiberUpdateQueue'),
|
|
20
|
+
callCallbacks = _require.callCallbacks;
|
|
23
21
|
|
|
24
22
|
module.exports = function (config) {
|
|
25
23
|
|
|
@@ -11,19 +11,18 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var _require = require('./ReactChildFiber')
|
|
15
|
-
|
|
16
|
-
var reconcileChildFibers = _require.reconcileChildFibers;
|
|
14
|
+
var _require = require('./ReactChildFiber'),
|
|
15
|
+
reconcileChildFibers = _require.reconcileChildFibers;
|
|
17
16
|
|
|
18
17
|
var ReactTypeOfWork = require('./ReactTypeOfWork');
|
|
19
|
-
var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent,
|
|
19
|
+
FunctionalComponent = ReactTypeOfWork.FunctionalComponent,
|
|
20
|
+
ClassComponent = ReactTypeOfWork.ClassComponent,
|
|
21
|
+
HostContainer = ReactTypeOfWork.HostContainer,
|
|
22
|
+
HostComponent = ReactTypeOfWork.HostComponent,
|
|
23
|
+
CoroutineComponent = ReactTypeOfWork.CoroutineComponent,
|
|
24
|
+
CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase,
|
|
25
|
+
YieldComponent = ReactTypeOfWork.YieldComponent;
|
|
27
26
|
|
|
28
27
|
|
|
29
28
|
module.exports = function (config) {
|
|
@@ -126,9 +125,9 @@ module.exports = function (config) {
|
|
|
126
125
|
// merged it and assigned it to the instance. Transfer it from there.
|
|
127
126
|
// Also need to transfer the props, because pendingProps will be null
|
|
128
127
|
// in the case of an update
|
|
129
|
-
var _workInProgress$state = workInProgress.stateNode
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
var _workInProgress$state = workInProgress.stateNode,
|
|
129
|
+
state = _workInProgress$state.state,
|
|
130
|
+
props = _workInProgress$state.props;
|
|
132
131
|
|
|
133
132
|
workInProgress.memoizedState = state;
|
|
134
133
|
workInProgress.memoizedProps = props;
|
|
@@ -11,18 +11,15 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var _require = require('./ReactFiberRoot')
|
|
15
|
-
|
|
16
|
-
var createFiberRoot = _require.createFiberRoot;
|
|
14
|
+
var _require = require('./ReactFiberRoot'),
|
|
15
|
+
createFiberRoot = _require.createFiberRoot;
|
|
17
16
|
|
|
18
17
|
var ReactFiberScheduler = require('./ReactFiberScheduler');
|
|
19
18
|
|
|
20
19
|
module.exports = function (config) {
|
|
21
|
-
var _ReactFiberScheduler = ReactFiberScheduler(config)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var performWithPriority = _ReactFiberScheduler.performWithPriority;
|
|
25
|
-
|
|
20
|
+
var _ReactFiberScheduler = ReactFiberScheduler(config),
|
|
21
|
+
scheduleWork = _ReactFiberScheduler.scheduleWork,
|
|
22
|
+
performWithPriority = _ReactFiberScheduler.performWithPriority;
|
|
26
23
|
|
|
27
24
|
return {
|
|
28
25
|
mountContainer: function (element, containerInfo) {
|
package/lib/ReactFiberRoot.js
CHANGED
|
@@ -11,10 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var _require = require('./ReactFiber')
|
|
15
|
-
|
|
16
|
-
var createHostContainerFiber = _require.createHostContainerFiber;
|
|
17
|
-
|
|
14
|
+
var _require = require('./ReactFiber'),
|
|
15
|
+
createHostContainerFiber = _require.createHostContainerFiber;
|
|
18
16
|
|
|
19
17
|
exports.createFiberRoot = function (containerInfo) {
|
|
20
18
|
// Cyclic construction. This cheats the type system right now because
|
|
@@ -15,17 +15,14 @@ var ReactFiberBeginWork = require('./ReactFiberBeginWork');
|
|
|
15
15
|
var ReactFiberCompleteWork = require('./ReactFiberCompleteWork');
|
|
16
16
|
var ReactFiberCommitWork = require('./ReactFiberCommitWork');
|
|
17
17
|
|
|
18
|
-
var _require = require('./ReactFiber')
|
|
19
|
-
|
|
20
|
-
var cloneFiber = _require.cloneFiber;
|
|
21
|
-
|
|
22
|
-
var _require2 = require('./ReactPriorityLevel');
|
|
23
|
-
|
|
24
|
-
var NoWork = _require2.NoWork;
|
|
25
|
-
var LowPriority = _require2.LowPriority;
|
|
26
|
-
var AnimationPriority = _require2.AnimationPriority;
|
|
27
|
-
var SynchronousPriority = _require2.SynchronousPriority;
|
|
18
|
+
var _require = require('./ReactFiber'),
|
|
19
|
+
cloneFiber = _require.cloneFiber;
|
|
28
20
|
|
|
21
|
+
var _require2 = require('./ReactPriorityLevel'),
|
|
22
|
+
NoWork = _require2.NoWork,
|
|
23
|
+
LowPriority = _require2.LowPriority,
|
|
24
|
+
AnimationPriority = _require2.AnimationPriority,
|
|
25
|
+
SynchronousPriority = _require2.SynchronousPriority;
|
|
29
26
|
|
|
30
27
|
var timeHeuristicForUnitOfWork = 1;
|
|
31
28
|
|
|
@@ -37,18 +34,14 @@ module.exports = function (config) {
|
|
|
37
34
|
return scheduler;
|
|
38
35
|
}
|
|
39
36
|
|
|
40
|
-
var _ReactFiberBeginWork = ReactFiberBeginWork(config, getScheduler)
|
|
41
|
-
|
|
42
|
-
var beginWork = _ReactFiberBeginWork.beginWork;
|
|
43
|
-
|
|
44
|
-
var _ReactFiberCompleteWo = ReactFiberCompleteWork(config);
|
|
45
|
-
|
|
46
|
-
var completeWork = _ReactFiberCompleteWo.completeWork;
|
|
47
|
-
|
|
48
|
-
var _ReactFiberCommitWork = ReactFiberCommitWork(config);
|
|
37
|
+
var _ReactFiberBeginWork = ReactFiberBeginWork(config, getScheduler),
|
|
38
|
+
beginWork = _ReactFiberBeginWork.beginWork;
|
|
49
39
|
|
|
50
|
-
var
|
|
40
|
+
var _ReactFiberCompleteWo = ReactFiberCompleteWork(config),
|
|
41
|
+
completeWork = _ReactFiberCompleteWo.completeWork;
|
|
51
42
|
|
|
43
|
+
var _ReactFiberCommitWork = ReactFiberCommitWork(config),
|
|
44
|
+
commitWork = _ReactFiberCommitWork.commitWork;
|
|
52
45
|
|
|
53
46
|
var scheduleAnimationCallback = config.scheduleAnimationCallback;
|
|
54
47
|
var scheduleDeferredCallback = config.scheduleDeferredCallback;
|
|
@@ -10,14 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
var _prodInvariant = require('./reactProdInvariant')
|
|
14
|
-
_assign = require('object-assign');
|
|
13
|
+
var _prodInvariant = require('./reactProdInvariant');
|
|
15
14
|
|
|
16
15
|
var invariant = require('fbjs/lib/invariant');
|
|
17
16
|
|
|
18
17
|
var genericComponentClass = null;
|
|
19
|
-
// This registry keeps track of wrapper classes around host tags.
|
|
20
|
-
var tagToComponentClass = {};
|
|
21
18
|
var textComponentClass = null;
|
|
22
19
|
|
|
23
20
|
var ReactHostComponentInjection = {
|
|
@@ -30,11 +27,6 @@ var ReactHostComponentInjection = {
|
|
|
30
27
|
// rendered as props.
|
|
31
28
|
injectTextComponentClass: function (componentClass) {
|
|
32
29
|
textComponentClass = componentClass;
|
|
33
|
-
},
|
|
34
|
-
// This accepts a keyed object with classes as values. Each key represents a
|
|
35
|
-
// tag. That particular tag will use this class instead of the generic one.
|
|
36
|
-
injectComponentClasses: function (componentClasses) {
|
|
37
|
-
_assign(tagToComponentClass, componentClasses);
|
|
38
30
|
}
|
|
39
31
|
};
|
|
40
32
|
|
package/lib/ReactInstanceType.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2016-present, Facebook, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the BSD-style license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
*/
|
|
2
|
+
* Copyright 2016-present, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
package/lib/ReactOwner.js
CHANGED
|
@@ -64,9 +64,9 @@ var ReactOwner = {
|
|
|
64
64
|
* @final
|
|
65
65
|
* @internal
|
|
66
66
|
*/
|
|
67
|
-
addComponentAsRefTo: function (component, ref, owner
|
|
67
|
+
addComponentAsRefTo: function (component, ref, owner) {
|
|
68
68
|
!isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('119') : void 0;
|
|
69
|
-
owner.attachRef(ref, component
|
|
69
|
+
owner.attachRef(ref, component);
|
|
70
70
|
},
|
|
71
71
|
|
|
72
72
|
/**
|