react 0.12.2 → 0.13.0-beta.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.
Files changed (184) hide show
  1. package/dist/JSXTransformer.js +986 -511
  2. package/dist/react-with-addons.js +6076 -4560
  3. package/dist/react-with-addons.min.js +6 -7
  4. package/dist/react.js +5386 -4170
  5. package/dist/react.min.js +6 -7
  6. package/lib/AutoFocusMixin.js +2 -2
  7. package/lib/BeforeInputEventPlugin.js +388 -115
  8. package/lib/CSSCore.js +1 -1
  9. package/lib/CSSProperty.js +2 -2
  10. package/lib/CSSPropertyOperations.js +58 -11
  11. package/lib/CallbackQueue.js +3 -3
  12. package/lib/ChangeEventPlugin.js +4 -4
  13. package/lib/ClientReactRootIndex.js +2 -2
  14. package/lib/DOMChildrenOperations.js +10 -47
  15. package/lib/DOMProperty.js +2 -2
  16. package/lib/DOMPropertyOperations.js +11 -16
  17. package/lib/Danger.js +8 -7
  18. package/lib/DefaultEventPluginOrder.js +3 -4
  19. package/lib/EnterLeaveEventPlugin.js +2 -2
  20. package/lib/EventConstants.js +2 -2
  21. package/lib/EventListener.js +1 -1
  22. package/lib/EventPluginHub.js +10 -8
  23. package/lib/EventPluginRegistry.js +2 -2
  24. package/lib/EventPluginUtils.js +4 -4
  25. package/lib/EventPropagators.js +2 -2
  26. package/lib/ExecutionEnvironment.js +3 -4
  27. package/lib/FallbackCompositionState.js +89 -0
  28. package/lib/HTMLDOMPropertyConfig.js +23 -10
  29. package/lib/LinkedStateMixin.js +2 -2
  30. package/lib/LinkedValueUtils.js +4 -4
  31. package/lib/LocalEventTrapMixin.js +10 -3
  32. package/lib/MobileSafariClickEventPlugin.js +2 -2
  33. package/lib/Object.assign.js +4 -2
  34. package/lib/PooledClass.js +2 -2
  35. package/lib/React.js +19 -58
  36. package/lib/ReactBrowserComponentMixin.js +4 -14
  37. package/lib/ReactBrowserEventEmitter.js +6 -8
  38. package/lib/ReactCSSTransitionGroup.js +5 -2
  39. package/lib/ReactCSSTransitionGroupChild.js +20 -7
  40. package/lib/ReactChildReconciler.js +125 -0
  41. package/lib/ReactChildren.js +13 -10
  42. package/lib/ReactClass.js +918 -0
  43. package/lib/ReactComponent.js +98 -406
  44. package/lib/ReactComponentBrowserEnvironment.js +11 -84
  45. package/lib/ReactComponentEnvironment.js +57 -0
  46. package/lib/ReactComponentWithPureRenderMixin.js +2 -2
  47. package/lib/ReactCompositeComponent.js +574 -1140
  48. package/lib/ReactContext.js +17 -3
  49. package/lib/ReactCurrentOwner.js +2 -2
  50. package/lib/ReactDOM.js +4 -9
  51. package/lib/ReactDOMButton.js +6 -7
  52. package/lib/ReactDOMComponent.js +123 -105
  53. package/lib/ReactDOMForm.js +6 -7
  54. package/lib/ReactDOMIDOperations.js +59 -77
  55. package/lib/ReactDOMIframe.js +43 -0
  56. package/lib/ReactDOMImg.js +5 -7
  57. package/lib/ReactDOMInput.js +6 -7
  58. package/lib/ReactDOMOption.js +6 -7
  59. package/lib/ReactDOMSelect.js +58 -66
  60. package/lib/ReactDOMSelection.js +7 -3
  61. package/lib/{ReactTextComponent.js → ReactDOMTextComponent.js} +48 -37
  62. package/lib/ReactDOMTextarea.js +6 -7
  63. package/lib/ReactDefaultBatchingStrategy.js +5 -5
  64. package/lib/ReactDefaultInjection.js +39 -9
  65. package/lib/ReactDefaultPerf.js +17 -8
  66. package/lib/ReactDefaultPerfAnalysis.js +2 -2
  67. package/lib/ReactElement.js +23 -15
  68. package/lib/ReactElementValidator.js +206 -89
  69. package/lib/ReactEmptyComponent.js +33 -15
  70. package/lib/ReactErrorUtils.js +1 -1
  71. package/lib/ReactEventEmitterMixin.js +2 -2
  72. package/lib/ReactEventListener.js +4 -5
  73. package/lib/ReactFragment.js +172 -0
  74. package/lib/ReactInjection.js +8 -6
  75. package/lib/ReactInputSelection.js +4 -5
  76. package/lib/ReactInstanceHandles.js +4 -3
  77. package/lib/ReactInstanceMap.js +47 -0
  78. package/lib/ReactLifeCycle.js +35 -0
  79. package/lib/ReactLink.js +2 -2
  80. package/lib/ReactMarkupChecksum.js +2 -2
  81. package/lib/ReactMount.js +264 -71
  82. package/lib/ReactMultiChild.js +50 -48
  83. package/lib/ReactMultiChildUpdateTypes.js +2 -2
  84. package/lib/ReactNativeComponent.js +59 -25
  85. package/lib/ReactOwner.js +5 -49
  86. package/lib/ReactPerf.js +22 -2
  87. package/lib/ReactPropTransferer.js +3 -58
  88. package/lib/ReactPropTypeLocationNames.js +2 -2
  89. package/lib/ReactPropTypeLocations.js +2 -2
  90. package/lib/ReactPropTypes.js +17 -25
  91. package/lib/ReactPutListenerQueue.js +2 -2
  92. package/lib/ReactReconcileTransaction.js +2 -2
  93. package/lib/ReactReconciler.js +121 -0
  94. package/lib/ReactRef.js +69 -0
  95. package/lib/ReactRootIndex.js +2 -2
  96. package/lib/ReactServerRendering.js +6 -4
  97. package/lib/ReactServerRenderingTransaction.js +2 -2
  98. package/lib/ReactStateSetters.js +2 -2
  99. package/lib/ReactTestUtils.js +113 -27
  100. package/lib/ReactTransitionChildMapping.js +8 -4
  101. package/lib/ReactTransitionEvents.js +2 -2
  102. package/lib/ReactTransitionGroup.js +53 -12
  103. package/lib/ReactUpdateQueue.js +295 -0
  104. package/lib/ReactUpdates.js +54 -62
  105. package/lib/ReactWithAddons.js +4 -2
  106. package/lib/SVGDOMPropertyConfig.js +2 -2
  107. package/lib/SelectEventPlugin.js +4 -4
  108. package/lib/ServerReactRootIndex.js +2 -2
  109. package/lib/SimpleEventPlugin.js +4 -4
  110. package/lib/SyntheticClipboardEvent.js +2 -3
  111. package/lib/SyntheticCompositionEvent.js +2 -3
  112. package/lib/SyntheticDragEvent.js +2 -2
  113. package/lib/SyntheticEvent.js +12 -4
  114. package/lib/SyntheticFocusEvent.js +2 -2
  115. package/lib/SyntheticInputEvent.js +2 -3
  116. package/lib/SyntheticKeyboardEvent.js +2 -2
  117. package/lib/SyntheticMouseEvent.js +3 -5
  118. package/lib/SyntheticTouchEvent.js +2 -2
  119. package/lib/SyntheticUIEvent.js +2 -2
  120. package/lib/SyntheticWheelEvent.js +2 -2
  121. package/lib/Transaction.js +4 -4
  122. package/lib/ViewportMetrics.js +3 -6
  123. package/lib/accumulateInto.js +2 -2
  124. package/lib/adler32.js +2 -2
  125. package/lib/camelize.js +1 -1
  126. package/lib/camelizeStyleName.js +1 -1
  127. package/lib/cloneWithProps.js +4 -4
  128. package/lib/containsNode.js +1 -1
  129. package/lib/{createArrayFrom.js → createArrayFromMixed.js} +6 -6
  130. package/lib/createFullPageComponent.js +4 -4
  131. package/lib/createNodesFromMarkup.js +4 -4
  132. package/lib/cx.js +1 -1
  133. package/lib/dangerousStyleValue.js +2 -2
  134. package/lib/emptyFunction.js +1 -1
  135. package/lib/emptyObject.js +1 -1
  136. package/lib/{escapeTextForBrowser.js → escapeTextContentForBrowser.js} +10 -11
  137. package/lib/findDOMNode.js +51 -0
  138. package/lib/flattenChildren.js +12 -23
  139. package/lib/focusNode.js +1 -1
  140. package/lib/forEachAccumulated.js +2 -2
  141. package/lib/getActiveElement.js +1 -1
  142. package/lib/getEventCharCode.js +2 -2
  143. package/lib/getEventKey.js +2 -2
  144. package/lib/getEventModifierState.js +2 -2
  145. package/lib/getEventTarget.js +2 -2
  146. package/lib/getIteratorFn.js +42 -0
  147. package/lib/getMarkupWrap.js +1 -1
  148. package/lib/getNodeForCharacterOffset.js +3 -3
  149. package/lib/getReactRootElementInContainer.js +2 -2
  150. package/lib/getTextContentAccessor.js +2 -2
  151. package/lib/getUnboundedScrollPosition.js +1 -1
  152. package/lib/hyphenate.js +1 -1
  153. package/lib/hyphenateStyleName.js +1 -1
  154. package/lib/instantiateReactComponent.js +90 -68
  155. package/lib/invariant.js +1 -1
  156. package/lib/isEventSupported.js +2 -2
  157. package/lib/isNode.js +4 -5
  158. package/lib/isTextInputElement.js +3 -4
  159. package/lib/isTextNode.js +1 -1
  160. package/lib/joinClasses.js +2 -2
  161. package/lib/keyMirror.js +2 -2
  162. package/lib/keyOf.js +1 -1
  163. package/lib/mapObject.js +1 -1
  164. package/lib/memoizeStringOnly.js +5 -6
  165. package/lib/onlyChild.js +2 -2
  166. package/lib/performance.js +1 -1
  167. package/lib/performanceNow.js +1 -1
  168. package/lib/quoteAttributeValueForBrowser.js +26 -0
  169. package/lib/setInnerHTML.js +13 -2
  170. package/lib/setTextContent.js +40 -0
  171. package/lib/shallowEqual.js +2 -2
  172. package/lib/shouldUpdateReactComponent.js +71 -7
  173. package/lib/toArray.js +2 -2
  174. package/lib/traverseAllChildren.js +114 -56
  175. package/lib/update.js +2 -2
  176. package/lib/warning.js +20 -2
  177. package/package.json +1 -1
  178. package/lib/CompositionEventPlugin.js +0 -257
  179. package/lib/ReactLegacyElement.js +0 -243
  180. package/lib/copyProperties.js +0 -54
  181. package/lib/deprecated.js +0 -47
  182. package/lib/merge.js +0 -34
  183. package/lib/mergeInto.js +0 -24
  184. package/lib/monitorCodeUse.js +0 -30
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
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
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactDOMSelection
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var ExecutionEnvironment = require("./ExecutionEnvironment");
15
15
 
