react 15.0.0-rc.1 → 15.0.2-alpha.1
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 +1446 -1195
- package/dist/react-with-addons.min.js +6 -6
- package/dist/react.js +1330 -1109
- package/dist/react.min.js +6 -6
- package/lib/CSSProperty.js +6 -0
- package/lib/CSSPropertyOperations.js +31 -15
- package/lib/CallbackQueue.js +3 -2
- package/lib/DOMChildrenOperations.js +0 -3
- package/lib/DOMLazyTree.js +11 -2
- package/lib/DOMPropertyOperations.js +0 -46
- package/lib/EventPluginUtils.js +2 -2
- package/lib/FallbackCompositionState.js +3 -2
- package/lib/HTMLDOMPropertyConfig.js +111 -111
- package/lib/IOSDefaultEventPluginOrder.js +16 -0
- package/lib/IOSNativeBridgeEventPlugin.js +57 -0
- package/lib/NativeMethodsMixin.js +165 -0
- package/lib/OrderedMap.js +3 -2
- package/lib/PanResponder.js +362 -0
- package/lib/React.js +68 -9
- package/lib/ReactBrowserEventEmitter.js +3 -2
- package/lib/ReactCSSTransitionGroup.js +3 -3
- package/lib/ReactClass.js +7 -6
- package/lib/ReactComponent.js +2 -2
- package/lib/ReactCompositeComponent.js +5 -4
- package/lib/ReactDOMComponent.js +14 -15
- package/lib/ReactDOMDebugTool.js +0 -8
- package/lib/ReactDOMEmptyComponent.js +3 -3
- package/lib/ReactDOMInput.js +5 -4
- package/lib/ReactDOMOption.js +13 -2
- package/lib/ReactDOMSelect.js +3 -2
- package/lib/ReactDOMTextComponent.js +3 -2
- package/lib/ReactDOMTextarea.js +3 -2
- package/lib/ReactDebugInstanceMap.js +102 -0
- package/lib/ReactDefaultBatchingStrategy.js +3 -2
- package/lib/ReactDefaultPerf.js +46 -7
- package/lib/ReactDefaultPerfAnalysis.js +7 -7
- package/lib/ReactElement.js +5 -4
- package/lib/ReactEventListener.js +3 -2
- package/lib/ReactMarkupChecksum.js +7 -2
- package/lib/ReactMount.js +1 -0
- package/lib/ReactNative.js +71 -0
- package/lib/ReactNativeAttributePayload.js +397 -0
- package/lib/ReactNativeBaseComponent.js +196 -0
- package/lib/ReactNativeComponent.js +3 -2
- package/lib/ReactNativeComponentEnvironment.js +38 -0
- package/lib/ReactNativeComponentTree.js +66 -0
- package/lib/ReactNativeContainerInfo.js +21 -0
- package/lib/ReactNativeDOMIDOperations.js +83 -0
- package/lib/ReactNativeDefaultInjection.js +99 -0
- package/lib/ReactNativeEventEmitter.js +180 -0
- package/lib/ReactNativeGlobalInteractionHandler.js +33 -0
- package/lib/ReactNativeGlobalResponderHandler.js +25 -0
- package/lib/ReactNativeMount.js +190 -0
- package/lib/ReactNativePropRegistry.js +52 -0
- package/lib/ReactNativeReconcileTransaction.js +100 -0
- package/lib/ReactNativeTagHandles.js +54 -0
- package/lib/ReactNativeTextComponent.js +70 -0
- package/lib/ReactNativeTreeTraversal.js +127 -0
- package/lib/ReactOwner.js +4 -3
- package/lib/ReactPropTransferer.js +4 -3
- package/lib/ReactReconcileTransaction.js +3 -3
- package/lib/ReactServerRenderingTransaction.js +3 -3
- package/lib/ReactSimpleEmptyComponent.js +3 -3
- package/lib/ReactTestUtils.js +14 -4
- package/lib/ReactTransitionGroup.js +3 -2
- package/lib/ReactUMDEntry.js +26 -0
- package/lib/ReactUpdateQueue.js +20 -3
- package/lib/ReactUpdates.js +3 -2
- package/lib/ReactVersion.js +1 -1
- package/lib/ReactWithAddons.js +0 -7
- package/lib/ReactWithAddonsUMDEntry.js +26 -0
- package/lib/ResponderSyntheticEvent.js +1 -1
- package/lib/SVGDOMPropertyConfig.js +266 -52
- package/lib/SyntheticEvent.js +5 -4
- package/lib/TouchHistoryMath.js +99 -0
- package/lib/createReactNativeComponentClass.js +42 -0
- package/lib/deprecated.js +3 -2
- package/lib/findNodeHandle.js +89 -0
- package/lib/instantiateReactComponent.js +3 -2
- package/lib/reactComponentExpect.js +3 -2
- package/lib/setInnerHTML.js +1 -0
- package/lib/update.js +4 -3
- package/lib/validateDOMNesting.js +3 -2
- package/package.json +5 -4
- package/addons.js +0 -15
- package/lib/Object.assign.js +0 -47
- package/lib/React.native.js +0 -5
- package/lib/ReactDOM.native.js +0 -12
- package/lib/ReactDOMSVGDeprecatedAttributeDevtool.js +0 -61
- package/lib/ReactIsomorphic.js +0 -74
package/lib/ReactDOMSelect.js
CHANGED
|
@@ -11,11 +11,12 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var LinkedValueUtils = require('./LinkedValueUtils');
|
|
15
17
|
var ReactDOMComponentTree = require('./ReactDOMComponentTree');
|
|
16
18
|
var ReactUpdates = require('./ReactUpdates');
|
|
17
19
|
|
|
18
|
-
var assign = require('./Object.assign');
|
|
19
20
|
var warning = require('fbjs/lib/warning');
|
|
20
21
|
|
|
21
22
|
var didWarnValueLink = false;
|
|
@@ -135,7 +136,7 @@ function updateOptions(inst, multiple, propValue) {
|
|
|
135
136
|
*/
|
|
136
137
|
var ReactDOMSelect = {
|
|
137
138
|
getNativeProps: function (inst, props) {
|
|
138
|
-
return
|
|
139
|
+
return _assign({}, props, {
|
|
139
140
|
onChange: inst._wrapperState.onChange,
|
|
140
141
|
value: undefined
|
|
141
142
|
});
|
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var DOMChildrenOperations = require('./DOMChildrenOperations');
|
|
15
17
|
var DOMLazyTree = require('./DOMLazyTree');
|
|
16
18
|
var ReactDOMComponentTree = require('./ReactDOMComponentTree');
|
|
17
19
|
var ReactPerf = require('./ReactPerf');
|
|
18
20
|
|
|
19
|
-
var assign = require('./Object.assign');
|
|
20
21
|
var escapeTextContentForBrowser = require('./escapeTextContentForBrowser');
|
|
21
22
|
var invariant = require('fbjs/lib/invariant');
|
|
22
23
|
var validateDOMNesting = require('./validateDOMNesting');
|
|
@@ -51,7 +52,7 @@ var ReactDOMTextComponent = function (text) {
|
|
|
51
52
|
this._commentNodes = null;
|
|
52
53
|
};
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
_assign(ReactDOMTextComponent.prototype, {
|
|
55
56
|
|
|
56
57
|
/**
|
|
57
58
|
* Creates the markup for this text node. This node is not intended to have
|
package/lib/ReactDOMTextarea.js
CHANGED
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var DOMPropertyOperations = require('./DOMPropertyOperations');
|
|
15
17
|
var LinkedValueUtils = require('./LinkedValueUtils');
|
|
16
18
|
var ReactDOMComponentTree = require('./ReactDOMComponentTree');
|
|
17
19
|
var ReactUpdates = require('./ReactUpdates');
|
|
18
20
|
|
|
19
|
-
var assign = require('./Object.assign');
|
|
20
21
|
var invariant = require('fbjs/lib/invariant');
|
|
21
22
|
var warning = require('fbjs/lib/warning');
|
|
22
23
|
|
|
@@ -60,7 +61,7 @@ var ReactDOMTextarea = {
|
|
|
60
61
|
|
|
61
62
|
// Always set children to the same thing. In IE9, the selection range will
|
|
62
63
|
// get reset if `textContent` is mutated.
|
|
63
|
-
var nativeProps =
|
|
64
|
+
var nativeProps = _assign({}, props, {
|
|
64
65
|
defaultValue: undefined,
|
|
65
66
|
value: undefined,
|
|
66
67
|
children: inst._wrapperState.initialValue,
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
* @providesModule ReactDebugInstanceMap
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
var warning = require('fbjs/lib/warning');
|
|
15
|
+
|
|
16
|
+
function checkValidInstance(internalInstance) {
|
|
17
|
+
if (!internalInstance) {
|
|
18
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'There is an internal error in the React developer tools integration. ' + 'Instead of an internal instance, received %s. ' + 'Please report this as a bug in React.', internalInstance) : void 0;
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
var isValid = typeof internalInstance.mountComponent === 'function';
|
|
22
|
+
process.env.NODE_ENV !== 'production' ? warning(isValid, 'There is an internal error in the React developer tools integration. ' + 'Instead of an internal instance, received an object with the following ' + 'keys: %s. Please report this as a bug in React.', Object.keys(internalInstance).join(', ')) : void 0;
|
|
23
|
+
return isValid;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var idCounter = 1;
|
|
27
|
+
var instancesByIDs = {};
|
|
28
|
+
var instancesToIDs;
|
|
29
|
+
|
|
30
|
+
function getIDForInstance(internalInstance) {
|
|
31
|
+
if (!instancesToIDs) {
|
|
32
|
+
instancesToIDs = new WeakMap();
|
|
33
|
+
}
|
|
34
|
+
if (instancesToIDs.has(internalInstance)) {
|
|
35
|
+
return instancesToIDs.get(internalInstance);
|
|
36
|
+
} else {
|
|
37
|
+
var instanceID = (idCounter++).toString();
|
|
38
|
+
instancesToIDs.set(internalInstance, instanceID);
|
|
39
|
+
return instanceID;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function getInstanceByID(instanceID) {
|
|
44
|
+
return instancesByIDs[instanceID] || null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function isRegisteredInstance(internalInstance) {
|
|
48
|
+
var instanceID = getIDForInstance(internalInstance);
|
|
49
|
+
if (instanceID) {
|
|
50
|
+
return instancesByIDs.hasOwnProperty(instanceID);
|
|
51
|
+
} else {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function registerInstance(internalInstance) {
|
|
57
|
+
var instanceID = getIDForInstance(internalInstance);
|
|
58
|
+
if (instanceID) {
|
|
59
|
+
instancesByIDs[instanceID] = internalInstance;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function unregisterInstance(internalInstance) {
|
|
64
|
+
var instanceID = getIDForInstance(internalInstance);
|
|
65
|
+
if (instanceID) {
|
|
66
|
+
delete instancesByIDs[instanceID];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
var ReactDebugInstanceMap = {
|
|
71
|
+
getIDForInstance: function (internalInstance) {
|
|
72
|
+
if (!checkValidInstance(internalInstance)) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
return getIDForInstance(internalInstance);
|
|
76
|
+
},
|
|
77
|
+
getInstanceByID: function (instanceID) {
|
|
78
|
+
return getInstanceByID(instanceID);
|
|
79
|
+
},
|
|
80
|
+
isRegisteredInstance: function (internalInstance) {
|
|
81
|
+
if (!checkValidInstance(internalInstance)) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return isRegisteredInstance(internalInstance);
|
|
85
|
+
},
|
|
86
|
+
registerInstance: function (internalInstance) {
|
|
87
|
+
if (!checkValidInstance(internalInstance)) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
process.env.NODE_ENV !== 'production' ? warning(!isRegisteredInstance(internalInstance), 'There is an internal error in the React developer tools integration. ' + 'A registered instance should not be registered again. ' + 'Please report this as a bug in React.') : void 0;
|
|
91
|
+
registerInstance(internalInstance);
|
|
92
|
+
},
|
|
93
|
+
unregisterInstance: function (internalInstance) {
|
|
94
|
+
if (!checkValidInstance(internalInstance)) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
process.env.NODE_ENV !== 'production' ? warning(isRegisteredInstance(internalInstance), 'There is an internal error in the React developer tools integration. ' + 'An unregistered instance should not be unregistered again. ' + 'Please report this as a bug in React.') : void 0;
|
|
98
|
+
unregisterInstance(internalInstance);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
module.exports = ReactDebugInstanceMap;
|
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var ReactUpdates = require('./ReactUpdates');
|
|
15
17
|
var Transaction = require('./Transaction');
|
|
16
18
|
|
|
17
|
-
var assign = require('./Object.assign');
|
|
18
19
|
var emptyFunction = require('fbjs/lib/emptyFunction');
|
|
19
20
|
|
|
20
21
|
var RESET_BATCHED_UPDATES = {
|
|
@@ -35,7 +36,7 @@ function ReactDefaultBatchingStrategyTransaction() {
|
|
|
35
36
|
this.reinitializeTransaction();
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
_assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {
|
|
39
40
|
getTransactionWrappers: function () {
|
|
40
41
|
return TRANSACTION_WRAPPERS;
|
|
41
42
|
}
|
package/lib/ReactDefaultPerf.js
CHANGED
|
@@ -18,6 +18,7 @@ var ReactMount = require('./ReactMount');
|
|
|
18
18
|
var ReactPerf = require('./ReactPerf');
|
|
19
19
|
|
|
20
20
|
var performanceNow = require('fbjs/lib/performanceNow');
|
|
21
|
+
var warning = require('fbjs/lib/warning');
|
|
21
22
|
|
|
22
23
|
function roundFloat(val) {
|
|
23
24
|
return Math.floor(val * 100) / 100;
|
|
@@ -51,6 +52,31 @@ function getID(inst) {
|
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
function stripComplexValues(key, value) {
|
|
56
|
+
if (typeof value !== 'object' || Array.isArray(value) || value == null) {
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
var prototype = Object.getPrototypeOf(value);
|
|
60
|
+
if (!prototype || prototype === Object.prototype) {
|
|
61
|
+
return value;
|
|
62
|
+
}
|
|
63
|
+
return '<not serializable>';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// This implementation of ReactPerf is going away some time mid 15.x.
|
|
67
|
+
// While we plan to keep most of the API, the actual format of measurements
|
|
68
|
+
// will change dramatically. To signal this, we wrap them into an opaque-ish
|
|
69
|
+
// object to discourage reaching into it until the API stabilizes.
|
|
70
|
+
function wrapLegacyMeasurements(measurements) {
|
|
71
|
+
return { __unstable_this_format_will_change: measurements };
|
|
72
|
+
}
|
|
73
|
+
function unwrapLegacyMeasurements(measurements) {
|
|
74
|
+
return measurements && measurements.__unstable_this_format_will_change || measurements;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var warnedAboutPrintDOM = false;
|
|
78
|
+
var warnedAboutGetMeasurementsSummaryMap = false;
|
|
79
|
+
|
|
54
80
|
var ReactDefaultPerf = {
|
|
55
81
|
_allMeasurements: [], // last item in the list is the current one
|
|
56
82
|
_mountStack: [0],
|
|
@@ -71,11 +97,11 @@ var ReactDefaultPerf = {
|
|
|
71
97
|
},
|
|
72
98
|
|
|
73
99
|
getLastMeasurements: function () {
|
|
74
|
-
return ReactDefaultPerf._allMeasurements;
|
|
100
|
+
return wrapLegacyMeasurements(ReactDefaultPerf._allMeasurements);
|
|
75
101
|
},
|
|
76
102
|
|
|
77
103
|
printExclusive: function (measurements) {
|
|
78
|
-
measurements = measurements || ReactDefaultPerf._allMeasurements;
|
|
104
|
+
measurements = unwrapLegacyMeasurements(measurements || ReactDefaultPerf._allMeasurements);
|
|
79
105
|
var summary = ReactDefaultPerfAnalysis.getExclusiveSummary(measurements);
|
|
80
106
|
console.table(summary.map(function (item) {
|
|
81
107
|
return {
|
|
@@ -93,7 +119,7 @@ var ReactDefaultPerf = {
|
|
|
93
119
|
},
|
|
94
120
|
|
|
95
121
|
printInclusive: function (measurements) {
|
|
96
|
-
measurements = measurements || ReactDefaultPerf._allMeasurements;
|
|
122
|
+
measurements = unwrapLegacyMeasurements(measurements || ReactDefaultPerf._allMeasurements);
|
|
97
123
|
var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements);
|
|
98
124
|
console.table(summary.map(function (item) {
|
|
99
125
|
return {
|
|
@@ -106,6 +132,13 @@ var ReactDefaultPerf = {
|
|
|
106
132
|
},
|
|
107
133
|
|
|
108
134
|
getMeasurementsSummaryMap: function (measurements) {
|
|
135
|
+
process.env.NODE_ENV !== 'production' ? warning(warnedAboutGetMeasurementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' + '`ReactPerf.getWasted(...)` instead.') : void 0;
|
|
136
|
+
warnedAboutGetMeasurementsSummaryMap = true;
|
|
137
|
+
return ReactDefaultPerf.getWasted(measurements);
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
getWasted: function (measurements) {
|
|
141
|
+
measurements = unwrapLegacyMeasurements(measurements);
|
|
109
142
|
var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements, true);
|
|
110
143
|
return summary.map(function (item) {
|
|
111
144
|
return {
|
|
@@ -117,19 +150,25 @@ var ReactDefaultPerf = {
|
|
|
117
150
|
},
|
|
118
151
|
|
|
119
152
|
printWasted: function (measurements) {
|
|
120
|
-
measurements = measurements || ReactDefaultPerf._allMeasurements;
|
|
121
|
-
console.table(ReactDefaultPerf.
|
|
153
|
+
measurements = unwrapLegacyMeasurements(measurements || ReactDefaultPerf._allMeasurements);
|
|
154
|
+
console.table(ReactDefaultPerf.getWasted(measurements));
|
|
122
155
|
console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
|
|
123
156
|
},
|
|
124
157
|
|
|
125
158
|
printDOM: function (measurements) {
|
|
126
|
-
|
|
159
|
+
process.env.NODE_ENV !== 'production' ? warning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.') : void 0;
|
|
160
|
+
warnedAboutPrintDOM = true;
|
|
161
|
+
return ReactDefaultPerf.printOperations(measurements);
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
printOperations: function (measurements) {
|
|
165
|
+
measurements = unwrapLegacyMeasurements(measurements || ReactDefaultPerf._allMeasurements);
|
|
127
166
|
var summary = ReactDefaultPerfAnalysis.getDOMSummary(measurements);
|
|
128
167
|
console.table(summary.map(function (item) {
|
|
129
168
|
var result = {};
|
|
130
169
|
result[DOMProperty.ID_ATTRIBUTE_NAME] = item.id;
|
|
131
170
|
result.type = item.type;
|
|
132
|
-
result.args = JSON.stringify(item.args);
|
|
171
|
+
result.args = JSON.stringify(item.args, stripComplexValues);
|
|
133
172
|
return result;
|
|
134
173
|
}));
|
|
135
174
|
console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
|
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var assign = require('./Object.assign');
|
|
15
|
-
|
|
16
14
|
// Don't try to save users less than 1.2ms (a number I made up)
|
|
15
|
+
|
|
16
|
+
var _assign = require('object-assign');
|
|
17
|
+
|
|
17
18
|
var DONT_CARE_THRESHOLD = 1.2;
|
|
18
19
|
var DOM_OPERATION_TYPES = {
|
|
19
20
|
'_mountImageIntoNode': 'set innerHTML',
|
|
@@ -27,8 +28,7 @@ var DOM_OPERATION_TYPES = {
|
|
|
27
28
|
'deleteValueForProperty': 'remove attribute',
|
|
28
29
|
'setValueForStyles': 'update styles',
|
|
29
30
|
'replaceNodeWithMarkup': 'replace',
|
|
30
|
-
'replaceDelimitedText': 'replace'
|
|
31
|
-
'updateTextContent': 'set textContent'
|
|
31
|
+
'replaceDelimitedText': 'replace'
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
function getTotalTime(measurements) {
|
|
@@ -66,7 +66,7 @@ function getExclusiveSummary(measurements) {
|
|
|
66
66
|
|
|
67
67
|
for (var i = 0; i < measurements.length; i++) {
|
|
68
68
|
var measurement = measurements[i];
|
|
69
|
-
var allIDs =
|
|
69
|
+
var allIDs = _assign({}, measurement.exclusive, measurement.inclusive);
|
|
70
70
|
|
|
71
71
|
for (var id in allIDs) {
|
|
72
72
|
displayName = measurement.displayNames[id].current;
|
|
@@ -114,7 +114,7 @@ function getInclusiveSummary(measurements, onlyClean) {
|
|
|
114
114
|
|
|
115
115
|
for (var i = 0; i < measurements.length; i++) {
|
|
116
116
|
var measurement = measurements[i];
|
|
117
|
-
var allIDs =
|
|
117
|
+
var allIDs = _assign({}, measurement.exclusive, measurement.inclusive);
|
|
118
118
|
var cleanComponents;
|
|
119
119
|
|
|
120
120
|
if (onlyClean) {
|
|
@@ -180,7 +180,7 @@ function getUnchangedComponents(measurement) {
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
});
|
|
183
|
-
var allIDs =
|
|
183
|
+
var allIDs = _assign({}, measurement.exclusive, measurement.inclusive);
|
|
184
184
|
|
|
185
185
|
for (var id in allIDs) {
|
|
186
186
|
var isDirty = false;
|
package/lib/ReactElement.js
CHANGED
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var ReactCurrentOwner = require('./ReactCurrentOwner');
|
|
15
17
|
|
|
16
|
-
var assign = require('./Object.assign');
|
|
17
18
|
var warning = require('fbjs/lib/warning');
|
|
18
19
|
var canDefineProperty = require('./canDefineProperty');
|
|
19
20
|
|
|
@@ -172,7 +173,7 @@ ReactElement.createElement = function (type, config, children) {
|
|
|
172
173
|
get: function () {
|
|
173
174
|
if (!specialPropKeyWarningShown) {
|
|
174
175
|
specialPropKeyWarningShown = true;
|
|
175
|
-
process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', 'displayName' in type ? type.displayName : 'Element') : void 0;
|
|
176
|
+
process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element') : void 0;
|
|
176
177
|
}
|
|
177
178
|
return undefined;
|
|
178
179
|
},
|
|
@@ -184,7 +185,7 @@ ReactElement.createElement = function (type, config, children) {
|
|
|
184
185
|
get: function () {
|
|
185
186
|
if (!specialPropRefWarningShown) {
|
|
186
187
|
specialPropRefWarningShown = true;
|
|
187
|
-
process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', 'displayName' in type ? type.displayName : 'Element') : void 0;
|
|
188
|
+
process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element') : void 0;
|
|
188
189
|
}
|
|
189
190
|
return undefined;
|
|
190
191
|
},
|
|
@@ -217,7 +218,7 @@ ReactElement.cloneElement = function (element, config, children) {
|
|
|
217
218
|
var propName;
|
|
218
219
|
|
|
219
220
|
// Original props are copied
|
|
220
|
-
var props =
|
|
221
|
+
var props = _assign({}, element.props);
|
|
221
222
|
|
|
222
223
|
// Reserved names are extracted
|
|
223
224
|
var key = element.key;
|
|
@@ -11,13 +11,14 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var EventListener = require('fbjs/lib/EventListener');
|
|
15
17
|
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
|
|
16
18
|
var PooledClass = require('./PooledClass');
|
|
17
19
|
var ReactDOMComponentTree = require('./ReactDOMComponentTree');
|
|
18
20
|
var ReactUpdates = require('./ReactUpdates');
|
|
19
21
|
|
|
20
|
-
var assign = require('./Object.assign');
|
|
21
22
|
var getEventTarget = require('./getEventTarget');
|
|
22
23
|
var getUnboundedScrollPosition = require('fbjs/lib/getUnboundedScrollPosition');
|
|
23
24
|
|
|
@@ -44,7 +45,7 @@ function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
|
|
|
44
45
|
this.nativeEvent = nativeEvent;
|
|
45
46
|
this.ancestors = [];
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
_assign(TopLevelCallbackBookKeeping.prototype, {
|
|
48
49
|
destructor: function () {
|
|
49
50
|
this.topLevelType = null;
|
|
50
51
|
this.nativeEvent = null;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
var adler32 = require('./adler32');
|
|
15
15
|
|
|
16
16
|
var TAG_END = /\/?>/;
|
|
17
|
+
var COMMENT_START = /^<\!\-\-/;
|
|
17
18
|
|
|
18
19
|
var ReactMarkupChecksum = {
|
|
19
20
|
CHECKSUM_ATTR_NAME: 'data-react-checksum',
|
|
@@ -25,8 +26,12 @@ var ReactMarkupChecksum = {
|
|
|
25
26
|
addChecksumToMarkup: function (markup) {
|
|
26
27
|
var checksum = adler32(markup);
|
|
27
28
|
|
|
28
|
-
// Add checksum (handle both parent tags and self-closing tags)
|
|
29
|
-
|
|
29
|
+
// Add checksum (handle both parent tags, comments and self-closing tags)
|
|
30
|
+
if (COMMENT_START.test(markup)) {
|
|
31
|
+
return markup;
|
|
32
|
+
} else {
|
|
33
|
+
return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
|
|
34
|
+
}
|
|
30
35
|
},
|
|
31
36
|
|
|
32
37
|
/**
|
package/lib/ReactMount.js
CHANGED
|
@@ -305,6 +305,7 @@ var ReactMount = {
|
|
|
305
305
|
},
|
|
306
306
|
|
|
307
307
|
_renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
|
|
308
|
+
ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
|
|
308
309
|
!ReactElement.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' :
|
|
309
310
|
// Check if it quacks like an element
|
|
310
311
|
nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(false) : void 0;
|