react 15.0.0-rc.2 → 15.0.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 +1217 -1105
- package/dist/react-with-addons.min.js +6 -6
- package/dist/react.js +1083 -1001
- package/dist/react.min.js +6 -6
- package/lib/CSSPropertyOperations.js +31 -15
- package/lib/CallbackQueue.js +4 -3
- package/lib/DOMChildrenOperations.js +0 -3
- package/lib/DOMProperty.js +3 -3
- package/lib/DOMPropertyOperations.js +3 -2
- package/lib/Danger.js +8 -8
- package/lib/EventPluginHub.js +2 -2
- package/lib/EventPluginRegistry.js +7 -7
- package/lib/EventPluginUtils.js +5 -5
- package/lib/EventPropagators.js +1 -1
- package/lib/FallbackCompositionState.js +3 -2
- package/lib/LinkedValueUtils.js +4 -4
- package/lib/OrderedMap.js +16 -15
- package/lib/PooledClass.js +1 -1
- package/lib/React.js +51 -9
- package/lib/ReactBrowserEventEmitter.js +3 -2
- package/lib/ReactCSSTransitionGroup.js +3 -3
- package/lib/ReactChildReconciler.js +1 -1
- package/lib/ReactClass.js +24 -23
- package/lib/ReactComponent.js +5 -5
- package/lib/ReactComponentEnvironment.js +1 -1
- package/lib/ReactCompositeComponent.js +26 -25
- package/lib/ReactDOM.js +3 -3
- package/lib/ReactDOMComponent.js +27 -22
- package/lib/ReactDOMComponentTree.js +3 -3
- package/lib/ReactDOMDebugTool.js +1 -1
- package/lib/ReactDOMEmptyComponent.js +3 -3
- package/lib/ReactDOMInput.js +11 -10
- package/lib/ReactDOMOption.js +5 -4
- package/lib/ReactDOMSelect.js +8 -7
- package/lib/ReactDOMTextComponent.js +4 -3
- package/lib/ReactDOMTextarea.js +10 -9
- package/lib/ReactDOMTreeTraversal.js +5 -5
- package/lib/ReactDOMUnknownPropertyDevtool.js +2 -2
- package/lib/ReactDebugInstanceMap.js +102 -0
- package/lib/ReactDebugTool.js +1 -1
- 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/ReactElementValidator.js +7 -7
- package/lib/ReactEventListener.js +3 -2
- package/lib/ReactFragment.js +4 -4
- package/lib/ReactInstanceHandles.js +6 -6
- package/lib/ReactInvalidSetStateWarningDevTool.js +1 -1
- package/lib/ReactMount.js +15 -14
- package/lib/ReactMultiChild.js +2 -2
- package/lib/ReactNativeComponent.js +4 -3
- package/lib/ReactNodeTypes.js +1 -1
- package/lib/ReactNoopUpdateQueue.js +1 -1
- package/lib/ReactOwner.js +2 -2
- package/lib/ReactPropTransferer.js +4 -3
- package/lib/ReactReconcileTransaction.js +3 -3
- package/lib/ReactServerRendering.js +2 -2
- package/lib/ReactServerRenderingTransaction.js +3 -3
- package/lib/ReactSimpleEmptyComponent.js +3 -3
- package/lib/ReactTestUtils.js +18 -8
- package/lib/ReactTransitionGroup.js +3 -2
- package/lib/ReactUMDEntry.js +26 -0
- package/lib/ReactUpdateQueue.js +23 -6
- package/lib/ReactUpdates.js +10 -9
- package/lib/ReactVersion.js +1 -1
- package/lib/ReactWithAddons.js +0 -7
- package/lib/ReactWithAddonsUMDEntry.js +26 -0
- package/lib/ResponderEventPlugin.js +1 -1
- package/lib/ResponderTouchHistoryStore.js +4 -4
- package/lib/SimpleEventPlugin.js +1 -1
- package/lib/SyntheticEvent.js +7 -6
- package/lib/Transaction.js +2 -2
- package/lib/accumulate.js +1 -1
- package/lib/accumulateInto.js +1 -1
- package/lib/dangerousStyleValue.js +1 -1
- package/lib/deprecated.js +4 -3
- package/lib/findDOMNode.js +3 -3
- package/lib/flattenChildren.js +1 -1
- package/lib/instantiateReactComponent.js +6 -5
- package/lib/onlyChild.js +1 -1
- package/lib/reactComponentExpect.js +4 -3
- package/lib/setInnerHTML.js +1 -0
- package/lib/traverseAllChildren.js +2 -2
- package/lib/update.js +14 -13
- package/lib/validateDOMNesting.js +5 -4
- 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/ReactIsomorphic.js +0 -74
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var React = require('./React');
|
|
15
17
|
var ReactTransitionChildMapping = require('./ReactTransitionChildMapping');
|
|
16
18
|
|
|
17
|
-
var assign = require('./Object.assign');
|
|
18
19
|
var emptyFunction = require('fbjs/lib/emptyFunction');
|
|
19
20
|
|
|
20
21
|
var ReactTransitionGroup = React.createClass({
|
|
@@ -176,7 +177,7 @@ var ReactTransitionGroup = React.createClass({
|
|
|
176
177
|
this.performEnter(key);
|
|
177
178
|
} else {
|
|
178
179
|
this.setState(function (state) {
|
|
179
|
-
var newChildren =
|
|
180
|
+
var newChildren = _assign({}, state.children);
|
|
180
181
|
delete newChildren[key];
|
|
181
182
|
return { children: newChildren };
|
|
182
183
|
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2013-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 ReactUMDEntry
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
16
|
+
var ReactDOM = require('./ReactDOM');
|
|
17
|
+
var ReactDOMServer = require('./ReactDOMServer');
|
|
18
|
+
var React = require('./React');
|
|
19
|
+
|
|
20
|
+
// `version` will be added here by ReactIsomorphic.
|
|
21
|
+
var ReactUMDEntry = _assign({
|
|
22
|
+
__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOM,
|
|
23
|
+
__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOMServer
|
|
24
|
+
}, React);
|
|
25
|
+
|
|
26
|
+
module.exports = ReactUMDEntry;
|
package/lib/ReactUpdateQueue.js
CHANGED
|
@@ -22,6 +22,19 @@ function enqueueUpdate(internalInstance) {
|
|
|
22
22
|
ReactUpdates.enqueueUpdate(internalInstance);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
function formatUnexpectedArgument(arg) {
|
|
26
|
+
var type = typeof arg;
|
|
27
|
+
if (type !== 'object') {
|
|
28
|
+
return type;
|
|
29
|
+
}
|
|
30
|
+
var displayName = arg.constructor && arg.constructor.name || type;
|
|
31
|
+
var keys = Object.keys(arg);
|
|
32
|
+
if (keys.length > 0 && keys.length < 20) {
|
|
33
|
+
return displayName + ' (keys: ' + keys.join(', ') + ')';
|
|
34
|
+
}
|
|
35
|
+
return displayName;
|
|
36
|
+
}
|
|
37
|
+
|
|
25
38
|
function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
|
|
26
39
|
var internalInstance = ReactInstanceMap.get(publicInstance);
|
|
27
40
|
if (!internalInstance) {
|
|
@@ -29,13 +42,13 @@ function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
|
|
|
29
42
|
// Only warn when we have a callerName. Otherwise we should be silent.
|
|
30
43
|
// We're probably calling from enqueueCallback. We don't want to warn
|
|
31
44
|
// there because we already warned for the corresponding lifecycle method.
|
|
32
|
-
process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor.displayName) :
|
|
45
|
+
process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor.displayName) : void 0;
|
|
33
46
|
}
|
|
34
47
|
return null;
|
|
35
48
|
}
|
|
36
49
|
|
|
37
50
|
if (process.env.NODE_ENV !== 'production') {
|
|
38
|
-
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) :
|
|
51
|
+
process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0;
|
|
39
52
|
}
|
|
40
53
|
|
|
41
54
|
return internalInstance;
|
|
@@ -58,7 +71,7 @@ var ReactUpdateQueue = {
|
|
|
58
71
|
if (process.env.NODE_ENV !== 'production') {
|
|
59
72
|
var owner = ReactCurrentOwner.current;
|
|
60
73
|
if (owner !== null) {
|
|
61
|
-
process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') :
|
|
74
|
+
process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
|
|
62
75
|
owner._warnedAboutRefsInRender = true;
|
|
63
76
|
}
|
|
64
77
|
}
|
|
@@ -79,10 +92,11 @@ var ReactUpdateQueue = {
|
|
|
79
92
|
*
|
|
80
93
|
* @param {ReactClass} publicInstance The instance to use as `this` context.
|
|
81
94
|
* @param {?function} callback Called after state is updated.
|
|
95
|
+
* @param {string} callerName Name of the calling function in the public API.
|
|
82
96
|
* @internal
|
|
83
97
|
*/
|
|
84
|
-
enqueueCallback: function (publicInstance, callback) {
|
|
85
|
-
|
|
98
|
+
enqueueCallback: function (publicInstance, callback, callerName) {
|
|
99
|
+
ReactUpdateQueue.validateCallback(callback, callerName);
|
|
86
100
|
var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
|
|
87
101
|
|
|
88
102
|
// Previously we would throw an error if we didn't have an internal
|
|
@@ -107,7 +121,6 @@ var ReactUpdateQueue = {
|
|
|
107
121
|
},
|
|
108
122
|
|
|
109
123
|
enqueueCallbackInternal: function (internalInstance, callback) {
|
|
110
|
-
!(typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback of type ' + '%s. A function is expected', typeof callback === 'object' && Object.keys(callback).length && Object.keys(callback).length < 20 ? typeof callback + ' (keys: ' + Object.keys(callback) + ')' : typeof callback) : invariant(false) : undefined;
|
|
111
124
|
if (internalInstance._pendingCallbacks) {
|
|
112
125
|
internalInstance._pendingCallbacks.push(callback);
|
|
113
126
|
} else {
|
|
@@ -191,6 +204,10 @@ var ReactUpdateQueue = {
|
|
|
191
204
|
enqueueElementInternal: function (internalInstance, newElement) {
|
|
192
205
|
internalInstance._pendingElement = newElement;
|
|
193
206
|
enqueueUpdate(internalInstance);
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
validateCallback: function (callback, callerName) {
|
|
210
|
+
!(!callback || typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : invariant(false) : void 0;
|
|
194
211
|
}
|
|
195
212
|
|
|
196
213
|
};
|
package/lib/ReactUpdates.js
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var CallbackQueue = require('./CallbackQueue');
|
|
15
17
|
var PooledClass = require('./PooledClass');
|
|
16
18
|
var ReactFeatureFlags = require('./ReactFeatureFlags');
|
|
@@ -18,7 +20,6 @@ var ReactPerf = require('./ReactPerf');
|
|
|
18
20
|
var ReactReconciler = require('./ReactReconciler');
|
|
19
21
|
var Transaction = require('./Transaction');
|
|
20
22
|
|
|
21
|
-
var assign = require('./Object.assign');
|
|
22
23
|
var invariant = require('fbjs/lib/invariant');
|
|
23
24
|
|
|
24
25
|
var dirtyComponents = [];
|
|
@@ -28,7 +29,7 @@ var asapEnqueued = false;
|
|
|
28
29
|
var batchingStrategy = null;
|
|
29
30
|
|
|
30
31
|
function ensureInjected() {
|
|
31
|
-
!(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) :
|
|
32
|
+
!(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) : void 0;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
var NESTED_UPDATES = {
|
|
@@ -69,7 +70,7 @@ function ReactUpdatesFlushTransaction() {
|
|
|
69
70
|
/* useCreateElement */true);
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
|
|
73
|
+
_assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
|
|
73
74
|
getTransactionWrappers: function () {
|
|
74
75
|
return TRANSACTION_WRAPPERS;
|
|
75
76
|
},
|
|
@@ -109,7 +110,7 @@ function mountOrderComparator(c1, c2) {
|
|
|
109
110
|
|
|
110
111
|
function runBatchedUpdates(transaction) {
|
|
111
112
|
var len = transaction.dirtyComponentsLength;
|
|
112
|
-
!(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) :
|
|
113
|
+
!(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) : void 0;
|
|
113
114
|
|
|
114
115
|
// Since reconciling a component higher in the owner hierarchy usually (not
|
|
115
116
|
// always -- see shouldComponentUpdate()) will reconcile children, reconcile
|
|
@@ -202,21 +203,21 @@ function enqueueUpdate(component) {
|
|
|
202
203
|
* if no updates are currently being performed.
|
|
203
204
|
*/
|
|
204
205
|
function asap(callback, context) {
|
|
205
|
-
!batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) :
|
|
206
|
+
!batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : void 0;
|
|
206
207
|
asapCallbackQueue.enqueue(callback, context);
|
|
207
208
|
asapEnqueued = true;
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
var ReactUpdatesInjection = {
|
|
211
212
|
injectReconcileTransaction: function (ReconcileTransaction) {
|
|
212
|
-
!ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) :
|
|
213
|
+
!ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) : void 0;
|
|
213
214
|
ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
|
|
214
215
|
},
|
|
215
216
|
|
|
216
217
|
injectBatchingStrategy: function (_batchingStrategy) {
|
|
217
|
-
!_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) :
|
|
218
|
-
!(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) :
|
|
219
|
-
!(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) :
|
|
218
|
+
!_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) : void 0;
|
|
219
|
+
!(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) : void 0;
|
|
220
|
+
!(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) : void 0;
|
|
220
221
|
batchingStrategy = _batchingStrategy;
|
|
221
222
|
}
|
|
222
223
|
};
|
package/lib/ReactVersion.js
CHANGED
package/lib/ReactWithAddons.js
CHANGED
|
@@ -9,13 +9,6 @@
|
|
|
9
9
|
* @providesModule ReactWithAddons
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* This module exists purely in the open source project, and is meant as a way
|
|
14
|
-
* to create a separate standalone build of React. This build has "addons", or
|
|
15
|
-
* functionality we've built and think might be useful but doesn't have a good
|
|
16
|
-
* place to live inside React core.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
12
|
'use strict';
|
|
20
13
|
|
|
21
14
|
var LinkedStateMixin = require('./LinkedStateMixin');
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2013-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 ReactWithAddonsUMDEntry
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
16
|
+
var ReactDOM = require('./ReactDOM');
|
|
17
|
+
var ReactDOMServer = require('./ReactDOMServer');
|
|
18
|
+
var ReactWithAddons = require('./ReactWithAddons');
|
|
19
|
+
|
|
20
|
+
// `version` will be added here by ReactIsomorphic.
|
|
21
|
+
var ReactWithAddonsUMDEntry = _assign({
|
|
22
|
+
__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOM,
|
|
23
|
+
__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOMServer
|
|
24
|
+
}, ReactWithAddons);
|
|
25
|
+
|
|
26
|
+
module.exports = ReactWithAddonsUMDEntry;
|
|
@@ -433,7 +433,7 @@ var ResponderEventPlugin = {
|
|
|
433
433
|
trackedTouchCount += 1;
|
|
434
434
|
} else if (isEndish(topLevelType)) {
|
|
435
435
|
trackedTouchCount -= 1;
|
|
436
|
-
!(trackedTouchCount >= 0) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Ended a touch event which was not counted in trackedTouchCount.') : invariant(false) :
|
|
436
|
+
!(trackedTouchCount >= 0) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Ended a touch event which was not counted in trackedTouchCount.') : invariant(false) : void 0;
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent, nativeEventTarget);
|
|
@@ -88,7 +88,7 @@ var reinitializeTouchTrack = function (touchTrack, touch) {
|
|
|
88
88
|
|
|
89
89
|
var validateTouch = function (touch) {
|
|
90
90
|
var identifier = touch.identifier;
|
|
91
|
-
!(identifier != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch object is missing identifier') : invariant(false) :
|
|
91
|
+
!(identifier != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch object is missing identifier') : invariant(false) : void 0;
|
|
92
92
|
if (identifier > MAX_TOUCH_BANK) {
|
|
93
93
|
console.warn('Touch identifier ' + identifier + ' is greater than maximum ' + 'supported ' + MAX_TOUCH_BANK + ' which causes performance issues ' + 'backfilling array locations for all of the indices.');
|
|
94
94
|
}
|
|
@@ -114,7 +114,7 @@ var recordMoveTouchData = function (touch) {
|
|
|
114
114
|
var touchTrack = touchBank[touch.identifier];
|
|
115
115
|
if (process.env.NODE_ENV !== 'production') {
|
|
116
116
|
validateTouch(touch);
|
|
117
|
-
!touchTrack ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch data should have been recorded on start') : invariant(false) :
|
|
117
|
+
!touchTrack ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch data should have been recorded on start') : invariant(false) : void 0;
|
|
118
118
|
}
|
|
119
119
|
touchTrack.touchActive = true;
|
|
120
120
|
touchTrack.previousPageX = touchTrack.currentPageX;
|
|
@@ -131,7 +131,7 @@ var recordEndTouchData = function (touch) {
|
|
|
131
131
|
var touchTrack = touchBank[touch.identifier];
|
|
132
132
|
if (process.env.NODE_ENV !== 'production') {
|
|
133
133
|
validateTouch(touch);
|
|
134
|
-
!touchTrack ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch data should have been recorded on start') : invariant(false) :
|
|
134
|
+
!touchTrack ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Touch data should have been recorded on start') : invariant(false) : void 0;
|
|
135
135
|
}
|
|
136
136
|
touchTrack.previousPageX = touchTrack.currentPageX;
|
|
137
137
|
touchTrack.previousPageY = touchTrack.currentPageY;
|
|
@@ -168,7 +168,7 @@ var ResponderTouchHistoryStore = {
|
|
|
168
168
|
if (process.env.NODE_ENV !== 'production') {
|
|
169
169
|
var activeTouchData = touchBank[touchHistory.indexOfSingleActiveTouch];
|
|
170
170
|
var foundActive = activeTouchData != null && !!activeTouchData.touchActive;
|
|
171
|
-
!foundActive ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot find single active touch') : invariant(false) :
|
|
171
|
+
!foundActive ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot find single active touch') : invariant(false) : void 0;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
}
|
package/lib/SimpleEventPlugin.js
CHANGED
|
@@ -594,7 +594,7 @@ var SimpleEventPlugin = {
|
|
|
594
594
|
EventConstructor = SyntheticClipboardEvent;
|
|
595
595
|
break;
|
|
596
596
|
}
|
|
597
|
-
!EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) :
|
|
597
|
+
!EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) : void 0;
|
|
598
598
|
var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
|
|
599
599
|
EventPropagators.accumulateTwoPhaseDispatches(event);
|
|
600
600
|
return event;
|
package/lib/SyntheticEvent.js
CHANGED
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
14
16
|
var PooledClass = require('./PooledClass');
|
|
15
17
|
|
|
16
|
-
var assign = require('./Object.assign');
|
|
17
18
|
var emptyFunction = require('fbjs/lib/emptyFunction');
|
|
18
19
|
var warning = require('fbjs/lib/warning');
|
|
19
20
|
|
|
@@ -101,7 +102,7 @@ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarg
|
|
|
101
102
|
return this;
|
|
102
103
|
}
|
|
103
104
|
|
|
104
|
-
|
|
105
|
+
_assign(SyntheticEvent.prototype, {
|
|
105
106
|
|
|
106
107
|
preventDefault: function () {
|
|
107
108
|
this.defaultPrevented = true;
|
|
@@ -186,7 +187,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
186
187
|
return new Proxy(constructor.apply(that, args), {
|
|
187
188
|
set: function (target, prop, value) {
|
|
188
189
|
if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
|
|
189
|
-
process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') :
|
|
190
|
+
process.env.NODE_ENV !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
|
|
190
191
|
didWarnForAddedNewProperty = true;
|
|
191
192
|
}
|
|
192
193
|
target[prop] = value;
|
|
@@ -211,11 +212,11 @@ SyntheticEvent.augmentClass = function (Class, Interface) {
|
|
|
211
212
|
E.prototype = Super.prototype;
|
|
212
213
|
var prototype = new E();
|
|
213
214
|
|
|
214
|
-
|
|
215
|
+
_assign(prototype, Class.prototype);
|
|
215
216
|
Class.prototype = prototype;
|
|
216
217
|
Class.prototype.constructor = Class;
|
|
217
218
|
|
|
218
|
-
Class.Interface =
|
|
219
|
+
Class.Interface = _assign({}, Super.Interface, Interface);
|
|
219
220
|
Class.augmentClass = Super.augmentClass;
|
|
220
221
|
|
|
221
222
|
PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
|
|
@@ -255,6 +256,6 @@ function getPooledWarningPropertyDefinition(propName, getVal) {
|
|
|
255
256
|
|
|
256
257
|
function warn(action, result) {
|
|
257
258
|
var warningCondition = false;
|
|
258
|
-
process.env.NODE_ENV !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) :
|
|
259
|
+
process.env.NODE_ENV !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
|
|
259
260
|
}
|
|
260
261
|
}
|
package/lib/Transaction.js
CHANGED
|
@@ -122,7 +122,7 @@ var Mixin = {
|
|
|
122
122
|
* @return {*} Return value from `method`.
|
|
123
123
|
*/
|
|
124
124
|
perform: function (method, scope, a, b, c, d, e, f) {
|
|
125
|
-
!!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) :
|
|
125
|
+
!!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) : void 0;
|
|
126
126
|
var errorThrown;
|
|
127
127
|
var ret;
|
|
128
128
|
try {
|
|
@@ -186,7 +186,7 @@ var Mixin = {
|
|
|
186
186
|
* invoked).
|
|
187
187
|
*/
|
|
188
188
|
closeAll: function (startIndex) {
|
|
189
|
-
!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) :
|
|
189
|
+
!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) : void 0;
|
|
190
190
|
var transactionWrappers = this.transactionWrappers;
|
|
191
191
|
for (var i = startIndex; i < transactionWrappers.length; i++) {
|
|
192
192
|
var wrapper = transactionWrappers[i];
|
package/lib/accumulate.js
CHANGED
|
@@ -21,7 +21,7 @@ var invariant = require('fbjs/lib/invariant');
|
|
|
21
21
|
* @return {*|array<*>} An accumulation of items.
|
|
22
22
|
*/
|
|
23
23
|
function accumulate(current, next) {
|
|
24
|
-
!(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulate(...): Accumulated items must be not be null or undefined.') : invariant(false) :
|
|
24
|
+
!(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulate(...): Accumulated items must be not be null or undefined.') : invariant(false) : void 0;
|
|
25
25
|
if (current == null) {
|
|
26
26
|
return next;
|
|
27
27
|
} else {
|
package/lib/accumulateInto.js
CHANGED
|
@@ -28,7 +28,7 @@ var invariant = require('fbjs/lib/invariant');
|
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
function accumulateInto(current, next) {
|
|
31
|
-
!(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) :
|
|
31
|
+
!(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) : void 0;
|
|
32
32
|
if (current == null) {
|
|
33
33
|
return next;
|
|
34
34
|
}
|
|
@@ -65,7 +65,7 @@ function dangerousStyleValue(name, value, component) {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
if (!warned) {
|
|
68
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) :
|
|
68
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}
|
package/lib/deprecated.js
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
15
16
|
var warning = require('fbjs/lib/warning');
|
|
16
17
|
|
|
17
18
|
/**
|
|
@@ -34,14 +35,14 @@ function deprecated(fnName, newModule, newPackage, ctx, fn) {
|
|
|
34
35
|
// Require examples in this string must be split to prevent React's
|
|
35
36
|
// build tools from mistaking them for real requires.
|
|
36
37
|
// Otherwise the build tools will attempt to build a '%s' module.
|
|
37
|
-
'React.%s is deprecated. Please use %s.%s from require' + '(\'%s\') ' + 'instead.', fnName, newModule, fnName, newPackage) :
|
|
38
|
+
'React.%s is deprecated. Please use %s.%s from require' + '(\'%s\') ' + 'instead.', fnName, newModule, fnName, newPackage) : void 0;
|
|
38
39
|
/* eslint-enable no-useless-concat */
|
|
39
40
|
warned = true;
|
|
40
41
|
return fn.apply(ctx, arguments);
|
|
41
42
|
};
|
|
42
43
|
// We need to make sure all properties of the original fn are copied over.
|
|
43
44
|
// In particular, this is needed to support PropTypes
|
|
44
|
-
return
|
|
45
|
+
return _assign(newFn, fn);
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
return fn;
|
package/lib/findDOMNode.js
CHANGED
|
@@ -29,7 +29,7 @@ function findDOMNode(componentOrElement) {
|
|
|
29
29
|
if (process.env.NODE_ENV !== 'production') {
|
|
30
30
|
var owner = ReactCurrentOwner.current;
|
|
31
31
|
if (owner !== null) {
|
|
32
|
-
process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') :
|
|
32
|
+
process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : void 0;
|
|
33
33
|
owner._warnedAboutRefsInRender = true;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -47,9 +47,9 @@ function findDOMNode(componentOrElement) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
if (typeof componentOrElement.render === 'function') {
|
|
50
|
-
!false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) :
|
|
50
|
+
!false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : void 0;
|
|
51
51
|
} else {
|
|
52
|
-
!false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) :
|
|
52
|
+
!false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : void 0;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|