react 15.0.2 → 15.1.0
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-with-addons.js +1545 -918
- package/dist/react-with-addons.min.js +6 -6
- package/dist/react.js +1515 -1339
- package/dist/react.min.js +6 -6
- package/lib/CSSPropertyOperations.js +5 -5
- package/lib/DOMChildrenOperations.js +41 -6
- package/lib/DOMLazyTree.js +15 -3
- package/lib/DOMPropertyOperations.js +22 -13
- package/lib/LinkedStateMixin.js +1 -0
- package/lib/ReactCSSTransitionGroup.js +5 -0
- package/lib/ReactChildren.js +9 -1
- package/lib/ReactClass.js +1 -0
- package/lib/ReactComponentBrowserEnvironment.js +0 -5
- package/lib/ReactComponentTreeDevtool.js +145 -0
- package/lib/ReactComponentWithPureRenderMixin.js +2 -0
- package/lib/ReactCompositeComponent.js +147 -18
- package/lib/ReactDOM.js +1 -4
- package/lib/ReactDOMComponent.js +51 -11
- package/lib/ReactDOMIDOperations.js +0 -5
- package/lib/ReactDOMInput.js +5 -3
- package/lib/ReactDOMTextComponent.js +7 -6
- package/lib/ReactDebugTool.js +188 -10
- package/lib/ReactDefaultInjection.js +0 -9
- package/lib/ReactElement.js +26 -0
- package/lib/ReactFragment.js +5 -2
- package/lib/ReactInjection.js +0 -2
- package/lib/ReactLink.js +3 -0
- package/lib/ReactMount.js +22 -7
- package/lib/ReactMultiChild.js +21 -0
- package/lib/ReactNativeAttributePayload.js +7 -36
- package/lib/{IOSNativeBridgeEventPlugin.js → ReactNativeBridgeEventPlugin.js} +8 -5
- package/lib/ReactNativeDOMIDOperations.js +3 -6
- package/lib/ReactNativeDefaultInjection.js +15 -12
- package/lib/ReactNativeEventEmitter.js +6 -3
- package/lib/{IOSDefaultEventPluginOrder.js → ReactNativeEventPluginOrder.js} +3 -3
- package/lib/ReactNativeMount.js +24 -7
- package/lib/ReactNativeOperationHistoryDevtool.js +37 -0
- package/lib/ReactNativeTextComponent.js +8 -0
- package/lib/ReactPerf.js +397 -75
- package/lib/ReactReconciler.js +46 -5
- package/lib/ReactServerRendering.js +20 -1
- package/lib/ReactServerRenderingTransaction.js +5 -1
- package/lib/ReactTestUtils.js +8 -0
- package/lib/ReactTransitionGroup.js +5 -0
- package/lib/ReactUpdates.js +21 -3
- package/lib/ReactVersion.js +1 -1
- package/lib/ReactWithAddons.js +1 -1
- package/lib/findDOMNode.js +2 -0
- package/lib/instantiateReactComponent.js +34 -1
- package/lib/onlyChild.js +7 -4
- package/lib/shallowCompare.js +1 -0
- package/lib/update.js +4 -0
- package/package.json +2 -2
- package/lib/ReactDebugInstanceMap.js +0 -102
- package/lib/ReactDefaultPerf.js +0 -316
- package/lib/ReactDefaultPerfAnalysis.js +0 -210
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
|
|
14
14
|
var DOMChildrenOperations = require('./DOMChildrenOperations');
|
|
15
15
|
var ReactDOMComponentTree = require('./ReactDOMComponentTree');
|
|
16
|
-
var ReactPerf = require('./ReactPerf');
|
|
17
16
|
|
|
18
17
|
/**
|
|
19
18
|
* Operations used to process updates to DOM nodes.
|
|
@@ -32,8 +31,4 @@ var ReactDOMIDOperations = {
|
|
|
32
31
|
}
|
|
33
32
|
};
|
|
34
33
|
|
|
35
|
-
ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', {
|
|
36
|
-
dangerouslyProcessChildrenUpdates: 'dangerouslyProcessChildrenUpdates'
|
|
37
|
-
});
|
|
38
|
-
|
|
39
34
|
module.exports = ReactDOMIDOperations;
|
package/lib/ReactDOMInput.js
CHANGED
|
@@ -85,6 +85,8 @@ var ReactDOMInput = {
|
|
|
85
85
|
if (process.env.NODE_ENV !== 'production') {
|
|
86
86
|
LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
|
|
87
87
|
|
|
88
|
+
var owner = inst._currentElement._owner;
|
|
89
|
+
|
|
88
90
|
if (props.valueLink !== undefined && !didWarnValueLink) {
|
|
89
91
|
process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
|
|
90
92
|
didWarnValueLink = true;
|
|
@@ -94,11 +96,11 @@ var ReactDOMInput = {
|
|
|
94
96
|
didWarnCheckedLink = true;
|
|
95
97
|
}
|
|
96
98
|
if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
|
|
97
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
|
|
99
|
+
process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
|
|
98
100
|
didWarnCheckedDefaultChecked = true;
|
|
99
101
|
}
|
|
100
102
|
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
|
|
101
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
|
|
103
|
+
process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
|
|
102
104
|
didWarnValueDefaultValue = true;
|
|
103
105
|
}
|
|
104
106
|
warnIfValueIsNull(props);
|
|
@@ -129,7 +131,7 @@ var ReactDOMInput = {
|
|
|
129
131
|
var owner = inst._currentElement._owner;
|
|
130
132
|
|
|
131
133
|
if ((initialValue || !inst._wrapperState.controlled) && controlled && !didWarnUncontrolledToControlled) {
|
|
132
|
-
process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing
|
|
134
|
+
process.env.NODE_ENV !== 'production' ? warning(false, '%s is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
|
|
133
135
|
didWarnUncontrolledToControlled = true;
|
|
134
136
|
}
|
|
135
137
|
if (inst._wrapperState.controlled && (defaultValue || !controlled) && !didWarnControlledToUncontrolled) {
|
|
@@ -16,7 +16,7 @@ var _assign = require('object-assign');
|
|
|
16
16
|
var DOMChildrenOperations = require('./DOMChildrenOperations');
|
|
17
17
|
var DOMLazyTree = require('./DOMLazyTree');
|
|
18
18
|
var ReactDOMComponentTree = require('./ReactDOMComponentTree');
|
|
19
|
-
var
|
|
19
|
+
var ReactInstrumentation = require('./ReactInstrumentation');
|
|
20
20
|
|
|
21
21
|
var escapeTextContentForBrowser = require('./escapeTextContentForBrowser');
|
|
22
22
|
var invariant = require('fbjs/lib/invariant');
|
|
@@ -64,6 +64,8 @@ _assign(ReactDOMTextComponent.prototype, {
|
|
|
64
64
|
*/
|
|
65
65
|
mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
|
|
66
66
|
if (process.env.NODE_ENV !== 'production') {
|
|
67
|
+
ReactInstrumentation.debugTool.onSetText(this._debugID, this._stringText);
|
|
68
|
+
|
|
67
69
|
var parentInfo;
|
|
68
70
|
if (nativeParent != null) {
|
|
69
71
|
parentInfo = nativeParent._ancestorInfo;
|
|
@@ -127,6 +129,10 @@ _assign(ReactDOMTextComponent.prototype, {
|
|
|
127
129
|
this._stringText = nextStringText;
|
|
128
130
|
var commentNodes = this.getNativeNode();
|
|
129
131
|
DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
|
|
132
|
+
|
|
133
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
134
|
+
ReactInstrumentation.debugTool.onSetText(this._debugID, nextStringText);
|
|
135
|
+
}
|
|
130
136
|
}
|
|
131
137
|
}
|
|
132
138
|
},
|
|
@@ -161,9 +167,4 @@ _assign(ReactDOMTextComponent.prototype, {
|
|
|
161
167
|
|
|
162
168
|
});
|
|
163
169
|
|
|
164
|
-
ReactPerf.measureMethods(ReactDOMTextComponent.prototype, 'ReactDOMTextComponent', {
|
|
165
|
-
mountComponent: 'mountComponent',
|
|
166
|
-
receiveComponent: 'receiveComponent'
|
|
167
|
-
});
|
|
168
|
-
|
|
169
170
|
module.exports = ReactDOMTextComponent;
|
package/lib/ReactDebugTool.js
CHANGED
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
|
|
15
|
+
|
|
16
|
+
var performanceNow = require('fbjs/lib/performanceNow');
|
|
15
17
|
var warning = require('fbjs/lib/warning');
|
|
16
18
|
|
|
17
19
|
var eventHandlers = [];
|
|
@@ -32,6 +34,70 @@ function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
|
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
|
|
37
|
+
var isProfiling = false;
|
|
38
|
+
var flushHistory = [];
|
|
39
|
+
var currentFlushNesting = 0;
|
|
40
|
+
var currentFlushMeasurements = null;
|
|
41
|
+
var currentFlushStartTime = null;
|
|
42
|
+
var currentTimerDebugID = null;
|
|
43
|
+
var currentTimerStartTime = null;
|
|
44
|
+
var currentTimerType = null;
|
|
45
|
+
|
|
46
|
+
function clearHistory() {
|
|
47
|
+
ReactComponentTreeDevtool.purgeUnmountedComponents();
|
|
48
|
+
ReactNativeOperationHistoryDevtool.clearHistory();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function getTreeSnapshot(registeredIDs) {
|
|
52
|
+
return registeredIDs.reduce(function (tree, id) {
|
|
53
|
+
var ownerID = ReactComponentTreeDevtool.getOwnerID(id);
|
|
54
|
+
var parentID = ReactComponentTreeDevtool.getParentID(id);
|
|
55
|
+
tree[id] = {
|
|
56
|
+
displayName: ReactComponentTreeDevtool.getDisplayName(id),
|
|
57
|
+
text: ReactComponentTreeDevtool.getText(id),
|
|
58
|
+
updateCount: ReactComponentTreeDevtool.getUpdateCount(id),
|
|
59
|
+
childIDs: ReactComponentTreeDevtool.getChildIDs(id),
|
|
60
|
+
// Text nodes don't have owners but this is close enough.
|
|
61
|
+
ownerID: ownerID || ReactComponentTreeDevtool.getOwnerID(parentID),
|
|
62
|
+
parentID: parentID
|
|
63
|
+
};
|
|
64
|
+
return tree;
|
|
65
|
+
}, {});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function resetMeasurements() {
|
|
69
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
70
|
+
var previousStartTime = currentFlushStartTime;
|
|
71
|
+
var previousMeasurements = currentFlushMeasurements || [];
|
|
72
|
+
var previousOperations = ReactNativeOperationHistoryDevtool.getHistory();
|
|
73
|
+
|
|
74
|
+
if (!isProfiling || currentFlushNesting === 0) {
|
|
75
|
+
currentFlushStartTime = null;
|
|
76
|
+
currentFlushMeasurements = null;
|
|
77
|
+
clearHistory();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (previousMeasurements.length || previousOperations.length) {
|
|
82
|
+
var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs();
|
|
83
|
+
flushHistory.push({
|
|
84
|
+
duration: performanceNow() - previousStartTime,
|
|
85
|
+
measurements: previousMeasurements || [],
|
|
86
|
+
operations: previousOperations || [],
|
|
87
|
+
treeSnapshot: getTreeSnapshot(registeredIDs)
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
clearHistory();
|
|
92
|
+
currentFlushStartTime = performanceNow();
|
|
93
|
+
currentFlushMeasurements = [];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function checkDebugID(debugID) {
|
|
98
|
+
process.env.NODE_ENV !== 'production' ? warning(debugID, 'ReactDebugTool: debugID may not be empty.') : void 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
35
101
|
var ReactDebugTool = {
|
|
36
102
|
addDevtool: function (devtool) {
|
|
37
103
|
eventHandlers.push(devtool);
|
|
@@ -44,29 +110,141 @@ var ReactDebugTool = {
|
|
|
44
110
|
}
|
|
45
111
|
}
|
|
46
112
|
},
|
|
113
|
+
beginProfiling: function () {
|
|
114
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
115
|
+
if (isProfiling) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
isProfiling = true;
|
|
120
|
+
flushHistory.length = 0;
|
|
121
|
+
resetMeasurements();
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
endProfiling: function () {
|
|
125
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
126
|
+
if (!isProfiling) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
isProfiling = false;
|
|
131
|
+
resetMeasurements();
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
getFlushHistory: function () {
|
|
135
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
136
|
+
return flushHistory;
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
onBeginFlush: function () {
|
|
140
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
141
|
+
currentFlushNesting++;
|
|
142
|
+
resetMeasurements();
|
|
143
|
+
}
|
|
144
|
+
emitEvent('onBeginFlush');
|
|
145
|
+
},
|
|
146
|
+
onEndFlush: function () {
|
|
147
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
148
|
+
resetMeasurements();
|
|
149
|
+
currentFlushNesting--;
|
|
150
|
+
}
|
|
151
|
+
emitEvent('onEndFlush');
|
|
152
|
+
},
|
|
153
|
+
onBeginLifeCycleTimer: function (debugID, timerType) {
|
|
154
|
+
checkDebugID(debugID);
|
|
155
|
+
emitEvent('onBeginLifeCycleTimer', debugID, timerType);
|
|
156
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
157
|
+
if (isProfiling && currentFlushNesting > 0) {
|
|
158
|
+
process.env.NODE_ENV !== 'production' ? warning(!currentTimerType, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
|
|
159
|
+
currentTimerStartTime = performanceNow();
|
|
160
|
+
currentTimerDebugID = debugID;
|
|
161
|
+
currentTimerType = timerType;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
onEndLifeCycleTimer: function (debugID, timerType) {
|
|
166
|
+
checkDebugID(debugID);
|
|
167
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
168
|
+
if (isProfiling && currentFlushNesting > 0) {
|
|
169
|
+
process.env.NODE_ENV !== 'production' ? warning(currentTimerType === timerType, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
|
|
170
|
+
currentFlushMeasurements.push({
|
|
171
|
+
timerType: timerType,
|
|
172
|
+
instanceID: debugID,
|
|
173
|
+
duration: performanceNow() - currentTimerStartTime
|
|
174
|
+
});
|
|
175
|
+
currentTimerStartTime = null;
|
|
176
|
+
currentTimerDebugID = null;
|
|
177
|
+
currentTimerType = null;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
emitEvent('onEndLifeCycleTimer', debugID, timerType);
|
|
181
|
+
},
|
|
182
|
+
onBeginReconcilerTimer: function (debugID, timerType) {
|
|
183
|
+
checkDebugID(debugID);
|
|
184
|
+
emitEvent('onBeginReconcilerTimer', debugID, timerType);
|
|
185
|
+
},
|
|
186
|
+
onEndReconcilerTimer: function (debugID, timerType) {
|
|
187
|
+
checkDebugID(debugID);
|
|
188
|
+
emitEvent('onEndReconcilerTimer', debugID, timerType);
|
|
189
|
+
},
|
|
47
190
|
onBeginProcessingChildContext: function () {
|
|
48
191
|
emitEvent('onBeginProcessingChildContext');
|
|
49
192
|
},
|
|
50
193
|
onEndProcessingChildContext: function () {
|
|
51
194
|
emitEvent('onEndProcessingChildContext');
|
|
52
195
|
},
|
|
196
|
+
onNativeOperation: function (debugID, type, payload) {
|
|
197
|
+
checkDebugID(debugID);
|
|
198
|
+
emitEvent('onNativeOperation', debugID, type, payload);
|
|
199
|
+
},
|
|
53
200
|
onSetState: function () {
|
|
54
201
|
emitEvent('onSetState');
|
|
55
202
|
},
|
|
56
|
-
|
|
57
|
-
|
|
203
|
+
onSetDisplayName: function (debugID, displayName) {
|
|
204
|
+
checkDebugID(debugID);
|
|
205
|
+
emitEvent('onSetDisplayName', debugID, displayName);
|
|
206
|
+
},
|
|
207
|
+
onSetChildren: function (debugID, childDebugIDs) {
|
|
208
|
+
checkDebugID(debugID);
|
|
209
|
+
emitEvent('onSetChildren', debugID, childDebugIDs);
|
|
58
210
|
},
|
|
59
|
-
|
|
60
|
-
|
|
211
|
+
onSetOwner: function (debugID, ownerDebugID) {
|
|
212
|
+
checkDebugID(debugID);
|
|
213
|
+
emitEvent('onSetOwner', debugID, ownerDebugID);
|
|
61
214
|
},
|
|
62
|
-
|
|
63
|
-
|
|
215
|
+
onSetText: function (debugID, text) {
|
|
216
|
+
checkDebugID(debugID);
|
|
217
|
+
emitEvent('onSetText', debugID, text);
|
|
64
218
|
},
|
|
65
|
-
|
|
66
|
-
|
|
219
|
+
onMountRootComponent: function (debugID) {
|
|
220
|
+
checkDebugID(debugID);
|
|
221
|
+
emitEvent('onMountRootComponent', debugID);
|
|
222
|
+
},
|
|
223
|
+
onMountComponent: function (debugID) {
|
|
224
|
+
checkDebugID(debugID);
|
|
225
|
+
emitEvent('onMountComponent', debugID);
|
|
226
|
+
},
|
|
227
|
+
onUpdateComponent: function (debugID) {
|
|
228
|
+
checkDebugID(debugID);
|
|
229
|
+
emitEvent('onUpdateComponent', debugID);
|
|
230
|
+
},
|
|
231
|
+
onUnmountComponent: function (debugID) {
|
|
232
|
+
checkDebugID(debugID);
|
|
233
|
+
emitEvent('onUnmountComponent', debugID);
|
|
67
234
|
}
|
|
68
235
|
};
|
|
69
236
|
|
|
70
|
-
|
|
237
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
238
|
+
var ReactInvalidSetStateWarningDevTool = require('./ReactInvalidSetStateWarningDevTool');
|
|
239
|
+
var ReactNativeOperationHistoryDevtool = require('./ReactNativeOperationHistoryDevtool');
|
|
240
|
+
var ReactComponentTreeDevtool = require('./ReactComponentTreeDevtool');
|
|
241
|
+
ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);
|
|
242
|
+
ReactDebugTool.addDevtool(ReactComponentTreeDevtool);
|
|
243
|
+
ReactDebugTool.addDevtool(ReactNativeOperationHistoryDevtool);
|
|
244
|
+
var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
|
|
245
|
+
if (/[?&]react_perf\b/.test(url)) {
|
|
246
|
+
ReactDebugTool.beginProfiling();
|
|
247
|
+
}
|
|
248
|
+
}
|
|
71
249
|
|
|
72
250
|
module.exports = ReactDebugTool;
|
|
@@ -15,7 +15,6 @@ var BeforeInputEventPlugin = require('./BeforeInputEventPlugin');
|
|
|
15
15
|
var ChangeEventPlugin = require('./ChangeEventPlugin');
|
|
16
16
|
var DefaultEventPluginOrder = require('./DefaultEventPluginOrder');
|
|
17
17
|
var EnterLeaveEventPlugin = require('./EnterLeaveEventPlugin');
|
|
18
|
-
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
|
|
19
18
|
var HTMLDOMPropertyConfig = require('./HTMLDOMPropertyConfig');
|
|
20
19
|
var ReactComponentBrowserEnvironment = require('./ReactComponentBrowserEnvironment');
|
|
21
20
|
var ReactDOMComponent = require('./ReactDOMComponent');
|
|
@@ -78,14 +77,6 @@ function inject() {
|
|
|
78
77
|
ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
|
|
79
78
|
|
|
80
79
|
ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
|
|
81
|
-
|
|
82
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
83
|
-
var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
|
|
84
|
-
if (/[?&]react_perf\b/.test(url)) {
|
|
85
|
-
var ReactDefaultPerf = require('./ReactDefaultPerf');
|
|
86
|
-
ReactDefaultPerf.start();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
80
|
}
|
|
90
81
|
|
|
91
82
|
module.exports = {
|
package/lib/ReactElement.js
CHANGED
|
@@ -113,6 +113,10 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
|
113
113
|
return element;
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Create and return a new ReactElement of the given type.
|
|
118
|
+
* See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
|
|
119
|
+
*/
|
|
116
120
|
ReactElement.createElement = function (type, config, children) {
|
|
117
121
|
var propName;
|
|
118
122
|
|
|
@@ -126,6 +130,11 @@ ReactElement.createElement = function (type, config, children) {
|
|
|
126
130
|
|
|
127
131
|
if (config != null) {
|
|
128
132
|
if (process.env.NODE_ENV !== 'production') {
|
|
133
|
+
process.env.NODE_ENV !== 'production' ? warning(
|
|
134
|
+
/* eslint-disable no-proto */
|
|
135
|
+
config.__proto__ == null || config.__proto__ === Object.prototype,
|
|
136
|
+
/* eslint-enable no-proto */
|
|
137
|
+
'React.createElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
|
|
129
138
|
ref = !config.hasOwnProperty('ref') || Object.getOwnPropertyDescriptor(config, 'ref').get ? null : config.ref;
|
|
130
139
|
key = !config.hasOwnProperty('key') || Object.getOwnPropertyDescriptor(config, 'key').get ? null : '' + config.key;
|
|
131
140
|
} else {
|
|
@@ -197,6 +206,10 @@ ReactElement.createElement = function (type, config, children) {
|
|
|
197
206
|
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
198
207
|
};
|
|
199
208
|
|
|
209
|
+
/**
|
|
210
|
+
* Return a function that produces ReactElements of a given type.
|
|
211
|
+
* See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
|
|
212
|
+
*/
|
|
200
213
|
ReactElement.createFactory = function (type) {
|
|
201
214
|
var factory = ReactElement.createElement.bind(null, type);
|
|
202
215
|
// Expose the type on the factory and the prototype so that it can be
|
|
@@ -214,6 +227,10 @@ ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
|
|
|
214
227
|
return newElement;
|
|
215
228
|
};
|
|
216
229
|
|
|
230
|
+
/**
|
|
231
|
+
* Clone and return a new ReactElement using element as the starting point.
|
|
232
|
+
* See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
|
|
233
|
+
*/
|
|
217
234
|
ReactElement.cloneElement = function (element, config, children) {
|
|
218
235
|
var propName;
|
|
219
236
|
|
|
@@ -234,6 +251,13 @@ ReactElement.cloneElement = function (element, config, children) {
|
|
|
234
251
|
var owner = element._owner;
|
|
235
252
|
|
|
236
253
|
if (config != null) {
|
|
254
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
255
|
+
process.env.NODE_ENV !== 'production' ? warning(
|
|
256
|
+
/* eslint-disable no-proto */
|
|
257
|
+
config.__proto__ == null || config.__proto__ === Object.prototype,
|
|
258
|
+
/* eslint-enable no-proto */
|
|
259
|
+
'React.cloneElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
|
|
260
|
+
}
|
|
237
261
|
if (config.ref !== undefined) {
|
|
238
262
|
// Silently steal the ref from the parent.
|
|
239
263
|
ref = config.ref;
|
|
@@ -276,6 +300,8 @@ ReactElement.cloneElement = function (element, config, children) {
|
|
|
276
300
|
};
|
|
277
301
|
|
|
278
302
|
/**
|
|
303
|
+
* Verifies the object is a ReactElement.
|
|
304
|
+
* See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
|
|
279
305
|
* @param {?object} object
|
|
280
306
|
* @return {boolean} True if `object` is a valid component.
|
|
281
307
|
* @final
|
package/lib/ReactFragment.js
CHANGED
|
@@ -31,8 +31,11 @@ var numericPropertyRegex = /^\d+$/;
|
|
|
31
31
|
var warnedAboutNumeric = false;
|
|
32
32
|
|
|
33
33
|
var ReactFragment = {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Wrap a keyed object in an opaque proxy that warns you if you access any
|
|
36
|
+
* of its properties.
|
|
37
|
+
* See https://facebook.github.io/react/docs/create-fragment.html
|
|
38
|
+
*/
|
|
36
39
|
create: function (object) {
|
|
37
40
|
if (typeof object !== 'object' || !object || Array.isArray(object)) {
|
|
38
41
|
process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment only accepts a single object. Got: %s', object) : void 0;
|
package/lib/ReactInjection.js
CHANGED
|
@@ -19,7 +19,6 @@ var ReactClass = require('./ReactClass');
|
|
|
19
19
|
var ReactEmptyComponent = require('./ReactEmptyComponent');
|
|
20
20
|
var ReactBrowserEventEmitter = require('./ReactBrowserEventEmitter');
|
|
21
21
|
var ReactNativeComponent = require('./ReactNativeComponent');
|
|
22
|
-
var ReactPerf = require('./ReactPerf');
|
|
23
22
|
var ReactUpdates = require('./ReactUpdates');
|
|
24
23
|
|
|
25
24
|
var ReactInjection = {
|
|
@@ -31,7 +30,6 @@ var ReactInjection = {
|
|
|
31
30
|
EventPluginUtils: EventPluginUtils.injection,
|
|
32
31
|
EventEmitter: ReactBrowserEventEmitter.injection,
|
|
33
32
|
NativeComponent: ReactNativeComponent.injection,
|
|
34
|
-
Perf: ReactPerf.injection,
|
|
35
33
|
Updates: ReactUpdates.injection
|
|
36
34
|
};
|
|
37
35
|
|
package/lib/ReactLink.js
CHANGED
|
@@ -37,6 +37,9 @@
|
|
|
37
37
|
var React = require('./React');
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
+
* Deprecated: An an easy way to express two-way binding with React.
|
|
41
|
+
* See https://facebook.github.io/react/docs/two-way-binding-helpers.html
|
|
42
|
+
*
|
|
40
43
|
* @param {*} value current value of the link
|
|
41
44
|
* @param {function} requestChange callback to request a change
|
|
42
45
|
*/
|