react 0.12.0 → 0.13.0-alpha.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/JSXTransformer.js +2345 -910
- package/dist/react-with-addons.js +5273 -4111
- package/dist/react-with-addons.min.js +5 -6
- package/dist/react.js +4840 -3940
- package/dist/react.min.js +5 -6
- package/lib/AutoFocusMixin.js +1 -1
- package/lib/BeforeInputEventPlugin.js +389 -112
- package/lib/CSSProperty.js +6 -3
- package/lib/CSSPropertyOperations.js +21 -1
- package/lib/CallbackQueue.js +2 -2
- package/lib/ChangeEventPlugin.js +3 -3
- package/lib/ClientReactRootIndex.js +1 -1
- package/lib/DOMChildrenOperations.js +6 -4
- package/lib/DOMProperty.js +1 -1
- package/lib/DOMPropertyOperations.js +1 -1
- package/lib/Danger.js +7 -6
- package/lib/DefaultEventPluginOrder.js +1 -2
- package/lib/EnterLeaveEventPlugin.js +1 -1
- package/lib/EventConstants.js +1 -1
- package/lib/EventPluginHub.js +9 -7
- package/lib/EventPluginRegistry.js +1 -1
- package/lib/EventPluginUtils.js +1 -1
- package/lib/EventPropagators.js +1 -1
- package/lib/ExecutionEnvironment.js +2 -3
- package/lib/FallbackCompositionState.js +89 -0
- package/lib/HTMLDOMPropertyConfig.js +19 -7
- package/lib/LinkedStateMixin.js +1 -1
- package/lib/LinkedValueUtils.js +3 -3
- package/lib/LocalEventTrapMixin.js +1 -1
- package/lib/MobileSafariClickEventPlugin.js +1 -1
- package/lib/Object.assign.js +3 -1
- package/lib/PooledClass.js +1 -1
- package/lib/React.js +17 -50
- package/lib/ReactBrowserComponentMixin.js +3 -13
- package/lib/ReactBrowserEventEmitter.js +4 -6
- package/lib/ReactCSSTransitionGroup.js +4 -1
- package/lib/ReactCSSTransitionGroupChild.js +12 -2
- package/lib/ReactChildReconciler.js +121 -0
- package/lib/ReactChildren.js +10 -8
- package/lib/ReactClass.js +874 -0
- package/lib/ReactComponent.js +45 -286
- package/lib/ReactComponentBase.js +126 -0
- package/lib/ReactComponentBrowserEnvironment.js +10 -83
- package/lib/ReactComponentEnvironment.js +57 -0
- package/lib/ReactComponentWithPureRenderMixin.js +1 -1
- package/lib/ReactCompositeComponent.js +700 -1045
- package/lib/ReactContext.js +6 -2
- package/lib/ReactCurrentOwner.js +1 -1
- package/lib/ReactDOM.js +3 -8
- package/lib/ReactDOMButton.js +5 -6
- package/lib/ReactDOMComponent.js +120 -77
- package/lib/ReactDOMForm.js +5 -6
- package/lib/ReactDOMIDOperations.js +56 -74
- package/lib/ReactDOMImg.js +4 -6
- package/lib/ReactDOMInput.js +5 -6
- package/lib/ReactDOMOption.js +5 -6
- package/lib/ReactDOMSelect.js +57 -65
- package/lib/ReactDOMSelection.js +6 -2
- package/lib/ReactDOMTextComponent.js +124 -0
- package/lib/ReactDOMTextarea.js +5 -6
- package/lib/ReactDefaultBatchingStrategy.js +1 -1
- package/lib/ReactDefaultInjection.js +14 -8
- package/lib/ReactDefaultPerf.js +8 -7
- package/lib/ReactDefaultPerfAnalysis.js +1 -1
- package/lib/ReactElement.js +22 -15
- package/lib/ReactElementValidator.js +192 -53
- package/lib/ReactEmptyComponent.js +29 -11
- package/lib/ReactEventEmitterMixin.js +1 -1
- package/lib/ReactEventListener.js +3 -3
- package/lib/ReactInjection.js +7 -5
- package/lib/ReactInputSelection.js +3 -4
- package/lib/ReactInstanceHandles.js +3 -2
- package/lib/ReactInstanceMap.js +47 -0
- package/lib/ReactLink.js +1 -1
- package/lib/ReactMarkupChecksum.js +1 -1
- package/lib/ReactMount.js +202 -66
- package/lib/ReactMultiChild.js +44 -45
- package/lib/ReactMultiChildUpdateTypes.js +1 -1
- package/lib/ReactNativeComponent.js +47 -10
- package/lib/ReactOwner.js +4 -48
- package/lib/ReactPerf.js +21 -1
- package/lib/ReactPropTransferer.js +2 -57
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +1 -1
- package/lib/ReactPropTypes.js +14 -22
- package/lib/ReactPutListenerQueue.js +1 -1
- package/lib/ReactReconcileTransaction.js +1 -1
- package/lib/ReactRef.js +96 -0
- package/lib/ReactRootIndex.js +1 -1
- package/lib/ReactServerRendering.js +5 -3
- package/lib/ReactServerRenderingTransaction.js +1 -1
- package/lib/ReactStateSetters.js +1 -1
- package/lib/ReactTestUtils.js +83 -26
- package/lib/ReactTransitionChildMapping.js +1 -1
- package/lib/ReactTransitionEvents.js +1 -1
- package/lib/ReactTransitionGroup.js +48 -7
- package/lib/ReactUpdates.js +46 -45
- package/lib/ReactWithAddons.js +1 -1
- package/lib/SVGDOMPropertyConfig.js +1 -1
- package/lib/SelectEventPlugin.js +3 -3
- package/lib/ServerReactRootIndex.js +1 -1
- package/lib/SimpleEventPlugin.js +1 -1
- package/lib/SyntheticClipboardEvent.js +1 -2
- package/lib/SyntheticCompositionEvent.js +1 -2
- package/lib/SyntheticDragEvent.js +1 -1
- package/lib/SyntheticEvent.js +11 -3
- package/lib/SyntheticFocusEvent.js +1 -1
- package/lib/SyntheticInputEvent.js +1 -2
- package/lib/SyntheticKeyboardEvent.js +1 -1
- package/lib/SyntheticMouseEvent.js +2 -4
- package/lib/SyntheticTouchEvent.js +1 -1
- package/lib/SyntheticUIEvent.js +1 -1
- package/lib/SyntheticWheelEvent.js +1 -1
- package/lib/Transaction.js +3 -3
- package/lib/ViewportMetrics.js +2 -5
- package/lib/accumulate.js +47 -0
- package/lib/accumulateInto.js +1 -1
- package/lib/adler32.js +1 -1
- package/lib/cloneWithProps.js +3 -3
- package/lib/copyProperties.js +2 -0
- package/lib/createFullPageComponent.js +3 -3
- package/lib/dangerousStyleValue.js +1 -1
- package/lib/escapeTextForBrowser.js +6 -6
- package/lib/findDOMNode.js +51 -0
- package/lib/flattenChildren.js +11 -22
- package/lib/forEachAccumulated.js +1 -1
- package/lib/getEventCharCode.js +1 -1
- package/lib/getEventKey.js +1 -1
- package/lib/getEventModifierState.js +1 -1
- package/lib/getEventTarget.js +1 -1
- package/lib/getIteratorFn.js +42 -0
- package/lib/getNodeForCharacterOffset.js +2 -2
- package/lib/getReactRootElementInContainer.js +1 -1
- package/lib/getTextContentAccessor.js +1 -1
- package/lib/instantiateReactComponent.js +89 -66
- package/lib/isEventSupported.js +1 -1
- package/lib/isNode.js +3 -4
- package/lib/isTextInputElement.js +2 -3
- package/lib/joinClasses.js +1 -1
- package/lib/keyMirror.js +1 -1
- package/lib/memoizeStringOnly.js +4 -5
- package/lib/onlyChild.js +1 -1
- package/lib/setInnerHTML.js +12 -1
- package/lib/shallowEqual.js +1 -1
- package/lib/shouldUpdateReactComponent.js +48 -6
- package/lib/traverseAllChildren.js +111 -55
- package/lib/update.js +1 -1
- package/lib/warning.js +9 -2
- package/package.json +1 -1
- package/lib/CompositionEventPlugin.js +0 -257
- package/lib/ReactLegacyElement.js +0 -243
- package/lib/ReactTextComponent.js +0 -104
- package/lib/deprecated.js +0 -47
package/lib/isEventSupported.js
CHANGED
package/lib/isNode.js
CHANGED
|
@@ -16,10 +16,9 @@
|
|
|
16
16
|
*/
|
|
17
17
|
function isNode(object) {
|
|
18
18
|
return !!(object && (
|
|
19
|
-
typeof Node === 'function' ? object instanceof Node :
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
typeof object.nodeName === 'string'
|
|
19
|
+
((typeof Node === 'function' ? object instanceof Node : typeof object === 'object' &&
|
|
20
|
+
typeof object.nodeType === 'number' &&
|
|
21
|
+
typeof object.nodeName === 'string'))
|
|
23
22
|
));
|
|
24
23
|
}
|
|
25
24
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @providesModule isTextInputElement
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
|
|
@@ -34,8 +34,7 @@ var supportedInputTypes = {
|
|
|
34
34
|
|
|
35
35
|
function isTextInputElement(elem) {
|
|
36
36
|
return elem && (
|
|
37
|
-
(elem.nodeName === 'INPUT' && supportedInputTypes[elem.type]
|
|
38
|
-
elem.nodeName === 'TEXTAREA'
|
|
37
|
+
(elem.nodeName === 'INPUT' && supportedInputTypes[elem.type] || elem.nodeName === 'TEXTAREA')
|
|
39
38
|
);
|
|
40
39
|
}
|
|
41
40
|
|
package/lib/joinClasses.js
CHANGED
package/lib/keyMirror.js
CHANGED
package/lib/memoizeStringOnly.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Memoizes the return value of a function that accepts one string argument.
|
|
@@ -21,11 +21,10 @@
|
|
|
21
21
|
function memoizeStringOnly(callback) {
|
|
22
22
|
var cache = {};
|
|
23
23
|
return function(string) {
|
|
24
|
-
if (cache.hasOwnProperty(string)) {
|
|
25
|
-
|
|
26
|
-
} else {
|
|
27
|
-
return cache[string] = callback.call(this, string);
|
|
24
|
+
if (!cache.hasOwnProperty(string)) {
|
|
25
|
+
cache[string] = callback.call(this, string);
|
|
28
26
|
}
|
|
27
|
+
return cache[string];
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
30
|
|
package/lib/onlyChild.js
CHANGED
package/lib/setInnerHTML.js
CHANGED
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
* @providesModule setInnerHTML
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/* globals MSApp */
|
|
13
|
+
|
|
14
|
+
'use strict';
|
|
13
15
|
|
|
14
16
|
var ExecutionEnvironment = require("./ExecutionEnvironment");
|
|
15
17
|
|
|
@@ -28,6 +30,15 @@ var setInnerHTML = function(node, html) {
|
|
|
28
30
|
node.innerHTML = html;
|
|
29
31
|
};
|
|
30
32
|
|
|
33
|
+
// Win8 apps: Allow all html to be inserted
|
|
34
|
+
if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
|
|
35
|
+
setInnerHTML = function(node, html) {
|
|
36
|
+
MSApp.execUnsafeLocalFunction(function() {
|
|
37
|
+
node.innerHTML = html;
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
31
42
|
if (ExecutionEnvironment.canUseDOM) {
|
|
32
43
|
// IE8: When updating a just created node with innerHTML only leading
|
|
33
44
|
// whitespace is removed. When updating an existing node with innerHTML
|
package/lib/shallowEqual.js
CHANGED
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
|
+
|
|
15
|
+
var monitorCodeUse = require("./monitorCodeUse");
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* Given a `prevElement` and `nextElement`, determines if the existing
|
|
@@ -24,11 +26,51 @@
|
|
|
24
26
|
* @protected
|
|
25
27
|
*/
|
|
26
28
|
function shouldUpdateReactComponent(prevElement, nextElement) {
|
|
27
|
-
if (prevElement && nextElement
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
if (prevElement != null && nextElement != null) {
|
|
30
|
+
var prevType = typeof prevElement;
|
|
31
|
+
var nextType = typeof nextElement;
|
|
32
|
+
if (prevType === 'string' || prevType === 'number') {
|
|
33
|
+
return (nextType === 'string' || nextType === 'number');
|
|
34
|
+
} else {
|
|
35
|
+
if (nextType === 'object' &&
|
|
36
|
+
prevElement.type === nextElement.type &&
|
|
37
|
+
prevElement.key === nextElement.key) {
|
|
38
|
+
var ownersMatch = prevElement._owner === nextElement._owner;
|
|
39
|
+
var prevName = null;
|
|
40
|
+
var nextName = null;
|
|
41
|
+
var nextDisplayName = null;
|
|
42
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
43
|
+
if (!ownersMatch) {
|
|
44
|
+
if (prevElement._owner != null &&
|
|
45
|
+
prevElement._owner.getPublicInstance() != null &&
|
|
46
|
+
prevElement._owner.getPublicInstance().constructor != null) {
|
|
47
|
+
prevName =
|
|
48
|
+
prevElement._owner.getPublicInstance().constructor.displayName;
|
|
49
|
+
}
|
|
50
|
+
if (nextElement._owner != null &&
|
|
51
|
+
nextElement._owner.getPublicInstance() != null &&
|
|
52
|
+
nextElement._owner.getPublicInstance().constructor != null) {
|
|
53
|
+
nextName =
|
|
54
|
+
nextElement._owner.getPublicInstance().constructor.displayName;
|
|
55
|
+
}
|
|
56
|
+
if (nextElement.type != null &&
|
|
57
|
+
nextElement.type.displayName != null) {
|
|
58
|
+
nextDisplayName = nextElement.type.displayName;
|
|
59
|
+
}
|
|
60
|
+
monitorCodeUse(
|
|
61
|
+
'react_should_update_owner_is_useful',
|
|
62
|
+
{
|
|
63
|
+
key: prevElement.key,
|
|
64
|
+
prevOwner: prevName,
|
|
65
|
+
nextOwner: nextName,
|
|
66
|
+
nextDisplayName: nextDisplayName
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return ownersMatch;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
32
74
|
}
|
|
33
75
|
return false;
|
|
34
76
|
}
|
|
@@ -9,22 +9,20 @@
|
|
|
9
9
|
* @providesModule traverseAllChildren
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
var ReactElement = require("./ReactElement");
|
|
15
15
|
var ReactInstanceHandles = require("./ReactInstanceHandles");
|
|
16
16
|
|
|
17
|
+
var getIteratorFn = require("./getIteratorFn");
|
|
17
18
|
var invariant = require("./invariant");
|
|
18
19
|
|
|
19
20
|
var SEPARATOR = ReactInstanceHandles.SEPARATOR;
|
|
20
21
|
var SUBSEPARATOR = ':';
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
|
-
* TODO: Test that
|
|
24
|
-
*
|
|
25
|
-
* 2. it('should fail when supplied duplicate key', function() {
|
|
26
|
-
* 3. That a single child and an array with one item have the same key pattern.
|
|
27
|
-
* });
|
|
24
|
+
* TODO: Test that a single child and an array with one item have the same key
|
|
25
|
+
* pattern.
|
|
28
26
|
*/
|
|
29
27
|
|
|
30
28
|
var userProvidedKeyEscaperLookup = {
|
|
@@ -88,58 +86,90 @@ function wrapUserProvidedKey(key) {
|
|
|
88
86
|
* process.
|
|
89
87
|
* @return {!number} The number of children in this subtree.
|
|
90
88
|
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
} else {
|
|
113
|
-
var type = typeof children;
|
|
114
|
-
var isOnlyChild = nameSoFar === '';
|
|
89
|
+
function traverseAllChildrenImpl(
|
|
90
|
+
children,
|
|
91
|
+
nameSoFar,
|
|
92
|
+
indexSoFar,
|
|
93
|
+
callback,
|
|
94
|
+
traverseContext
|
|
95
|
+
) {
|
|
96
|
+
var type = typeof children;
|
|
97
|
+
|
|
98
|
+
if (type === 'undefined' || type === 'boolean') {
|
|
99
|
+
// All of the above are perceived as null.
|
|
100
|
+
children = null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (children === null ||
|
|
104
|
+
type === 'string' ||
|
|
105
|
+
type === 'number' ||
|
|
106
|
+
ReactElement.isValidElement(children)) {
|
|
107
|
+
callback(
|
|
108
|
+
traverseContext,
|
|
109
|
+
children,
|
|
115
110
|
// If it's the only child, treat the name as if it was wrapped in an array
|
|
116
|
-
// so that it's consistent if the number of children grows
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
111
|
+
// so that it's consistent if the number of children grows.
|
|
112
|
+
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar,
|
|
113
|
+
indexSoFar
|
|
114
|
+
);
|
|
115
|
+
return 1;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
var child, nextName, nextIndex;
|
|
119
|
+
var subtreeCount = 0; // Count of children found in the current subtree.
|
|
120
|
+
|
|
121
|
+
if (Array.isArray(children)) {
|
|
122
|
+
for (var i = 0; i < children.length; i++) {
|
|
123
|
+
child = children[i];
|
|
124
|
+
nextName = (
|
|
125
|
+
(nameSoFar !== '' ? nameSoFar + SUBSEPARATOR : SEPARATOR) +
|
|
126
|
+
getComponentKey(child, i)
|
|
127
|
+
);
|
|
128
|
+
nextIndex = indexSoFar + subtreeCount;
|
|
129
|
+
subtreeCount += traverseAllChildrenImpl(
|
|
130
|
+
child,
|
|
131
|
+
nextName,
|
|
132
|
+
nextIndex,
|
|
133
|
+
callback,
|
|
134
|
+
traverseContext
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
var iteratorFn = getIteratorFn(children);
|
|
139
|
+
if (iteratorFn) {
|
|
140
|
+
var iterator = iteratorFn.call(children);
|
|
141
|
+
var step;
|
|
142
|
+
if (iteratorFn !== children.entries) {
|
|
143
|
+
var ii = 0;
|
|
144
|
+
while (!(step = iterator.next()).done) {
|
|
145
|
+
child = step.value;
|
|
146
|
+
nextName = (
|
|
147
|
+
(nameSoFar !== '' ? nameSoFar + SUBSEPARATOR : SEPARATOR) +
|
|
148
|
+
getComponentKey(child, ii++)
|
|
149
|
+
);
|
|
150
|
+
nextIndex = indexSoFar + subtreeCount;
|
|
151
|
+
subtreeCount += traverseAllChildrenImpl(
|
|
152
|
+
child,
|
|
153
|
+
nextName,
|
|
154
|
+
nextIndex,
|
|
155
|
+
callback,
|
|
156
|
+
traverseContext
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
161
|
+
while (!(step = iterator.next()).done) {
|
|
162
|
+
var entry = step.value;
|
|
163
|
+
if (entry) {
|
|
164
|
+
child = entry[1];
|
|
135
165
|
nextName = (
|
|
136
|
-
nameSoFar
|
|
137
|
-
wrapUserProvidedKey(
|
|
138
|
-
getComponentKey(
|
|
166
|
+
(nameSoFar !== '' ? nameSoFar + SUBSEPARATOR : SEPARATOR) +
|
|
167
|
+
wrapUserProvidedKey(entry[0]) + SUBSEPARATOR +
|
|
168
|
+
getComponentKey(child, 0)
|
|
139
169
|
);
|
|
140
170
|
nextIndex = indexSoFar + subtreeCount;
|
|
141
171
|
subtreeCount += traverseAllChildrenImpl(
|
|
142
|
-
|
|
172
|
+
child,
|
|
143
173
|
nextName,
|
|
144
174
|
nextIndex,
|
|
145
175
|
callback,
|
|
@@ -148,9 +178,35 @@ var traverseAllChildrenImpl =
|
|
|
148
178
|
}
|
|
149
179
|
}
|
|
150
180
|
}
|
|
181
|
+
} else if (type === 'object') {
|
|
182
|
+
("production" !== process.env.NODE_ENV ? invariant(
|
|
183
|
+
children.nodeType !== 1,
|
|
184
|
+
'traverseAllChildren(...): Encountered an invalid child; DOM ' +
|
|
185
|
+
'elements are not valid children of React components.'
|
|
186
|
+
) : invariant(children.nodeType !== 1));
|
|
187
|
+
for (var key in children) {
|
|
188
|
+
if (children.hasOwnProperty(key)) {
|
|
189
|
+
child = children[key];
|
|
190
|
+
nextName = (
|
|
191
|
+
(nameSoFar !== '' ? nameSoFar + SUBSEPARATOR : SEPARATOR) +
|
|
192
|
+
wrapUserProvidedKey(key) + SUBSEPARATOR +
|
|
193
|
+
getComponentKey(child, 0)
|
|
194
|
+
);
|
|
195
|
+
nextIndex = indexSoFar + subtreeCount;
|
|
196
|
+
subtreeCount += traverseAllChildrenImpl(
|
|
197
|
+
child,
|
|
198
|
+
nextName,
|
|
199
|
+
nextIndex,
|
|
200
|
+
callback,
|
|
201
|
+
traverseContext
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
151
205
|
}
|
|
152
|
-
|
|
153
|
-
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return subtreeCount;
|
|
209
|
+
}
|
|
154
210
|
|
|
155
211
|
/**
|
|
156
212
|
* Traverses children that are typically specified as `props.children`, but
|
package/lib/update.js
CHANGED
package/lib/warning.js
CHANGED
|
@@ -23,7 +23,7 @@ var emptyFunction = require("./emptyFunction");
|
|
|
23
23
|
var warning = emptyFunction;
|
|
24
24
|
|
|
25
25
|
if ("production" !== process.env.NODE_ENV) {
|
|
26
|
-
warning = function(condition, format ) {var args=
|
|
26
|
+
warning = function(condition, format ) {for (var args=[],$__0=2,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]);
|
|
27
27
|
if (format === undefined) {
|
|
28
28
|
throw new Error(
|
|
29
29
|
'`warning(condition, format, ...args)` requires a warning ' +
|
|
@@ -33,7 +33,14 @@ if ("production" !== process.env.NODE_ENV) {
|
|
|
33
33
|
|
|
34
34
|
if (!condition) {
|
|
35
35
|
var argIndex = 0;
|
|
36
|
-
|
|
36
|
+
var message = 'Warning: ' + format.replace(/%s/g, function() {return args[argIndex++];});
|
|
37
|
+
console.warn(message);
|
|
38
|
+
try {
|
|
39
|
+
// --- Welcome to debugging React ---
|
|
40
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
41
|
+
// to find the callsite that caused this warning to fire.
|
|
42
|
+
throw new Error(message);
|
|
43
|
+
} catch(x) {}
|
|
37
44
|
}
|
|
38
45
|
};
|
|
39
46
|
}
|