react 0.14.7 → 0.15.0-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/LICENSE +1 -1
- package/dist/react-with-addons.js +2937 -3414
- package/dist/react-with-addons.min.js +7 -7
- package/dist/react.js +2762 -3034
- package/dist/react.min.js +7 -7
- package/lib/AutoFocusUtils.js +3 -15
- package/lib/BeforeInputEventPlugin.js +8 -25
- package/lib/CSSProperty.js +3 -1
- package/lib/CSSPropertyOperations.js +20 -6
- package/lib/CallbackQueue.js +12 -1
- package/lib/ChangeEventPlugin.js +58 -54
- package/lib/DOMChildrenOperations.js +21 -60
- package/lib/DOMLazyTree.js +95 -0
- package/lib/{ClientReactRootIndex.js → DOMNamespaces.js} +7 -10
- package/lib/DOMProperty.js +7 -2
- package/lib/DOMPropertyOperations.js +66 -36
- package/lib/Danger.js +6 -7
- package/lib/DefaultEventPluginOrder.js +1 -1
- package/lib/EnterLeaveEventPlugin.js +24 -43
- package/lib/EventConstants.js +2 -1
- package/lib/EventPluginHub.js +15 -59
- package/lib/EventPluginRegistry.js +23 -2
- package/lib/EventPluginUtils.js +60 -35
- package/lib/EventPropagators.js +19 -17
- package/lib/FallbackCompositionState.js +1 -2
- package/lib/HTMLDOMPropertyConfig.js +21 -23
- package/lib/LinkedInput.js +49 -0
- package/lib/LinkedStateMixin.js +1 -2
- package/lib/LinkedValueUtils.js +1 -2
- package/lib/MetaMatchers.js +2 -2
- package/lib/Object.assign.js +1 -1
- package/lib/OrderedMap.js +1 -1
- package/lib/PooledClass.js +1 -1
- package/lib/React.js +1 -13
- package/lib/ReactBrowserEventEmitter.js +3 -23
- package/lib/ReactCSSTransitionGroup.js +1 -2
- package/lib/ReactCSSTransitionGroupChild.js +1 -6
- package/lib/ReactChildReconciler.js +12 -10
- package/lib/ReactChildren.js +3 -3
- package/lib/ReactClass.js +18 -67
- package/lib/ReactComponent.js +2 -5
- package/lib/ReactComponentBrowserEnvironment.js +9 -6
- package/lib/ReactComponentEnvironment.js +3 -3
- package/lib/ReactComponentWithPureRenderMixin.js +2 -2
- package/lib/ReactCompositeComponent.js +94 -29
- package/lib/ReactCurrentOwner.js +1 -1
- package/lib/ReactDOM.js +26 -14
- package/lib/ReactDOMButton.js +2 -2
- package/lib/ReactDOMComponent.js +156 -218
- package/lib/ReactDOMComponentFlags.js +18 -0
- package/lib/ReactDOMComponentTree.js +186 -0
- package/lib/ReactDOMContainerInfo.js +32 -0
- package/lib/ReactDOMDebugTool.js +69 -0
- package/lib/ReactDOMEmptyComponent.js +61 -0
- package/lib/ReactDOMFactories.js +1 -2
- package/lib/ReactDOMFeatureFlags.js +2 -2
- package/lib/ReactDOMIDOperations.js +5 -60
- package/lib/ReactDOMInput.js +52 -23
- package/lib/ReactDOMInstrumentation.js +16 -0
- package/lib/ReactDOMOption.js +9 -8
- package/lib/ReactDOMSVGDeprecatedAttributeDevtool.js +57 -0
- package/lib/ReactDOMSelect.js +35 -14
- package/lib/ReactDOMSelection.js +2 -2
- package/lib/ReactDOMServer.js +1 -1
- package/lib/ReactDOMTextComponent.js +41 -21
- package/lib/ReactDOMTextarea.js +32 -5
- package/lib/ReactDOMTreeTraversal.js +134 -0
- package/lib/ReactDOMUnknownPropertyDevtool.js +64 -0
- package/lib/ReactDefaultBatchingStrategy.js +1 -1
- package/lib/ReactDefaultInjection.js +11 -15
- package/lib/ReactDefaultPerf.js +49 -19
- package/lib/ReactDefaultPerfAnalysis.js +16 -9
- package/lib/ReactElement.js +9 -5
- package/lib/ReactElementValidator.js +1 -1
- package/lib/ReactEmptyComponent.js +8 -29
- package/lib/ReactErrorUtils.js +1 -2
- package/lib/ReactEventEmitterMixin.js +3 -8
- package/lib/ReactEventListener.js +20 -75
- package/lib/ReactFeatureFlags.js +21 -0
- package/lib/ReactFragment.js +2 -2
- package/lib/ReactInjection.js +3 -3
- package/lib/ReactInputSelection.js +3 -3
- package/lib/ReactInstanceHandles.js +4 -6
- package/lib/ReactInstanceMap.js +1 -1
- package/lib/ReactIsomorphic.js +1 -1
- package/lib/ReactLink.js +1 -2
- package/lib/ReactMarkupChecksum.js +1 -1
- package/lib/ReactMount.js +67 -445
- package/lib/ReactMultiChild.js +104 -198
- package/lib/ReactMultiChildUpdateTypes.js +1 -1
- package/lib/ReactNativeComponent.js +1 -1
- package/lib/ReactNodeTypes.js +37 -0
- package/lib/ReactNoopUpdateQueue.js +1 -24
- package/lib/ReactOwner.js +1 -1
- package/lib/ReactPerf.js +1 -2
- package/lib/ReactPropTransferer.js +1 -1
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +1 -1
- package/lib/ReactPropTypes.js +8 -2
- package/lib/ReactReconcileTransaction.js +17 -6
- package/lib/ReactReconciler.js +14 -5
- package/lib/ReactRef.js +1 -1
- package/lib/ReactServerBatchingStrategy.js +1 -2
- package/lib/ReactServerRendering.js +15 -33
- package/lib/ReactServerRenderingTransaction.js +8 -26
- package/lib/ReactSimpleEmptyComponent.js +37 -0
- package/lib/ReactStateSetters.js +1 -1
- package/lib/ReactTestUtils.js +25 -15
- package/lib/ReactTransitionChildMapping.js +1 -2
- package/lib/ReactTransitionEvents.js +1 -1
- package/lib/ReactTransitionGroup.js +1 -1
- package/lib/ReactUpdateQueue.js +4 -4
- package/lib/ReactUpdates.js +19 -2
- package/lib/ReactVersion.js +2 -2
- package/lib/ReactWithAddons.js +1 -3
- package/lib/ResponderEventPlugin.js +53 -65
- package/lib/ResponderSyntheticEvent.js +1 -2
- package/lib/ResponderTouchHistoryStore.js +1 -1
- package/lib/SVGDOMPropertyConfig.js +2 -39
- package/lib/SelectEventPlugin.js +13 -18
- package/lib/SimpleEventPlugin.js +18 -16
- package/lib/SyntheticClipboardEvent.js +1 -2
- package/lib/SyntheticCompositionEvent.js +1 -2
- package/lib/SyntheticDragEvent.js +1 -2
- package/lib/SyntheticEvent.js +10 -7
- package/lib/SyntheticFocusEvent.js +1 -2
- package/lib/SyntheticInputEvent.js +1 -2
- package/lib/SyntheticKeyboardEvent.js +1 -2
- package/lib/SyntheticMouseEvent.js +1 -2
- package/lib/SyntheticTouchEvent.js +1 -2
- package/lib/SyntheticUIEvent.js +1 -2
- package/lib/SyntheticWheelEvent.js +1 -2
- package/lib/TapEventPlugin.js +3 -12
- package/lib/Transaction.js +1 -1
- package/lib/ViewportMetrics.js +1 -1
- package/lib/accumulate.js +1 -1
- package/lib/accumulateInto.js +1 -1
- package/lib/adler32.js +3 -2
- package/lib/canDefineProperty.js +1 -1
- package/lib/createHierarchyRenderer.js +1 -1
- package/lib/dangerousStyleValue.js +25 -3
- package/lib/deprecated.js +1 -1
- package/lib/escapeTextContentForBrowser.js +1 -1
- package/lib/findDOMNode.js +15 -8
- package/lib/flattenChildren.js +1 -1
- package/lib/forEachAccumulated.js +1 -1
- package/lib/getEventCharCode.js +1 -2
- package/lib/getEventKey.js +1 -2
- package/lib/getEventModifierState.js +1 -2
- package/lib/getEventTarget.js +1 -2
- package/lib/getIteratorFn.js +1 -2
- package/lib/getNativeComponentFromComposite.js +30 -0
- package/lib/getNodeForCharacterOffset.js +1 -1
- package/lib/getTestDocument.js +1 -1
- package/lib/getTextContentAccessor.js +1 -1
- package/lib/instantiateReactComponent.js +3 -4
- package/lib/isEventSupported.js +1 -1
- package/lib/isTextInputElement.js +1 -1
- package/lib/onlyChild.js +1 -1
- package/lib/quoteAttributeValueForBrowser.js +1 -1
- package/lib/reactComponentExpect.js +1 -1
- package/lib/renderSubtreeIntoContainer.js +1 -1
- package/lib/setInnerHTML.js +1 -1
- package/lib/setTextContent.js +1 -1
- package/lib/shallowCompare.js +1 -1
- package/lib/shouldUpdateReactComponent.js +1 -3
- package/lib/sliceChildren.js +1 -1
- package/lib/traverseAllChildren.js +6 -6
- package/lib/update.js +1 -1
- package/lib/validateDOMNesting.js +8 -9
- package/package.json +2 -2
- package/lib/ReactBrowserComponentMixin.js +0 -36
- package/lib/ReactEmptyComponentRegistry.js +0 -48
- package/lib/ReactRootIndex.js +0 -29
- package/lib/ServerReactRootIndex.js +0 -29
- package/lib/cloneWithProps.js +0 -54
- package/lib/webcomponents.js +0 -6379
package/lib/isEventSupported.js
CHANGED
package/lib/onlyChild.js
CHANGED
package/lib/setInnerHTML.js
CHANGED
package/lib/setTextContent.js
CHANGED
package/lib/shallowCompare.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule shouldUpdateReactComponent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -37,7 +36,6 @@ function shouldUpdateReactComponent(prevElement, nextElement) {
|
|
|
37
36
|
} else {
|
|
38
37
|
return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
|
|
39
38
|
}
|
|
40
|
-
return false;
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
module.exports = shouldUpdateReactComponent;
|
package/lib/sliceChildren.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -13,13 +13,12 @@
|
|
|
13
13
|
|
|
14
14
|
var ReactCurrentOwner = require('./ReactCurrentOwner');
|
|
15
15
|
var ReactElement = require('./ReactElement');
|
|
16
|
-
var ReactInstanceHandles = require('./ReactInstanceHandles');
|
|
17
16
|
|
|
18
17
|
var getIteratorFn = require('./getIteratorFn');
|
|
19
18
|
var invariant = require('fbjs/lib/invariant');
|
|
20
19
|
var warning = require('fbjs/lib/warning');
|
|
21
20
|
|
|
22
|
-
var SEPARATOR =
|
|
21
|
+
var SEPARATOR = '.';
|
|
23
22
|
var SUBSEPARATOR = ':';
|
|
24
23
|
|
|
25
24
|
/**
|
|
@@ -29,11 +28,10 @@ var SUBSEPARATOR = ':';
|
|
|
29
28
|
|
|
30
29
|
var userProvidedKeyEscaperLookup = {
|
|
31
30
|
'=': '=0',
|
|
32
|
-
'.': '=1',
|
|
33
31
|
':': '=2'
|
|
34
32
|
};
|
|
35
33
|
|
|
36
|
-
var userProvidedKeyEscapeRegex = /[
|
|
34
|
+
var userProvidedKeyEscapeRegex = /[=:]/g;
|
|
37
35
|
|
|
38
36
|
var didWarnAboutMaps = false;
|
|
39
37
|
|
|
@@ -49,7 +47,9 @@ function userProvidedKeyEscaper(match) {
|
|
|
49
47
|
* @return {string}
|
|
50
48
|
*/
|
|
51
49
|
function getComponentKey(component, index) {
|
|
52
|
-
|
|
50
|
+
// Do some typechecking here since we call this blindly. We want to ensure
|
|
51
|
+
// that we don't block potential future ES APIs.
|
|
52
|
+
if (component && typeof component === 'object' && component.key != null) {
|
|
53
53
|
// Explicit key
|
|
54
54
|
return wrapUserProvidedKey(component.key);
|
|
55
55
|
}
|
package/lib/update.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2015, Facebook, Inc.
|
|
2
|
+
* Copyright 2015-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -47,7 +47,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
47
47
|
var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
|
|
48
48
|
|
|
49
49
|
var emptyAncestorInfo = {
|
|
50
|
-
|
|
50
|
+
current: null,
|
|
51
51
|
|
|
52
52
|
formTag: null,
|
|
53
53
|
aTagInScope: null,
|
|
@@ -79,7 +79,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
79
79
|
ancestorInfo.dlItemTagAutoclosing = null;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
ancestorInfo.
|
|
82
|
+
ancestorInfo.current = info;
|
|
83
83
|
|
|
84
84
|
if (tag === 'form') {
|
|
85
85
|
ancestorInfo.formTag = info;
|
|
@@ -152,6 +152,8 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
152
152
|
// https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
|
|
153
153
|
case 'html':
|
|
154
154
|
return tag === 'head' || tag === 'body';
|
|
155
|
+
case '#document':
|
|
156
|
+
return tag === 'html';
|
|
155
157
|
}
|
|
156
158
|
|
|
157
159
|
// Probably in the "in body" parsing mode, so we outlaw only tag combos
|
|
@@ -175,6 +177,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
175
177
|
case 'colgroup':
|
|
176
178
|
case 'frame':
|
|
177
179
|
case 'head':
|
|
180
|
+
case 'html':
|
|
178
181
|
case 'tbody':
|
|
179
182
|
case 'td':
|
|
180
183
|
case 'tfoot':
|
|
@@ -273,9 +276,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
273
276
|
}
|
|
274
277
|
|
|
275
278
|
var stack = [];
|
|
276
|
-
/*eslint-disable space-after-keywords */
|
|
277
279
|
do {
|
|
278
|
-
/*eslint-enable space-after-keywords */
|
|
279
280
|
stack.push(instance);
|
|
280
281
|
} while (instance = instance._currentElement._owner);
|
|
281
282
|
stack.reverse();
|
|
@@ -286,7 +287,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
286
287
|
|
|
287
288
|
validateDOMNesting = function (childTag, childInstance, ancestorInfo) {
|
|
288
289
|
ancestorInfo = ancestorInfo || emptyAncestorInfo;
|
|
289
|
-
var parentInfo = ancestorInfo.
|
|
290
|
+
var parentInfo = ancestorInfo.current;
|
|
290
291
|
var parentTag = parentInfo && parentInfo.tag;
|
|
291
292
|
|
|
292
293
|
var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
|
|
@@ -347,14 +348,12 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
347
348
|
}
|
|
348
349
|
};
|
|
349
350
|
|
|
350
|
-
validateDOMNesting.ancestorInfoContextKey = '__validateDOMNesting_ancestorInfo$' + Math.random().toString(36).slice(2);
|
|
351
|
-
|
|
352
351
|
validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
|
|
353
352
|
|
|
354
353
|
// For testing
|
|
355
354
|
validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
|
|
356
355
|
ancestorInfo = ancestorInfo || emptyAncestorInfo;
|
|
357
|
-
var parentInfo = ancestorInfo.
|
|
356
|
+
var parentInfo = ancestorInfo.current;
|
|
358
357
|
var parentTag = parentInfo && parentInfo.tag;
|
|
359
358
|
return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
|
|
360
359
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react",
|
|
3
3
|
"description": "React is a JavaScript library for building user interfaces.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.15.0-alpha.1",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react"
|
|
7
7
|
],
|
|
8
|
-
"homepage": "https://
|
|
8
|
+
"homepage": "https://github.com/facebook/react/tree/master/npm-react",
|
|
9
9
|
"bugs": "https://github.com/facebook/react/issues",
|
|
10
10
|
"license": "BSD-3-Clause",
|
|
11
11
|
"files": [
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, 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 ReactBrowserComponentMixin
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var ReactInstanceMap = require('./ReactInstanceMap');
|
|
15
|
-
|
|
16
|
-
var findDOMNode = require('./findDOMNode');
|
|
17
|
-
var warning = require('fbjs/lib/warning');
|
|
18
|
-
|
|
19
|
-
var didWarnKey = '_getDOMNodeDidWarn';
|
|
20
|
-
|
|
21
|
-
var ReactBrowserComponentMixin = {
|
|
22
|
-
/**
|
|
23
|
-
* Returns the DOM node rendered by this component.
|
|
24
|
-
*
|
|
25
|
-
* @return {DOMElement} The root node of this component.
|
|
26
|
-
* @final
|
|
27
|
-
* @protected
|
|
28
|
-
*/
|
|
29
|
-
getDOMNode: function () {
|
|
30
|
-
process.env.NODE_ENV !== 'production' ? warning(this.constructor[didWarnKey], '%s.getDOMNode(...) is deprecated. Please use ' + 'ReactDOM.findDOMNode(instance) instead.', ReactInstanceMap.get(this).getName() || this.tagName || 'Unknown') : undefined;
|
|
31
|
-
this.constructor[didWarnKey] = true;
|
|
32
|
-
return findDOMNode(this);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
module.exports = ReactBrowserComponentMixin;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2014-2015, 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 ReactEmptyComponentRegistry
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
// This registry keeps track of the React IDs of the components that rendered to
|
|
15
|
-
// `null` (in reality a placeholder such as `noscript`)
|
|
16
|
-
var nullComponentIDsRegistry = {};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @param {string} id Component's `_rootNodeID`.
|
|
20
|
-
* @return {boolean} True if the component is rendered to null.
|
|
21
|
-
*/
|
|
22
|
-
function isNullComponentID(id) {
|
|
23
|
-
return !!nullComponentIDsRegistry[id];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Mark the component as having rendered to null.
|
|
28
|
-
* @param {string} id Component's `_rootNodeID`.
|
|
29
|
-
*/
|
|
30
|
-
function registerNullComponentID(id) {
|
|
31
|
-
nullComponentIDsRegistry[id] = true;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Unmark the component as having rendered to null: it renders to something now.
|
|
36
|
-
* @param {string} id Component's `_rootNodeID`.
|
|
37
|
-
*/
|
|
38
|
-
function deregisterNullComponentID(id) {
|
|
39
|
-
delete nullComponentIDsRegistry[id];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
var ReactEmptyComponentRegistry = {
|
|
43
|
-
isNullComponentID: isNullComponentID,
|
|
44
|
-
registerNullComponentID: registerNullComponentID,
|
|
45
|
-
deregisterNullComponentID: deregisterNullComponentID
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
module.exports = ReactEmptyComponentRegistry;
|
package/lib/ReactRootIndex.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, 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 ReactRootIndex
|
|
10
|
-
* @typechecks
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
var ReactRootIndexInjection = {
|
|
16
|
-
/**
|
|
17
|
-
* @param {function} _createReactRootIndex
|
|
18
|
-
*/
|
|
19
|
-
injectCreateReactRootIndex: function (_createReactRootIndex) {
|
|
20
|
-
ReactRootIndex.createReactRootIndex = _createReactRootIndex;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
var ReactRootIndex = {
|
|
25
|
-
createReactRootIndex: null,
|
|
26
|
-
injection: ReactRootIndexInjection
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
module.exports = ReactRootIndex;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, 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 ServerReactRootIndex
|
|
10
|
-
* @typechecks
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Size of the reactRoot ID space. We generate random numbers for React root
|
|
17
|
-
* IDs and if there's a collision the events and DOM update system will
|
|
18
|
-
* get confused. In the future we need a way to generate GUIDs but for
|
|
19
|
-
* now this will work on a smaller scale.
|
|
20
|
-
*/
|
|
21
|
-
var GLOBAL_MOUNT_POINT_MAX = Math.pow(2, 53);
|
|
22
|
-
|
|
23
|
-
var ServerReactRootIndex = {
|
|
24
|
-
createReactRootIndex: function () {
|
|
25
|
-
return Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
module.exports = ServerReactRootIndex;
|
package/lib/cloneWithProps.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2015, 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
|
-
* @typechecks static-only
|
|
10
|
-
* @providesModule cloneWithProps
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
var ReactElement = require('./ReactElement');
|
|
16
|
-
var ReactPropTransferer = require('./ReactPropTransferer');
|
|
17
|
-
|
|
18
|
-
var keyOf = require('fbjs/lib/keyOf');
|
|
19
|
-
var warning = require('fbjs/lib/warning');
|
|
20
|
-
|
|
21
|
-
var CHILDREN_PROP = keyOf({ children: null });
|
|
22
|
-
|
|
23
|
-
var didDeprecatedWarn = false;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Sometimes you want to change the props of a child passed to you. Usually
|
|
27
|
-
* this is to add a CSS class.
|
|
28
|
-
*
|
|
29
|
-
* @param {ReactElement} child child element you'd like to clone
|
|
30
|
-
* @param {object} props props you'd like to modify. className and style will be
|
|
31
|
-
* merged automatically.
|
|
32
|
-
* @return {ReactElement} a clone of child with props merged in.
|
|
33
|
-
* @deprecated
|
|
34
|
-
*/
|
|
35
|
-
function cloneWithProps(child, props) {
|
|
36
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
37
|
-
process.env.NODE_ENV !== 'production' ? warning(didDeprecatedWarn, 'cloneWithProps(...) is deprecated. ' + 'Please use React.cloneElement instead.') : undefined;
|
|
38
|
-
didDeprecatedWarn = true;
|
|
39
|
-
process.env.NODE_ENV !== 'production' ? warning(!child.ref, 'You are calling cloneWithProps() on a child with a ref. This is ' + 'dangerous because you\'re creating a new child which will not be ' + 'added as a ref to its parent.') : undefined;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
var newProps = ReactPropTransferer.mergeProps(props, child.props);
|
|
43
|
-
|
|
44
|
-
// Use `child.props.children` if it is provided.
|
|
45
|
-
if (!newProps.hasOwnProperty(CHILDREN_PROP) && child.props.hasOwnProperty(CHILDREN_PROP)) {
|
|
46
|
-
newProps.children = child.props.children;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// The current API doesn't retain _owner, which is why this
|
|
50
|
-
// doesn't use ReactElement.cloneAndReplaceProps.
|
|
51
|
-
return ReactElement.createElement(child.type, newProps);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
module.exports = cloneWithProps;
|