react 0.13.0-beta.1 → 0.13.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/JSXTransformer.js +1919 -1295
- package/dist/react-with-addons.js +1690 -1090
- package/dist/react-with-addons.min.js +7 -6
- package/dist/react.js +1574 -1010
- package/dist/react.min.js +6 -6
- package/lib/AutoFocusMixin.js +1 -1
- package/lib/BeforeInputEventPlugin.js +1 -5
- package/lib/CSSCore.js +1 -1
- package/lib/CSSProperty.js +3 -1
- package/lib/CSSPropertyOperations.js +1 -1
- package/lib/CallbackQueue.js +1 -1
- package/lib/ChangeEventPlugin.js +1 -1
- package/lib/ClientReactRootIndex.js +1 -1
- package/lib/DOMChildrenOperations.js +4 -43
- package/lib/DOMProperty.js +1 -1
- package/lib/DOMPropertyOperations.js +7 -14
- package/lib/Danger.js +1 -1
- package/lib/DefaultEventPluginOrder.js +2 -2
- package/lib/EnterLeaveEventPlugin.js +1 -1
- package/lib/EventConstants.js +1 -1
- package/lib/EventListener.js +1 -1
- package/lib/EventPluginHub.js +1 -1
- package/lib/EventPluginRegistry.js +1 -1
- package/lib/EventPluginUtils.js +3 -3
- package/lib/EventPropagators.js +1 -1
- package/lib/ExecutionEnvironment.js +1 -1
- package/lib/FallbackCompositionState.js +1 -1
- package/lib/HTMLDOMPropertyConfig.js +12 -5
- package/lib/LinkedStateMixin.js +1 -1
- package/lib/LinkedValueUtils.js +1 -1
- package/lib/LocalEventTrapMixin.js +1 -1
- package/lib/MobileSafariClickEventPlugin.js +1 -1
- package/lib/Object.assign.js +1 -1
- package/lib/PooledClass.js +1 -1
- package/lib/React.js +7 -9
- package/lib/ReactBrowserComponentMixin.js +1 -1
- package/lib/ReactBrowserEventEmitter.js +2 -2
- package/lib/ReactCSSTransitionGroup.js +1 -1
- package/lib/ReactCSSTransitionGroupChild.js +8 -5
- package/lib/ReactChildReconciler.js +1 -1
- package/lib/ReactChildren.js +3 -2
- package/lib/ReactClass.js +49 -23
- package/lib/ReactComponent.js +35 -19
- package/lib/ReactComponentBrowserEnvironment.js +1 -1
- package/lib/ReactComponentEnvironment.js +1 -1
- package/lib/ReactComponentWithPureRenderMixin.js +1 -1
- package/lib/ReactCompositeComponent.js +89 -40
- package/lib/ReactContext.js +13 -3
- package/lib/ReactCurrentOwner.js +1 -1
- package/lib/ReactDOM.js +1 -1
- package/lib/ReactDOMButton.js +1 -1
- package/lib/ReactDOMComponent.js +19 -19
- package/lib/ReactDOMForm.js +1 -1
- package/lib/ReactDOMIDOperations.js +3 -3
- package/lib/ReactDOMIframe.js +43 -0
- package/lib/ReactDOMImg.js +1 -1
- package/lib/ReactDOMInput.js +1 -1
- package/lib/ReactDOMOption.js +1 -1
- package/lib/ReactDOMSelect.js +1 -1
- package/lib/ReactDOMSelection.js +1 -1
- package/lib/ReactDOMTextComponent.js +3 -5
- package/lib/ReactDOMTextarea.js +1 -1
- package/lib/ReactDefaultBatchingStrategy.js +1 -1
- package/lib/ReactDefaultInjection.js +25 -1
- package/lib/ReactDefaultPerf.js +5 -10
- package/lib/ReactDefaultPerfAnalysis.js +1 -1
- package/lib/ReactElement.js +56 -2
- package/lib/ReactElementValidator.js +122 -79
- package/lib/ReactEmptyComponent.js +5 -5
- package/lib/ReactErrorUtils.js +1 -1
- package/lib/ReactEventEmitterMixin.js +1 -1
- package/lib/ReactEventListener.js +1 -1
- package/lib/ReactFragment.js +181 -0
- package/lib/ReactInjection.js +1 -1
- package/lib/ReactInputSelection.js +1 -1
- package/lib/ReactInstanceHandles.js +1 -1
- package/lib/ReactInstanceMap.js +1 -1
- package/lib/ReactLifeCycle.js +1 -1
- package/lib/ReactLink.js +1 -1
- package/lib/ReactMarkupChecksum.js +1 -1
- package/lib/ReactMount.js +32 -10
- package/lib/ReactMultiChild.js +1 -1
- package/lib/ReactMultiChildUpdateTypes.js +1 -1
- package/lib/ReactNativeComponent.js +7 -20
- package/lib/ReactOwner.js +1 -1
- package/lib/ReactPerf.js +1 -1
- package/lib/ReactPropTransferer.js +1 -1
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +1 -1
- package/lib/ReactPropTypes.js +7 -4
- package/lib/ReactPutListenerQueue.js +1 -1
- package/lib/ReactReconcileTransaction.js +1 -1
- package/lib/ReactReconciler.js +15 -2
- package/lib/ReactRef.js +2 -3
- package/lib/ReactRootIndex.js +1 -1
- package/lib/ReactServerRendering.js +1 -1
- package/lib/ReactServerRenderingTransaction.js +1 -1
- package/lib/ReactStateSetters.js +1 -1
- package/lib/ReactTestUtils.js +19 -7
- package/lib/ReactTransitionChildMapping.js +7 -3
- package/lib/ReactTransitionEvents.js +1 -1
- package/lib/ReactTransitionGroup.js +5 -5
- package/lib/ReactUpdateQueue.js +63 -32
- package/lib/ReactUpdates.js +7 -2
- package/lib/ReactWithAddons.js +3 -1
- package/lib/SVGDOMPropertyConfig.js +1 -1
- package/lib/SelectEventPlugin.js +1 -1
- package/lib/ServerReactRootIndex.js +1 -1
- package/lib/SimpleEventPlugin.js +3 -3
- package/lib/SyntheticClipboardEvent.js +1 -1
- package/lib/SyntheticCompositionEvent.js +1 -1
- package/lib/SyntheticDragEvent.js +1 -1
- package/lib/SyntheticEvent.js +1 -1
- package/lib/SyntheticFocusEvent.js +1 -1
- package/lib/SyntheticInputEvent.js +1 -1
- package/lib/SyntheticKeyboardEvent.js +1 -1
- package/lib/SyntheticMouseEvent.js +1 -1
- package/lib/SyntheticTouchEvent.js +1 -1
- package/lib/SyntheticUIEvent.js +1 -1
- package/lib/SyntheticWheelEvent.js +1 -1
- package/lib/Transaction.js +2 -2
- package/lib/ViewportMetrics.js +1 -1
- package/lib/accumulateInto.js +1 -1
- package/lib/adler32.js +1 -1
- package/lib/camelize.js +1 -1
- package/lib/camelizeStyleName.js +1 -1
- package/lib/cloneWithProps.js +4 -4
- package/lib/containsNode.js +1 -1
- package/lib/{createArrayFrom.js → createArrayFromMixed.js} +6 -6
- package/lib/createFullPageComponent.js +1 -1
- package/lib/createNodesFromMarkup.js +4 -4
- package/lib/cx.js +16 -1
- package/lib/dangerousStyleValue.js +1 -1
- package/lib/emptyFunction.js +1 -1
- package/lib/emptyObject.js +1 -1
- package/lib/{escapeTextForBrowser.js → escapeTextContentForBrowser.js} +4 -5
- package/lib/findDOMNode.js +19 -1
- package/lib/flattenChildren.js +1 -1
- package/lib/focusNode.js +1 -1
- package/lib/forEachAccumulated.js +1 -1
- package/lib/getActiveElement.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 +1 -1
- package/lib/getMarkupWrap.js +1 -1
- package/lib/getNodeForCharacterOffset.js +1 -1
- package/lib/getReactRootElementInContainer.js +1 -1
- package/lib/getTextContentAccessor.js +1 -1
- package/lib/getUnboundedScrollPosition.js +1 -1
- package/lib/hyphenate.js +1 -1
- package/lib/hyphenateStyleName.js +1 -1
- package/lib/instantiateReactComponent.js +6 -1
- package/lib/invariant.js +1 -1
- package/lib/isEventSupported.js +1 -1
- package/lib/isNode.js +1 -1
- package/lib/isTextInputElement.js +1 -1
- package/lib/isTextNode.js +1 -1
- package/lib/joinClasses.js +1 -1
- package/lib/keyMirror.js +1 -1
- package/lib/keyOf.js +1 -1
- package/lib/mapObject.js +1 -1
- package/lib/memoizeStringOnly.js +1 -1
- package/lib/onlyChild.js +1 -1
- package/lib/performance.js +1 -1
- package/lib/performanceNow.js +1 -1
- package/lib/quoteAttributeValueForBrowser.js +26 -0
- package/lib/setInnerHTML.js +1 -1
- package/lib/setTextContent.js +40 -0
- package/lib/shallowEqual.js +1 -1
- package/lib/shouldUpdateReactComponent.js +32 -10
- package/lib/toArray.js +2 -2
- package/lib/traverseAllChildren.js +18 -4
- package/lib/update.js +1 -1
- package/lib/warning.js +9 -2
- package/package.json +1 -1
- package/lib/copyProperties.js +0 -56
- package/lib/merge.js +0 -34
- package/lib/mergeInto.js +0 -24
- package/lib/monitorCodeUse.js +0 -30
package/lib/accumulateInto.js
CHANGED
package/lib/adler32.js
CHANGED
package/lib/camelize.js
CHANGED
package/lib/camelizeStyleName.js
CHANGED
package/lib/cloneWithProps.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
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
|
-
* @typechecks
|
|
9
|
+
* @typechecks static-only
|
|
10
10
|
* @providesModule cloneWithProps
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -24,10 +24,10 @@ var CHILDREN_PROP = keyOf({children: null});
|
|
|
24
24
|
* Sometimes you want to change the props of a child passed to you. Usually
|
|
25
25
|
* this is to add a CSS class.
|
|
26
26
|
*
|
|
27
|
-
* @param {
|
|
27
|
+
* @param {ReactElement} child child element you'd like to clone
|
|
28
28
|
* @param {object} props props you'd like to modify. className and style will be
|
|
29
29
|
* merged automatically.
|
|
30
|
-
* @return {
|
|
30
|
+
* @return {ReactElement} a clone of child with props merged in.
|
|
31
31
|
*/
|
|
32
32
|
function cloneWithProps(child, props) {
|
|
33
33
|
if ("production" !== process.env.NODE_ENV) {
|
package/lib/containsNode.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
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 createArrayFromMixed
|
|
10
10
|
* @typechecks
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -56,10 +56,10 @@ function hasArrayNature(obj) {
|
|
|
56
56
|
*
|
|
57
57
|
* This is mostly useful idiomatically:
|
|
58
58
|
*
|
|
59
|
-
* var
|
|
59
|
+
* var createArrayFromMixed = require('createArrayFromMixed');
|
|
60
60
|
*
|
|
61
61
|
* function takesOneOrMoreThings(things) {
|
|
62
|
-
* things =
|
|
62
|
+
* things = createArrayFromMixed(things);
|
|
63
63
|
* ...
|
|
64
64
|
* }
|
|
65
65
|
*
|
|
@@ -71,7 +71,7 @@ function hasArrayNature(obj) {
|
|
|
71
71
|
* @param {*} obj
|
|
72
72
|
* @return {array}
|
|
73
73
|
*/
|
|
74
|
-
function
|
|
74
|
+
function createArrayFromMixed(obj) {
|
|
75
75
|
if (!hasArrayNature(obj)) {
|
|
76
76
|
return [obj];
|
|
77
77
|
} else if (Array.isArray(obj)) {
|
|
@@ -81,4 +81,4 @@ function createArrayFrom(obj) {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
module.exports =
|
|
84
|
+
module.exports = createArrayFromMixed;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
var ExecutionEnvironment = require("./ExecutionEnvironment");
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var createArrayFromMixed = require("./createArrayFromMixed");
|
|
18
18
|
var getMarkupWrap = require("./getMarkupWrap");
|
|
19
19
|
var invariant = require("./invariant");
|
|
20
20
|
|
|
@@ -73,10 +73,10 @@ function createNodesFromMarkup(markup, handleScript) {
|
|
|
73
73
|
handleScript,
|
|
74
74
|
'createNodesFromMarkup(...): Unexpected <script> element rendered.'
|
|
75
75
|
) : invariant(handleScript));
|
|
76
|
-
|
|
76
|
+
createArrayFromMixed(scripts).forEach(handleScript);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
var nodes =
|
|
79
|
+
var nodes = createArrayFromMixed(node.childNodes);
|
|
80
80
|
while (node.lastChild) {
|
|
81
81
|
node.removeChild(node.lastChild);
|
|
82
82
|
}
|
package/lib/cx.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -24,7 +24,22 @@
|
|
|
24
24
|
* @param [string ...] Variable list of classNames in the string case.
|
|
25
25
|
* @return string Renderable space-separated CSS className.
|
|
26
26
|
*/
|
|
27
|
+
|
|
28
|
+
'use strict';
|
|
29
|
+
var warning = require("./warning");
|
|
30
|
+
|
|
31
|
+
var warned = false;
|
|
32
|
+
|
|
27
33
|
function cx(classNames) {
|
|
34
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
35
|
+
("production" !== process.env.NODE_ENV ? warning(
|
|
36
|
+
warned,
|
|
37
|
+
'React.addons.classSet will be deprecated in a future version. See ' +
|
|
38
|
+
'http://fb.me/react-addons-classset'
|
|
39
|
+
) : null);
|
|
40
|
+
warned = true;
|
|
41
|
+
}
|
|
42
|
+
|
|
28
43
|
if (typeof classNames == 'object') {
|
|
29
44
|
return Object.keys(classNames).filter(function(className) {
|
|
30
45
|
return classNames[className];
|
package/lib/emptyFunction.js
CHANGED
package/lib/emptyObject.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
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
|
-
* @typechecks static-only
|
|
9
|
+
* @providesModule escapeTextContentForBrowser
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -32,8 +31,8 @@ function escaper(match) {
|
|
|
32
31
|
* @param {*} text Text value to escape.
|
|
33
32
|
* @return {string} An escaped string.
|
|
34
33
|
*/
|
|
35
|
-
function
|
|
34
|
+
function escapeTextContentForBrowser(text) {
|
|
36
35
|
return ('' + text).replace(ESCAPE_REGEX, escaper);
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
module.exports =
|
|
38
|
+
module.exports = escapeTextContentForBrowser;
|
package/lib/findDOMNode.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -11,11 +11,14 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
14
|
+
|
|
15
|
+
var ReactCurrentOwner = require("./ReactCurrentOwner");
|
|
14
16
|
var ReactInstanceMap = require("./ReactInstanceMap");
|
|
15
17
|
var ReactMount = require("./ReactMount");
|
|
16
18
|
|
|
17
19
|
var invariant = require("./invariant");
|
|
18
20
|
var isNode = require("./isNode");
|
|
21
|
+
var warning = require("./warning");
|
|
19
22
|
|
|
20
23
|
/**
|
|
21
24
|
* Returns the DOM node rendered by this element.
|
|
@@ -24,6 +27,21 @@ var isNode = require("./isNode");
|
|
|
24
27
|
* @return {DOMElement} The root node of this element.
|
|
25
28
|
*/
|
|
26
29
|
function findDOMNode(componentOrElement) {
|
|
30
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
31
|
+
var owner = ReactCurrentOwner.current;
|
|
32
|
+
if (owner !== null) {
|
|
33
|
+
("production" !== process.env.NODE_ENV ? warning(
|
|
34
|
+
owner._warnedAboutRefsInRender,
|
|
35
|
+
'%s is accessing getDOMNode or findDOMNode inside its render(). ' +
|
|
36
|
+
'render() should be a pure function of props and state. It should ' +
|
|
37
|
+
'never access something that requires stale data from the previous ' +
|
|
38
|
+
'render, such as refs. Move this logic to componentDidMount and ' +
|
|
39
|
+
'componentDidUpdate instead.',
|
|
40
|
+
owner.getName() || 'A component'
|
|
41
|
+
) : null);
|
|
42
|
+
owner._warnedAboutRefsInRender = true;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
27
45
|
if (componentOrElement == null) {
|
|
28
46
|
return null;
|
|
29
47
|
}
|
package/lib/flattenChildren.js
CHANGED
package/lib/focusNode.js
CHANGED
package/lib/getActiveElement.js
CHANGED
package/lib/getEventCharCode.js
CHANGED
package/lib/getEventKey.js
CHANGED
package/lib/getEventTarget.js
CHANGED
package/lib/getIteratorFn.js
CHANGED
package/lib/getMarkupWrap.js
CHANGED
package/lib/hyphenate.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -114,6 +114,11 @@ function instantiateReactComponent(node, parentCompositeType) {
|
|
|
114
114
|
instance._mountIndex = 0;
|
|
115
115
|
instance._mountImage = null;
|
|
116
116
|
|
|
117
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
118
|
+
instance._isOwnerNecessary = false;
|
|
119
|
+
instance._warnedAboutRefsInRender = false;
|
|
120
|
+
}
|
|
121
|
+
|
|
117
122
|
// Internal instances should fully constructed at this point, so they should
|
|
118
123
|
// not get any new fields added to them at this point.
|
|
119
124
|
if ("production" !== process.env.NODE_ENV) {
|
package/lib/invariant.js
CHANGED
package/lib/isEventSupported.js
CHANGED
package/lib/isNode.js
CHANGED