react 15.3.1-rc.2 → 15.4.0-rc.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 +3961 -21387
- package/dist/react-with-addons.min.js +3 -6
- package/dist/react.js +2701 -19464
- package/dist/react.min.js +2 -6
- package/lib/LinkedStateMixin.js +1 -2
- package/lib/PooledClass.js +3 -0
- package/lib/ReactAddonsDOMDependencies.js +36 -0
- package/lib/ReactAddonsDOMDependenciesUMDShim.js +32 -0
- package/lib/ReactCSSTransitionGroup.js +60 -42
- package/lib/ReactCSSTransitionGroupChild.js +2 -2
- package/lib/ReactClass.js +38 -53
- package/lib/ReactComponentTreeHook.js +84 -100
- package/lib/{DOMNamespaces.js → ReactComponentTreeHookUMDShim.js} +5 -7
- package/lib/ReactCurrentOwner.js +1 -1
- package/lib/{renderSubtreeIntoContainer.js → ReactCurrentOwnerUMDShim.js} +6 -4
- package/lib/ReactElement.js +6 -29
- package/lib/ReactElementSymbol.js +20 -0
- package/lib/{ReactDOMComponentFlags.js → ReactElementType.js} +4 -9
- package/lib/ReactElementValidator.js +1 -2
- package/lib/ReactPropTypeLocationNames.js +1 -0
- package/lib/ReactPropTypeLocations.js +2 -11
- package/lib/ReactPropTypes.js +30 -13
- package/lib/ReactPropTypesSecret.js +1 -0
- package/lib/ReactTransitionEvents.js +1 -1
- package/lib/ReactTransitionGroup.js +145 -141
- package/lib/ReactUMDEntry.js +11 -5
- package/lib/{ReactDOMFeatureFlags.js → ReactUMDShim.js} +4 -6
- package/lib/ReactVersion.js +1 -1
- package/lib/ReactWithAddons.js +15 -2
- package/lib/ReactWithAddonsUMDEntry.js +11 -5
- package/lib/canDefineProperty.js +2 -0
- package/lib/onlyChild.js +1 -1
- package/lib/traverseAllChildren.js +11 -2
- package/lib/update.js +6 -7
- package/package.json +2 -2
- package/lib/AutoFocusUtils.js +0 -24
- package/lib/BeforeInputEventPlugin.js +0 -388
- package/lib/CSSProperty.js +0 -148
- package/lib/CSSPropertyOperations.js +0 -205
- package/lib/CallbackQueue.js +0 -106
- package/lib/ChangeEventPlugin.js +0 -325
- package/lib/DOMChildrenOperations.js +0 -194
- package/lib/DOMLazyTree.js +0 -118
- package/lib/DOMProperty.js +0 -206
- package/lib/DOMPropertyOperations.js +0 -221
- package/lib/Danger.js +0 -48
- package/lib/DefaultEventPluginOrder.js +0 -27
- package/lib/DisabledInputUtils.js +0 -50
- package/lib/EnterLeaveEventPlugin.js +0 -105
- package/lib/EventConstants.js +0 -97
- package/lib/EventPluginHub.js +0 -251
- package/lib/EventPluginRegistry.js +0 -247
- package/lib/EventPluginUtils.js +0 -229
- package/lib/EventPropagators.js +0 -137
- package/lib/FallbackCompositionState.js +0 -95
- package/lib/HTMLDOMPropertyConfig.js +0 -209
- package/lib/LinkedValueUtils.js +0 -136
- package/lib/NativeMethodsMixin.js +0 -167
- package/lib/ReactBrowserEventEmitter.js +0 -317
- package/lib/ReactChildReconciler.js +0 -154
- package/lib/ReactChildrenMutationWarningHook.js +0 -54
- package/lib/ReactComponentBrowserEnvironment.js +0 -30
- package/lib/ReactComponentEnvironment.js +0 -45
- package/lib/ReactComponentTreeTestUtils.js +0 -87
- package/lib/ReactCompositeComponent.js +0 -920
- package/lib/ReactDOM.js +0 -110
- package/lib/ReactDOMButton.js +0 -24
- package/lib/ReactDOMComponent.js +0 -1005
- package/lib/ReactDOMComponentTree.js +0 -188
- package/lib/ReactDOMContainerInfo.js +0 -33
- package/lib/ReactDOMEmptyComponent.js +0 -60
- package/lib/ReactDOMFiber.js +0 -78
- package/lib/ReactDOMIDOperations.js +0 -34
- package/lib/ReactDOMInput.js +0 -269
- package/lib/ReactDOMNullInputValuePropHook.js +0 -43
- package/lib/ReactDOMOption.js +0 -123
- package/lib/ReactDOMSelect.js +0 -201
- package/lib/ReactDOMSelection.js +0 -212
- package/lib/ReactDOMServer.js +0 -26
- package/lib/ReactDOMTextComponent.js +0 -164
- package/lib/ReactDOMTextarea.js +0 -155
- package/lib/ReactDOMTreeTraversal.js +0 -136
- package/lib/ReactDOMUnknownPropertyHook.js +0 -112
- package/lib/ReactDebugTool.js +0 -307
- package/lib/ReactDefaultBatchingStrategy.js +0 -68
- package/lib/ReactDefaultInjection.js +0 -84
- package/lib/ReactEmptyComponent.js +0 -30
- package/lib/ReactErrorUtils.js +0 -76
- package/lib/ReactEventEmitterMixin.js +0 -33
- package/lib/ReactEventListener.js +0 -157
- package/lib/ReactFeatureFlags.js +0 -22
- package/lib/ReactHostComponent.js +0 -76
- package/lib/ReactHostOperationHistoryHook.js +0 -37
- package/lib/ReactInjection.js +0 -36
- package/lib/ReactInputSelection.js +0 -124
- package/lib/ReactInstanceHandles.js +0 -302
- package/lib/ReactInstanceMap.js +0 -48
- package/lib/ReactInstrumentation.js +0 -21
- package/lib/ReactInvalidSetStateWarningHook.js +0 -36
- package/lib/ReactMarkupChecksum.js +0 -50
- package/lib/ReactMount.js +0 -495
- package/lib/ReactMultiChild.js +0 -451
- package/lib/ReactMultiChildUpdateTypes.js +0 -32
- package/lib/ReactNative.js +0 -71
- package/lib/ReactNativeAttributePayload.js +0 -371
- package/lib/ReactNativeBaseComponent.js +0 -198
- package/lib/ReactNativeBridgeEventPlugin.js +0 -60
- package/lib/ReactNativeComponentEnvironment.js +0 -31
- package/lib/ReactNativeComponentTree.js +0 -68
- package/lib/ReactNativeContainerInfo.js +0 -21
- package/lib/ReactNativeDOMIDOperations.js +0 -79
- package/lib/ReactNativeDefaultInjection.js +0 -101
- package/lib/ReactNativeEventEmitter.js +0 -191
- package/lib/ReactNativeEventPluginOrder.js +0 -16
- package/lib/ReactNativeGlobalResponderHandler.js +0 -25
- package/lib/ReactNativeMount.js +0 -193
- package/lib/ReactNativePropRegistry.js +0 -52
- package/lib/ReactNativeReconcileTransaction.js +0 -116
- package/lib/ReactNativeTagHandles.js +0 -56
- package/lib/ReactNativeTextComponent.js +0 -71
- package/lib/ReactNativeTreeTraversal.js +0 -127
- package/lib/ReactNodeTypes.js +0 -40
- package/lib/ReactNoop.js +0 -173
- package/lib/ReactOwner.js +0 -94
- package/lib/ReactPerf.js +0 -494
- package/lib/ReactReconcileTransaction.js +0 -178
- package/lib/ReactReconciler.js +0 -168
- package/lib/ReactRef.js +0 -80
- package/lib/ReactServerBatchingStrategy.js +0 -22
- package/lib/ReactServerRendering.js +0 -90
- package/lib/ReactServerRenderingTransaction.js +0 -90
- package/lib/ReactServerUpdateQueue.js +0 -141
- package/lib/ReactSimpleEmptyComponent.js +0 -37
- package/lib/ReactTestMount.js +0 -123
- package/lib/ReactTestReconcileTransaction.js +0 -108
- package/lib/ReactTestRenderer.js +0 -144
- package/lib/ReactTestUtils.js +0 -518
- package/lib/ReactUpdateQueue.js +0 -226
- package/lib/ReactUpdates.js +0 -251
- package/lib/ResponderEventPlugin.js +0 -510
- package/lib/ResponderSyntheticEvent.js +0 -39
- package/lib/ResponderTouchHistoryStore.js +0 -184
- package/lib/SVGDOMPropertyConfig.js +0 -302
- package/lib/SelectEventPlugin.js +0 -196
- package/lib/SimpleEventPlugin.js +0 -635
- package/lib/SyntheticAnimationEvent.js +0 -39
- package/lib/SyntheticClipboardEvent.js +0 -38
- package/lib/SyntheticCompositionEvent.js +0 -36
- package/lib/SyntheticDragEvent.js +0 -36
- package/lib/SyntheticEvent.js +0 -267
- package/lib/SyntheticFocusEvent.js +0 -36
- package/lib/SyntheticInputEvent.js +0 -37
- package/lib/SyntheticKeyboardEvent.js +0 -84
- package/lib/SyntheticMouseEvent.js +0 -72
- package/lib/SyntheticTouchEvent.js +0 -45
- package/lib/SyntheticTransitionEvent.js +0 -39
- package/lib/SyntheticUIEvent.js +0 -59
- package/lib/SyntheticWheelEvent.js +0 -54
- package/lib/TapEventPlugin.js +0 -110
- package/lib/TouchHistoryMath.js +0 -99
- package/lib/Transaction.js +0 -233
- package/lib/ViewportMetrics.js +0 -27
- package/lib/accumulate.js +0 -46
- package/lib/accumulateInto.js +0 -58
- package/lib/adler32.js +0 -44
- package/lib/createMicrosoftUnsafeLocalFunction.js +0 -32
- package/lib/createReactNativeComponentClass.js +0 -42
- package/lib/dangerousStyleValue.js +0 -79
- package/lib/escapeTextContentForBrowser.js +0 -122
- package/lib/findDOMNode.js +0 -60
- package/lib/findNodeHandle.js +0 -91
- package/lib/forEachAccumulated.js +0 -31
- package/lib/getEventCharCode.js +0 -50
- package/lib/getEventKey.js +0 -102
- package/lib/getEventModifierState.js +0 -43
- package/lib/getEventTarget.js +0 -35
- package/lib/getHostComponentFromComposite.js +0 -30
- package/lib/getNodeForCharacterOffset.js +0 -74
- package/lib/getTestDocument.js +0 -21
- package/lib/getTextContentAccessor.js +0 -33
- package/lib/getVendorPrefixedEventName.js +0 -101
- package/lib/instantiateReactComponent.js +0 -119
- package/lib/isEventSupported.js +0 -60
- package/lib/isTextInputElement.js +0 -51
- package/lib/quoteAttributeValueForBrowser.js +0 -26
- package/lib/reactComponentExpect.js +0 -217
- package/lib/setInnerHTML.js +0 -98
- package/lib/setTextContent.js +0 -48
- package/lib/shouldUpdateReactComponent.js +0 -42
- package/lib/validateDOMNesting.js +0 -369
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
+
*
|
|
9
10
|
* @providesModule ReactComponentTreeHook
|
|
10
11
|
*/
|
|
11
12
|
|
|
@@ -49,113 +50,88 @@ typeof Set === 'function' && isNative(Set) &&
|
|
|
49
50
|
// Set.prototype.keys
|
|
50
51
|
Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
var
|
|
53
|
+
if (canUseCollections) {
|
|
54
|
+
var itemMap = new Map();
|
|
55
|
+
var rootIDSet = new Set();
|
|
54
56
|
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
+
var setItem = function (id, item) {
|
|
58
|
+
itemMap.set(id, item);
|
|
59
|
+
};
|
|
60
|
+
var getItem = function (id) {
|
|
61
|
+
return itemMap.get(id);
|
|
62
|
+
};
|
|
63
|
+
var removeItem = function (id) {
|
|
64
|
+
itemMap['delete'](id);
|
|
65
|
+
};
|
|
66
|
+
var getItemIDs = function () {
|
|
67
|
+
return Array.from(itemMap.keys());
|
|
68
|
+
};
|
|
57
69
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
70
|
+
var addRoot = function (id) {
|
|
71
|
+
rootIDSet.add(id);
|
|
72
|
+
};
|
|
73
|
+
var removeRoot = function (id) {
|
|
74
|
+
rootIDSet['delete'](id);
|
|
75
|
+
};
|
|
76
|
+
var getRootIDs = function () {
|
|
77
|
+
return Array.from(rootIDSet.keys());
|
|
78
|
+
};
|
|
61
79
|
} else {
|
|
62
|
-
itemByKey = {};
|
|
63
|
-
rootByKey = {};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
var unmountedIDs = [];
|
|
80
|
+
var itemByKey = {};
|
|
81
|
+
var rootByKey = {};
|
|
67
82
|
|
|
68
|
-
// Use non-numeric keys to prevent V8 performance issues:
|
|
69
|
-
// https://github.com/facebook/react/pull/7232
|
|
70
|
-
function
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
}
|
|
83
|
+
// Use non-numeric keys to prevent V8 performance issues:
|
|
84
|
+
// https://github.com/facebook/react/pull/7232
|
|
85
|
+
var getKeyFromID = function (id) {
|
|
86
|
+
return '.' + id;
|
|
87
|
+
};
|
|
88
|
+
var getIDFromKey = function (key) {
|
|
89
|
+
return parseInt(key.substr(1), 10);
|
|
90
|
+
};
|
|
76
91
|
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
92
|
+
var setItem = function (id, item) {
|
|
93
|
+
var key = getKeyFromID(id);
|
|
94
|
+
itemByKey[key] = item;
|
|
95
|
+
};
|
|
96
|
+
var getItem = function (id) {
|
|
81
97
|
var key = getKeyFromID(id);
|
|
82
98
|
return itemByKey[key];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
function remove(id) {
|
|
87
|
-
if (canUseCollections) {
|
|
88
|
-
itemMap['delete'](id);
|
|
89
|
-
} else {
|
|
99
|
+
};
|
|
100
|
+
var removeItem = function (id) {
|
|
90
101
|
var key = getKeyFromID(id);
|
|
91
102
|
delete itemByKey[key];
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
function create(id, element, parentID) {
|
|
96
|
-
var item = {
|
|
97
|
-
element: element,
|
|
98
|
-
parentID: parentID,
|
|
99
|
-
text: null,
|
|
100
|
-
childIDs: [],
|
|
101
|
-
isMounted: false,
|
|
102
|
-
updateCount: 0
|
|
103
|
+
};
|
|
104
|
+
var getItemIDs = function () {
|
|
105
|
+
return Object.keys(itemByKey).map(getIDFromKey);
|
|
103
106
|
};
|
|
104
107
|
|
|
105
|
-
|
|
106
|
-
itemMap.set(id, item);
|
|
107
|
-
} else {
|
|
108
|
-
var key = getKeyFromID(id);
|
|
109
|
-
itemByKey[key] = item;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function addRoot(id) {
|
|
114
|
-
if (canUseCollections) {
|
|
115
|
-
rootIDSet.add(id);
|
|
116
|
-
} else {
|
|
108
|
+
var addRoot = function (id) {
|
|
117
109
|
var key = getKeyFromID(id);
|
|
118
110
|
rootByKey[key] = true;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
function removeRoot(id) {
|
|
123
|
-
if (canUseCollections) {
|
|
124
|
-
rootIDSet['delete'](id);
|
|
125
|
-
} else {
|
|
111
|
+
};
|
|
112
|
+
var removeRoot = function (id) {
|
|
126
113
|
var key = getKeyFromID(id);
|
|
127
114
|
delete rootByKey[key];
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
function getRegisteredIDs() {
|
|
132
|
-
if (canUseCollections) {
|
|
133
|
-
return Array.from(itemMap.keys());
|
|
134
|
-
} else {
|
|
135
|
-
return Object.keys(itemByKey).map(getIDFromKey);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
function getRootIDs() {
|
|
140
|
-
if (canUseCollections) {
|
|
141
|
-
return Array.from(rootIDSet.keys());
|
|
142
|
-
} else {
|
|
115
|
+
};
|
|
116
|
+
var getRootIDs = function () {
|
|
143
117
|
return Object.keys(rootByKey).map(getIDFromKey);
|
|
144
|
-
}
|
|
118
|
+
};
|
|
145
119
|
}
|
|
146
120
|
|
|
121
|
+
var unmountedIDs = [];
|
|
122
|
+
|
|
147
123
|
function purgeDeep(id) {
|
|
148
|
-
var item =
|
|
124
|
+
var item = getItem(id);
|
|
149
125
|
if (item) {
|
|
150
126
|
var childIDs = item.childIDs;
|
|
151
127
|
|
|
152
|
-
|
|
128
|
+
removeItem(id);
|
|
153
129
|
childIDs.forEach(purgeDeep);
|
|
154
130
|
}
|
|
155
131
|
}
|
|
156
132
|
|
|
157
133
|
function describeComponentFrame(name, source, ownerName) {
|
|
158
|
-
return '\n in ' + name + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
|
134
|
+
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
|
|
159
135
|
}
|
|
160
136
|
|
|
161
137
|
function getDisplayName(element) {
|
|
@@ -184,12 +160,13 @@ function describeID(id) {
|
|
|
184
160
|
|
|
185
161
|
var ReactComponentTreeHook = {
|
|
186
162
|
onSetChildren: function (id, nextChildIDs) {
|
|
187
|
-
var item =
|
|
163
|
+
var item = getItem(id);
|
|
164
|
+
invariant(item, 'Item must have been set');
|
|
188
165
|
item.childIDs = nextChildIDs;
|
|
189
166
|
|
|
190
167
|
for (var i = 0; i < nextChildIDs.length; i++) {
|
|
191
168
|
var nextChildID = nextChildIDs[i];
|
|
192
|
-
var nextChild =
|
|
169
|
+
var nextChild = getItem(nextChildID);
|
|
193
170
|
!nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;
|
|
194
171
|
!(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
|
|
195
172
|
!nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0;
|
|
@@ -197,16 +174,24 @@ var ReactComponentTreeHook = {
|
|
|
197
174
|
nextChild.parentID = id;
|
|
198
175
|
// TODO: This shouldn't be necessary but mounting a new root during in
|
|
199
176
|
// componentWillMount currently causes not-yet-mounted components to
|
|
200
|
-
// be purged from our tree data so their parent
|
|
177
|
+
// be purged from our tree data so their parent id is missing.
|
|
201
178
|
}
|
|
202
179
|
!(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;
|
|
203
180
|
}
|
|
204
181
|
},
|
|
205
182
|
onBeforeMountComponent: function (id, element, parentID) {
|
|
206
|
-
|
|
183
|
+
var item = {
|
|
184
|
+
element: element,
|
|
185
|
+
parentID: parentID,
|
|
186
|
+
text: null,
|
|
187
|
+
childIDs: [],
|
|
188
|
+
isMounted: false,
|
|
189
|
+
updateCount: 0
|
|
190
|
+
};
|
|
191
|
+
setItem(id, item);
|
|
207
192
|
},
|
|
208
193
|
onBeforeUpdateComponent: function (id, element) {
|
|
209
|
-
var item =
|
|
194
|
+
var item = getItem(id);
|
|
210
195
|
if (!item || !item.isMounted) {
|
|
211
196
|
// We may end up here as a result of setState() in componentWillUnmount().
|
|
212
197
|
// In this case, ignore the element.
|
|
@@ -215,7 +200,8 @@ var ReactComponentTreeHook = {
|
|
|
215
200
|
item.element = element;
|
|
216
201
|
},
|
|
217
202
|
onMountComponent: function (id) {
|
|
218
|
-
var item =
|
|
203
|
+
var item = getItem(id);
|
|
204
|
+
invariant(item, 'Item must have been set');
|
|
219
205
|
item.isMounted = true;
|
|
220
206
|
var isRoot = item.parentID === 0;
|
|
221
207
|
if (isRoot) {
|
|
@@ -223,7 +209,7 @@ var ReactComponentTreeHook = {
|
|
|
223
209
|
}
|
|
224
210
|
},
|
|
225
211
|
onUpdateComponent: function (id) {
|
|
226
|
-
var item =
|
|
212
|
+
var item = getItem(id);
|
|
227
213
|
if (!item || !item.isMounted) {
|
|
228
214
|
// We may end up here as a result of setState() in componentWillUnmount().
|
|
229
215
|
// In this case, ignore the element.
|
|
@@ -232,7 +218,7 @@ var ReactComponentTreeHook = {
|
|
|
232
218
|
item.updateCount++;
|
|
233
219
|
},
|
|
234
220
|
onUnmountComponent: function (id) {
|
|
235
|
-
var item =
|
|
221
|
+
var item = getItem(id);
|
|
236
222
|
if (item) {
|
|
237
223
|
// We need to check if it exists.
|
|
238
224
|
// `item` might not exist if it is inside an error boundary, and a sibling
|
|
@@ -260,16 +246,15 @@ var ReactComponentTreeHook = {
|
|
|
260
246
|
unmountedIDs.length = 0;
|
|
261
247
|
},
|
|
262
248
|
isMounted: function (id) {
|
|
263
|
-
var item =
|
|
249
|
+
var item = getItem(id);
|
|
264
250
|
return item ? item.isMounted : false;
|
|
265
251
|
},
|
|
266
252
|
getCurrentStackAddendum: function (topElement) {
|
|
267
253
|
var info = '';
|
|
268
254
|
if (topElement) {
|
|
269
|
-
var
|
|
270
|
-
var name = typeof type === 'function' ? type.displayName || type.name : type;
|
|
255
|
+
var name = getDisplayName(topElement);
|
|
271
256
|
var owner = topElement._owner;
|
|
272
|
-
info += describeComponentFrame(name
|
|
257
|
+
info += describeComponentFrame(name, topElement._source, owner && owner.getName());
|
|
273
258
|
}
|
|
274
259
|
|
|
275
260
|
var currentOwner = ReactCurrentOwner.current;
|
|
@@ -287,7 +272,7 @@ var ReactComponentTreeHook = {
|
|
|
287
272
|
return info;
|
|
288
273
|
},
|
|
289
274
|
getChildIDs: function (id) {
|
|
290
|
-
var item =
|
|
275
|
+
var item = getItem(id);
|
|
291
276
|
return item ? item.childIDs : [];
|
|
292
277
|
},
|
|
293
278
|
getDisplayName: function (id) {
|
|
@@ -298,7 +283,7 @@ var ReactComponentTreeHook = {
|
|
|
298
283
|
return getDisplayName(element);
|
|
299
284
|
},
|
|
300
285
|
getElement: function (id) {
|
|
301
|
-
var item =
|
|
286
|
+
var item = getItem(id);
|
|
302
287
|
return item ? item.element : null;
|
|
303
288
|
},
|
|
304
289
|
getOwnerID: function (id) {
|
|
@@ -309,11 +294,11 @@ var ReactComponentTreeHook = {
|
|
|
309
294
|
return element._owner._debugID;
|
|
310
295
|
},
|
|
311
296
|
getParentID: function (id) {
|
|
312
|
-
var item =
|
|
297
|
+
var item = getItem(id);
|
|
313
298
|
return item ? item.parentID : null;
|
|
314
299
|
},
|
|
315
300
|
getSource: function (id) {
|
|
316
|
-
var item =
|
|
301
|
+
var item = getItem(id);
|
|
317
302
|
var element = item ? item.element : null;
|
|
318
303
|
var source = element != null ? element._source : null;
|
|
319
304
|
return source;
|
|
@@ -329,14 +314,13 @@ var ReactComponentTreeHook = {
|
|
|
329
314
|
}
|
|
330
315
|
},
|
|
331
316
|
getUpdateCount: function (id) {
|
|
332
|
-
var item =
|
|
317
|
+
var item = getItem(id);
|
|
333
318
|
return item ? item.updateCount : 0;
|
|
334
319
|
},
|
|
335
320
|
|
|
336
321
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
getRootIDs: getRootIDs
|
|
322
|
+
getRootIDs: getRootIDs,
|
|
323
|
+
getRegisteredIDs: getItemIDs
|
|
340
324
|
};
|
|
341
325
|
|
|
342
326
|
module.exports = ReactComponentTreeHook;
|
|
@@ -6,15 +6,13 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
-
* @providesModule
|
|
9
|
+
* @providesModule ReactComponentTreeHookUMDShim
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
/* globals React */
|
|
13
|
+
|
|
12
14
|
'use strict';
|
|
13
15
|
|
|
14
|
-
var
|
|
15
|
-
html: 'http://www.w3.org/1999/xhtml',
|
|
16
|
-
mathml: 'http://www.w3.org/1998/Math/MathML',
|
|
17
|
-
svg: 'http://www.w3.org/2000/svg'
|
|
18
|
-
};
|
|
16
|
+
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
19
17
|
|
|
20
|
-
module.exports =
|
|
18
|
+
module.exports = ReactInternals.ReactComponentTreeHook;
|
package/lib/ReactCurrentOwner.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule ReactCurrentOwner
|
|
10
|
+
*
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
'use strict';
|
|
@@ -17,7 +18,6 @@
|
|
|
17
18
|
* The current owner is the component who should own any components that are
|
|
18
19
|
* currently being constructed.
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
21
|
var ReactCurrentOwner = {
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
-
* @providesModule
|
|
10
|
-
*/
|
|
9
|
+
* @providesModule ReactCurrentOwnerUMDShim
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/* globals React */
|
|
11
13
|
|
|
12
14
|
'use strict';
|
|
13
15
|
|
|
14
|
-
var
|
|
16
|
+
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
15
17
|
|
|
16
|
-
module.exports =
|
|
18
|
+
module.exports = ReactInternals.ReactCurrentOwner;
|
package/lib/ReactElement.js
CHANGED
|
@@ -19,9 +19,7 @@ var warning = require('fbjs/lib/warning');
|
|
|
19
19
|
var canDefineProperty = require('./canDefineProperty');
|
|
20
20
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
// nor polyfill, then a plain number is used for performance.
|
|
24
|
-
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
|
|
22
|
+
var REACT_ELEMENT_TYPE = require('./ReactElementSymbol');
|
|
25
23
|
|
|
26
24
|
var RESERVED_PROPS = {
|
|
27
25
|
key: true,
|
|
@@ -125,7 +123,6 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
|
125
123
|
// This can be replaced with a WeakMap once they are implemented in
|
|
126
124
|
// commonly used development environments.
|
|
127
125
|
element._store = {};
|
|
128
|
-
var shadowChildren = Array.isArray(props.children) ? props.children.slice(0) : props.children;
|
|
129
126
|
|
|
130
127
|
// To make comparing ReactElements easier for testing purposes, we make
|
|
131
128
|
// the validation flag non-enumerable (where possible, which should
|
|
@@ -145,12 +142,6 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
|
145
142
|
writable: false,
|
|
146
143
|
value: self
|
|
147
144
|
});
|
|
148
|
-
Object.defineProperty(element, '_shadowChildren', {
|
|
149
|
-
configurable: false,
|
|
150
|
-
enumerable: false,
|
|
151
|
-
writable: false,
|
|
152
|
-
value: shadowChildren
|
|
153
|
-
});
|
|
154
145
|
// Two elements created in two different places should be considered
|
|
155
146
|
// equal for testing purposes and therefore we hide it from enumeration.
|
|
156
147
|
Object.defineProperty(element, '_source', {
|
|
@@ -162,7 +153,6 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
|
162
153
|
} else {
|
|
163
154
|
element._store.validated = false;
|
|
164
155
|
element._self = self;
|
|
165
|
-
element._shadowChildren = shadowChildren;
|
|
166
156
|
element._source = source;
|
|
167
157
|
}
|
|
168
158
|
if (Object.freeze) {
|
|
@@ -190,14 +180,6 @@ ReactElement.createElement = function (type, config, children) {
|
|
|
190
180
|
var source = null;
|
|
191
181
|
|
|
192
182
|
if (config != null) {
|
|
193
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
194
|
-
process.env.NODE_ENV !== 'production' ? warning(
|
|
195
|
-
/* eslint-disable no-proto */
|
|
196
|
-
config.__proto__ == null || config.__proto__ === Object.prototype,
|
|
197
|
-
/* eslint-enable no-proto */
|
|
198
|
-
'React.createElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
183
|
if (hasValidRef(config)) {
|
|
202
184
|
ref = config.ref;
|
|
203
185
|
}
|
|
@@ -225,6 +207,11 @@ ReactElement.createElement = function (type, config, children) {
|
|
|
225
207
|
for (var i = 0; i < childrenLength; i++) {
|
|
226
208
|
childArray[i] = arguments[i + 2];
|
|
227
209
|
}
|
|
210
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
211
|
+
if (Object.freeze) {
|
|
212
|
+
Object.freeze(childArray);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
228
215
|
props.children = childArray;
|
|
229
216
|
}
|
|
230
217
|
|
|
@@ -298,14 +285,6 @@ ReactElement.cloneElement = function (element, config, children) {
|
|
|
298
285
|
var owner = element._owner;
|
|
299
286
|
|
|
300
287
|
if (config != null) {
|
|
301
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
302
|
-
process.env.NODE_ENV !== 'production' ? warning(
|
|
303
|
-
/* eslint-disable no-proto */
|
|
304
|
-
config.__proto__ == null || config.__proto__ === Object.prototype,
|
|
305
|
-
/* eslint-enable no-proto */
|
|
306
|
-
'React.cloneElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
288
|
if (hasValidRef(config)) {
|
|
310
289
|
// Silently steal the ref from the parent.
|
|
311
290
|
ref = config.ref;
|
|
@@ -359,6 +338,4 @@ ReactElement.isValidElement = function (object) {
|
|
|
359
338
|
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
360
339
|
};
|
|
361
340
|
|
|
362
|
-
ReactElement.REACT_ELEMENT_TYPE = REACT_ELEMENT_TYPE;
|
|
363
|
-
|
|
364
341
|
module.exports = ReactElement;
|