@@ -189,7 +189,11 @@ function setModernOffsets(node, offsets) {
189
189
  }
190
190
  }
191
191
 
192
- var useIEOffsets = ExecutionEnvironment.canUseDOM && document.selection;
192
+ var useIEOffsets = (
193
+ ExecutionEnvironment.canUseDOM &&
194
+ 'selection' in document &&
195
+ !('getSelection' in window)
196
+ );
193
197
 
194
198
  var ReactDOMSelection = {
195
199
  /**
@@ -1,23 +1,24 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
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 ReactTextComponent
9
+ * @providesModule ReactDOMTextComponent
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var DOMPropertyOperations = require("./DOMPropertyOperations");
16
- var ReactComponent = require("./ReactComponent");
17
- var ReactElement = require("./ReactElement");
16
+ var ReactComponentBrowserEnvironment =
17
+ require("./ReactComponentBrowserEnvironment");
18
+ var ReactDOMComponent = require("./ReactDOMComponent");
18
19
 
19
20
  var assign = require("./Object.assign");
20
- var escapeTextForBrowser = require("./escapeTextForBrowser");
21
+ var escapeTextContentForBrowser = require("./escapeTextContentForBrowser");
21
22
 
22
23
  /**
23
24
  * Text nodes violate a couple assumptions that React makes about components:
@@ -30,15 +31,29 @@ var escapeTextForBrowser = require("./escapeTextForBrowser");
30
31
  *
31
32
  * TODO: Investigate representing React components in the DOM with text nodes.
32
33
  *
33
- * @class ReactTextComponent
34
+ * @class ReactDOMTextComponent
34
35
  * @extends ReactComponent
35
36
  * @internal
36
37
  */
37
- var ReactTextComponent = function(props) {
38
- // This constructor and it's argument is currently used by mocks.
38
+ var ReactDOMTextComponent = function(props) {
39
+ // This constructor and its argument is currently used by mocks.
39
40
  };
40
41
 
41
- assign(ReactTextComponent.prototype, ReactComponent.Mixin, {
42
+ assign(ReactDOMTextComponent.prototype, {
43
+
44
+ /**
45
+ * @param {ReactText} text
46
+ * @internal
47
+ */
48
+ construct: function(text) {
49
+ // TODO: This is really a ReactText (ReactNode), not a ReactElement
50
+ this._currentElement = text;
51
+ this._stringText = '' + text;
52
+
53
+ // Properties
54
+ this._rootNodeID = null;
55
+ this._mountIndex = 0;
56
+ },
42
57
 
43
58
  /**
44
59
  * Creates the markup for this text node. This node is not intended to have
@@ -46,19 +61,12 @@ assign(ReactTextComponent.prototype, ReactComponent.Mixin, {
46
61
  *
47
62
  * @param {string} rootID DOM ID of the root node.
48
63
  * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
49
- * @param {number} mountDepth number of components in the owner hierarchy
50
64
  * @return {string} Markup for this text node.
51
65
  * @internal
52
66
  */
53
- mountComponent: function(rootID, transaction, mountDepth) {
54
- ReactComponent.Mixin.mountComponent.call(
55
- this,
56
- rootID,
57
- transaction,
58
- mountDepth
59
- );
60
-
61
- var escapedText = escapeTextForBrowser(this.props);
67
+ mountComponent: function(rootID, transaction, context) {
68
+ this._rootNodeID = rootID;
69
+ var escapedText = escapeTextContentForBrowser(this._stringText);
62
70
 
63
71
  if (transaction.renderToStaticMarkup) {
64
72
  // Normally we'd wrap this in a `span` for the reasons stated above, but
@@ -77,28 +85,31 @@ assign(ReactTextComponent.prototype, ReactComponent.Mixin, {
77
85
  /**
78
86
  * Updates this component by updating the text content.
79
87
  *
80
- * @param {object} nextComponent Contains the next text content.
88
+ * @param {ReactText} nextText The next text content
81
89
  * @param {ReactReconcileTransaction} transaction
82
90
  * @internal
83
91
  */
84
- receiveComponent: function(nextComponent, transaction) {
85
- var nextProps = nextComponent.props;
86
- if (nextProps !== this.props) {
87
- this.props = nextProps;
88
- ReactComponent.BackendIDOperations.updateTextContentByID(
89
- this._rootNodeID,
90
- nextProps
91
- );
92
+ receiveComponent: function(nextText, transaction) {
93
+ if (nextText !== this._currentElement) {
94
+ this._currentElement = nextText;
95
+ var nextStringText = '' + nextText;
96
+ if (nextStringText !== this._stringText) {
97
+ // TODO: Save this as pending props and use performUpdateIfNecessary
98
+ // and/or updateComponent to do the actual update for consistency with
99
+ // other component types?
100
+ this._stringText = nextStringText;
101
+ ReactDOMComponent.BackendIDOperations.updateTextContentByID(
102
+ this._rootNodeID,
103
+ nextStringText
104
+ );
105
+ }
92
106
  }
107
+ },
108
+
109
+ unmountComponent: function() {
110
+ ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
93
111
  }
94
112
 
95
113
  });
96
114
 
97
- var ReactTextComponentFactory = function(text) {
98
- // Bypass validation and configuration
99
- return new ReactElement(ReactTextComponent, null, null, null, null, text);
100
- };
101
-
102
- ReactTextComponentFactory.type = ReactTextComponent;
103
-
104
- module.exports = ReactTextComponentFactory;
115
+ module.exports = ReactDOMTextComponent;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
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
@@ -9,15 +9,14 @@
9
9
  * @providesModule ReactDOMTextarea
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var AutoFocusMixin = require("./AutoFocusMixin");
15
15
  var DOMPropertyOperations = require("./DOMPropertyOperations");
16
16
  var LinkedValueUtils = require("./LinkedValueUtils");
17
17
  var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
18
- var ReactCompositeComponent = require("./ReactCompositeComponent");
18
+ var ReactClass = require("./ReactClass");
19
19
  var ReactElement = require("./ReactElement");
20
- var ReactDOM = require("./ReactDOM");
21
20
  var ReactUpdates = require("./ReactUpdates");
22
21
 
23
22
  var assign = require("./Object.assign");
@@ -25,8 +24,7 @@ var invariant = require("./invariant");
25
24
 
26
25
  var warning = require("./warning");
27
26
 
28
- // Store a reference to the <textarea> `ReactDOMComponent`. TODO: use string
29
- var textarea = ReactElement.createFactory(ReactDOM.textarea.type);
27
+ var textarea = ReactElement.createFactory('textarea');
30
28
 
31
29
  function forceUpdateIfMounted() {
32
30
  /*jshint validthis:true */
@@ -50,8 +48,9 @@ function forceUpdateIfMounted() {
50
48
  * The rendered element will be initialized with an empty value, the prop
51
49
  * `defaultValue` if specified, or the children content (deprecated).
52
50
  */
53
- var ReactDOMTextarea = ReactCompositeComponent.createClass({
51
+ var ReactDOMTextarea = ReactClass.createClass({
54
52
  displayName: 'ReactDOMTextarea',
53
+ tagName: 'TEXTAREA',
55
54
 
56
55
  mixins: [AutoFocusMixin, LinkedValueUtils.Mixin, ReactBrowserComponentMixin],
57
56
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
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
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactDefaultBatchingStrategy
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var ReactUpdates = require("./ReactUpdates");
15
15
  var Transaction = require("./Transaction");
@@ -54,16 +54,16 @@ var ReactDefaultBatchingStrategy = {
54
54
  * Call the provided function in a context within which calls to `setState`
55
55
  * and friends are batched such that components aren't updated unnecessarily.
56
56
  */
57
- batchedUpdates: function(callback, a, b) {
57
+ batchedUpdates: function(callback, a, b, c, d) {
58
58
  var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
59
59
 
60
60
  ReactDefaultBatchingStrategy.isBatchingUpdates = true;
61
61
 
62
62
  // The code is written this way to avoid extra allocations
63
63
  if (alreadyBatchingUpdates) {
64
- callback(a, b);
64
+ callback(a, b, c, d);
65
65
  } else {
66
- transaction.perform(callback, null, a, b);
66
+ transaction.perform(callback, null, a, b, c, d);
67
67
  }
68
68
  }
69
69
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
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
@@ -9,18 +9,18 @@
9
9
  * @providesModule ReactDefaultInjection
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var BeforeInputEventPlugin = require("./BeforeInputEventPlugin");
15
15
  var ChangeEventPlugin = require("./ChangeEventPlugin");
16
16
  var ClientReactRootIndex = require("./ClientReactRootIndex");
17
- var CompositionEventPlugin = require("./CompositionEventPlugin");
18
17
  var DefaultEventPluginOrder = require("./DefaultEventPluginOrder");
19
18
  var EnterLeaveEventPlugin = require("./EnterLeaveEventPlugin");
20
19
  var ExecutionEnvironment = require("./ExecutionEnvironment");
21
20
  var HTMLDOMPropertyConfig = require("./HTMLDOMPropertyConfig");
22
21
  var MobileSafariClickEventPlugin = require("./MobileSafariClickEventPlugin");
23
22
  var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
23
+ var ReactClass = require("./ReactClass");
24
24
  var ReactComponentBrowserEnvironment =
25
25
  require("./ReactComponentBrowserEnvironment");
26
26
  var ReactDefaultBatchingStrategy = require("./ReactDefaultBatchingStrategy");
@@ -28,14 +28,19 @@ var ReactDOMComponent = require("./ReactDOMComponent");
28
28
  var ReactDOMButton = require("./ReactDOMButton");
29
29
  var ReactDOMForm = require("./ReactDOMForm");
30
30
  var ReactDOMImg = require("./ReactDOMImg");
31
+ var ReactDOMIDOperations = require("./ReactDOMIDOperations");
32
+ var ReactDOMIframe = require("./ReactDOMIframe");
31
33
  var ReactDOMInput = require("./ReactDOMInput");
32
34
  var ReactDOMOption = require("./ReactDOMOption");
33
35
  var ReactDOMSelect = require("./ReactDOMSelect");
34
36
  var ReactDOMTextarea = require("./ReactDOMTextarea");
37
+ var ReactDOMTextComponent = require("./ReactDOMTextComponent");
38
+ var ReactElement = require("./ReactElement");
35
39
  var ReactEventListener = require("./ReactEventListener");
36
40
  var ReactInjection = require("./ReactInjection");
37
41
  var ReactInstanceHandles = require("./ReactInstanceHandles");
38
42
  var ReactMount = require("./ReactMount");
43
+ var ReactReconcileTransaction = require("./ReactReconcileTransaction");
39
44
  var SelectEventPlugin = require("./SelectEventPlugin");
40
45
  var ServerReactRootIndex = require("./ServerReactRootIndex");
41
46
  var SimpleEventPlugin = require("./SimpleEventPlugin");
@@ -43,6 +48,22 @@ var SVGDOMPropertyConfig = require("./SVGDOMPropertyConfig");
43
48
 
44
49
  var createFullPageComponent = require("./createFullPageComponent");
45
50
 
51
+ function autoGenerateWrapperClass(type) {
52
+ return ReactClass.createClass({
53
+ tagName: type.toUpperCase(),
54
+ render: function() {
55
+ return new ReactElement(
56
+ type,
57
+ null,
58
+ null,
59
+ null,
60
+ null,
61
+ this.props
62
+ );
63
+ }
64
+ });
65
+ }
66
+
46
67
  function inject() {
47
68
  ReactInjection.EventEmitter.injectReactEventListener(
48
69
  ReactEventListener
@@ -63,7 +84,6 @@ function inject() {
63
84
  SimpleEventPlugin: SimpleEventPlugin,
64
85
  EnterLeaveEventPlugin: EnterLeaveEventPlugin,
65
86
  ChangeEventPlugin: ChangeEventPlugin,
66
- CompositionEventPlugin: CompositionEventPlugin,
67
87
  MobileSafariClickEventPlugin: MobileSafariClickEventPlugin,
68
88
  SelectEventPlugin: SelectEventPlugin,
69
89
  BeforeInputEventPlugin: BeforeInputEventPlugin
@@ -73,9 +93,22 @@ function inject() {
73
93
  ReactDOMComponent
74
94
  );
75
95
 
96
+ ReactInjection.NativeComponent.injectTextComponentClass(
97
+ ReactDOMTextComponent
98
+ );
99
+
100
+ ReactInjection.NativeComponent.injectAutoWrapper(
101
+ autoGenerateWrapperClass
102
+ );
103
+
104
+ // This needs to happen before createFullPageComponent() otherwise the mixin
105
+ // won't be included.
106
+ ReactInjection.Class.injectMixin(ReactBrowserComponentMixin);
107
+
76
108
  ReactInjection.NativeComponent.injectComponentClasses({
77
109
  'button': ReactDOMButton,
78
110
  'form': ReactDOMForm,
111
+ 'iframe': ReactDOMIframe,
79
112
  'img': ReactDOMImg,
80
113
  'input': ReactDOMInput,
81
114
  'option': ReactDOMOption,
@@ -87,17 +120,13 @@ function inject() {
87
120
  'body': createFullPageComponent('body')
88
121
  });
89
122
 
90
- // This needs to happen after createFullPageComponent() otherwise the mixin
91
- // gets double injected.
92
- ReactInjection.CompositeComponent.injectMixin(ReactBrowserComponentMixin);
93
-
94
123
  ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
95
124
  ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
96
125
 
97
126
  ReactInjection.EmptyComponent.injectEmptyComponent('noscript');
98
127
 
99
128
  ReactInjection.Updates.injectReconcileTransaction(
100
- ReactComponentBrowserEnvironment.ReactReconcileTransaction
129
+ ReactReconcileTransaction
101
130
  );
102
131
  ReactInjection.Updates.injectBatchingStrategy(
103
132
  ReactDefaultBatchingStrategy
@@ -110,6 +139,7 @@ function inject() {
110
139
  );
111
140
 
112
141
  ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
142
+ ReactInjection.DOMComponent.injectIDOperations(ReactDOMIDOperations);
113
143
 
114
144
  if ("production" !== process.env.NODE_ENV) {
115
145
  var url = (ExecutionEnvironment.canUseDOM && window.location.href) || '';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
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
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var DOMProperty = require("./DOMProperty");
16
16
  var ReactDefaultPerfAnalysis = require("./ReactDefaultPerfAnalysis");
@@ -169,7 +169,7 @@ var ReactDefaultPerf = {
169
169
  rv = func.apply(this, args);
170
170
  totalTime = performanceNow() - start;
171
171
 
172
- if (fnName === 'mountImageIntoNode') {
172
+ if (fnName === '_mountImageIntoNode') {
173
173
  var mountID = ReactMount.getID(args[1]);
174
174
  ReactDefaultPerf._recordWrite(mountID, fnName, totalTime, args[0]);
175
175
  } else if (fnName === 'dangerouslyProcessChildrenUpdates') {
@@ -206,9 +206,9 @@ var ReactDefaultPerf = {
206
206
  }
207
207
  return rv;
208
208
  } else if (moduleName === 'ReactCompositeComponent' && (
209
- fnName === 'mountComponent' ||
210
- fnName === 'updateComponent' || // TODO: receiveComponent()?
211
- fnName === '_renderValidatedComponent')) {
209
+ (// TODO: receiveComponent()?
210
+ (fnName === 'mountComponent' ||
211
+ fnName === 'updateComponent' || fnName === '_renderValidatedComponent')))) {
212
212
 
213
213
  var rootNodeID = fnName === 'mountComponent' ?
214
214
  args[0] :
@@ -242,9 +242,18 @@ var ReactDefaultPerf = {
242
242
  addValue(entry.inclusive, rootNodeID, totalTime);
243
243
  }
244
244
 
245
+ var displayName = null;
246
+ if (this._instance.constructor.displayName) {
247
+ displayName = this._instance.constructor.displayName;
248
+ } else if (this._currentElement.type) {
249
+ displayName = this._currentElement.type;
250
+ }
251
+
245
252
  entry.displayNames[rootNodeID] = {
246
- current: this.constructor.displayName,
247
- owner: this._owner ? this._owner.constructor.displayName : '<root>'
253
+ current: displayName,
254
+ owner: this._currentElement._owner ?
255
+ this._currentElement._owner._instance.constructor.displayName :
256
+ '<root>'
248
257
  };
249
258
 
250
259
  return rv;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
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 @@ var assign = require("./Object.assign");
14
14
  // Don't try to save users less than 1.2ms (a number I made up)
15
15
  var DONT_CARE_THRESHOLD = 1.2;
16
16
  var DOM_OPERATION_TYPES = {
17
- 'mountImageIntoNode': 'set innerHTML',
17
+ '_mountImageIntoNode': 'set innerHTML',
18
18
  INSERT_MARKUP: 'set innerHTML',
19
19
  MOVE_EXISTING: 'move',
20
20
  REMOVE_NODE: 'remove',
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2014, Facebook, Inc.
2
+ * Copyright 2014-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
@@ -9,11 +9,12 @@
9
9
  * @providesModule ReactElement
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var ReactContext = require("./ReactContext");
15
15
  var ReactCurrentOwner = require("./ReactCurrentOwner");
16
16
 
17
+ var assign = require("./Object.assign");
17
18
  var warning = require("./warning");
18
19
 
19
20
  var RESERVED_PROPS = {
@@ -44,8 +45,9 @@ function defineWarningProperty(object, key) {
44
45
  set: function(value) {
45
46
  ("production" !== process.env.NODE_ENV ? warning(
46
47
  false,
47
- 'Don\'t set the ' + key + ' property of the component. ' +
48
- 'Mutate the existing props object instead.'
48
+ 'Don\'t set the %s property of the React element. Instead, ' +
49
+ 'specify the correct value when initially creating the element.',
50
+ key
49
51
  ) : null);
50
52
  this._store[key] = value;
51
53
  }
@@ -106,7 +108,21 @@ var ReactElement = function(type, key, ref, owner, context, props) {
106
108
  // an external backing store so that we can freeze the whole object.
107
109
  // This can be replaced with a WeakMap once they are implemented in
108
110
  // commonly used development environments.
109
- this._store = { validated: false, props: props };
111
+ this._store = { props: props, originalProps: assign({}, props) };
112
+
113
+ // To make comparing ReactElements easier for testing purposes, we make
114
+ // the validation flag non-enumerable (where possible, which should
115
+ // include every environment we run tests in), so the test framework
116
+ // ignores it.
117
+ try {
118
+ Object.defineProperty(this._store, 'validated', {
119
+ configurable: false,
120
+ enumerable: false,
121
+ writable: true
122
+ });
123
+ } catch (x) {
124
+ }
125
+ this._store.validated = false;
110
126
 
111
127
  // We're not allowed to set props directly on the object so we early
112
128
  // return and rely on the prototype membrane to forward to the backing
@@ -141,16 +157,7 @@ ReactElement.createElement = function(type, config, children) {
141
157
 
142
158
  if (config != null) {
143
159
  ref = config.ref === undefined ? null : config.ref;
144
- if ("production" !== process.env.NODE_ENV) {
145
- ("production" !== process.env.NODE_ENV ? warning(
146
- config.key !== null,
147
- 'createElement(...): Encountered component with a `key` of null. In ' +
148
- 'a future version, this will be treated as equivalent to the string ' +
149
- '\'null\'; instead, provide an explicit key or use undefined.'
150
- ) : null);
151
- }
152
- // TODO: Change this back to `config.key === undefined`
153
- key = config.key == null ? null : '' + config.key;
160
+ key = config.key === undefined ? null : '' + config.key;
154
161
  // Remaining properties are added to a new props object
155
162
  for (propName in config) {
156
163
  if (config.hasOwnProperty(propName) &&
@@ -199,6 +206,7 @@ ReactElement.createFactory = function(type) {
199
206
  // easily accessed on elements. E.g. <Foo />.type === Foo.type.
200
207
  // This should not be named `constructor` since this may not be the function
201
208
  // that created the element, and it may not even be a constructor.
209
+ // Legacy hook TODO: Warn if this is accessed
202
210
  factory.type = type;
203
211
  return factory;
204
212
  };