react 0.13.0-alpha.1 → 0.13.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/JSXTransformer.js +452 -360
  2. package/dist/react-with-addons.js +1407 -1021
  3. package/dist/react-with-addons.min.js +5 -6
  4. package/dist/react.js +1317 -933
  5. package/dist/react.min.js +5 -6
  6. package/lib/AutoFocusMixin.js +1 -1
  7. package/lib/BeforeInputEventPlugin.js +4 -4
  8. package/lib/CSSProperty.js +1 -1
  9. package/lib/CSSPropertyOperations.js +1 -1
  10. package/lib/CallbackQueue.js +2 -2
  11. package/lib/ChangeEventPlugin.js +1 -1
  12. package/lib/ClientReactRootIndex.js +1 -1
  13. package/lib/DOMChildrenOperations.js +6 -4
  14. package/lib/DOMProperty.js +1 -1
  15. package/lib/DOMPropertyOperations.js +1 -1
  16. package/lib/Danger.js +6 -5
  17. package/lib/DefaultEventPluginOrder.js +1 -1
  18. package/lib/EnterLeaveEventPlugin.js +1 -1
  19. package/lib/EventConstants.js +1 -1
  20. package/lib/EventPluginHub.js +9 -7
  21. package/lib/EventPluginRegistry.js +1 -1
  22. package/lib/EventPluginUtils.js +1 -1
  23. package/lib/EventPropagators.js +1 -1
  24. package/lib/FallbackCompositionState.js +6 -4
  25. package/lib/HTMLDOMPropertyConfig.js +12 -7
  26. package/lib/LinkedStateMixin.js +1 -1
  27. package/lib/LinkedValueUtils.js +3 -3
  28. package/lib/LocalEventTrapMixin.js +1 -1
  29. package/lib/MobileSafariClickEventPlugin.js +1 -1
  30. package/lib/Object.assign.js +1 -1
  31. package/lib/PooledClass.js +1 -1
  32. package/lib/React.js +4 -2
  33. package/lib/ReactBrowserComponentMixin.js +1 -1
  34. package/lib/ReactBrowserEventEmitter.js +2 -2
  35. package/lib/ReactCSSTransitionGroup.js +1 -1
  36. package/lib/ReactCSSTransitionGroupChild.js +4 -2
  37. package/lib/ReactChildReconciler.js +2 -2
  38. package/lib/ReactChildren.js +10 -8
  39. package/lib/ReactClass.js +30 -72
  40. package/lib/ReactComponent.js +10 -1
  41. package/lib/ReactComponentBase.js +126 -0
  42. package/lib/ReactComponentBrowserEnvironment.js +1 -1
  43. package/lib/ReactComponentEnvironment.js +2 -2
  44. package/lib/ReactComponentWithPureRenderMixin.js +1 -1
  45. package/lib/ReactCompositeComponent.js +90 -17
  46. package/lib/ReactContext.js +1 -1
  47. package/lib/ReactCurrentOwner.js +1 -1
  48. package/lib/ReactDOM.js +1 -1
  49. package/lib/ReactDOMButton.js +1 -1
  50. package/lib/ReactDOMComponent.js +23 -8
  51. package/lib/ReactDOMForm.js +1 -1
  52. package/lib/ReactDOMIDOperations.js +1 -1
  53. package/lib/ReactDOMImg.js +1 -1
  54. package/lib/ReactDOMInput.js +1 -1
  55. package/lib/ReactDOMOption.js +1 -1
  56. package/lib/ReactDOMSelect.js +2 -2
  57. package/lib/ReactDOMSelection.js +1 -1
  58. package/lib/ReactDOMTextComponent.js +1 -1
  59. package/lib/ReactDOMTextarea.js +1 -1
  60. package/lib/ReactDefaultBatchingStrategy.js +1 -1
  61. package/lib/ReactDefaultInjection.js +1 -1
  62. package/lib/ReactDefaultPerf.js +1 -1
  63. package/lib/ReactElement.js +5 -4
  64. package/lib/ReactElementValidator.js +91 -1
  65. package/lib/ReactEmptyComponent.js +12 -1
  66. package/lib/ReactEventEmitterMixin.js +1 -1
  67. package/lib/ReactEventListener.js +3 -3
  68. package/lib/ReactInjection.js +1 -1
  69. package/lib/ReactInputSelection.js +1 -1
  70. package/lib/ReactInstanceHandles.js +3 -2
  71. package/lib/ReactInstanceMap.js +1 -1
  72. package/lib/ReactLink.js +1 -1
  73. package/lib/ReactMarkupChecksum.js +1 -1
  74. package/lib/ReactMount.js +10 -3
  75. package/lib/ReactMultiChild.js +12 -3
  76. package/lib/ReactMultiChildUpdateTypes.js +1 -1
  77. package/lib/ReactNativeComponent.js +1 -1
  78. package/lib/ReactOwner.js +1 -1
  79. package/lib/ReactPerf.js +1 -1
  80. package/lib/ReactPropTransferer.js +2 -2
  81. package/lib/ReactPropTypeLocationNames.js +1 -1
  82. package/lib/ReactPropTypeLocations.js +1 -1
  83. package/lib/ReactPropTypes.js +13 -5
  84. package/lib/ReactPutListenerQueue.js +1 -1
  85. package/lib/ReactReconcileTransaction.js +1 -1
  86. package/lib/ReactRef.js +1 -1
  87. package/lib/ReactRootIndex.js +1 -1
  88. package/lib/ReactServerRendering.js +3 -2
  89. package/lib/ReactServerRenderingTransaction.js +1 -1
  90. package/lib/ReactStateSetters.js +1 -1
  91. package/lib/ReactTestUtils.js +1 -1
  92. package/lib/ReactTransitionChildMapping.js +1 -1
  93. package/lib/ReactTransitionEvents.js +1 -1
  94. package/lib/ReactTransitionGroup.js +1 -1
  95. package/lib/ReactUpdates.js +4 -4
  96. package/lib/ReactWithAddons.js +1 -1
  97. package/lib/SVGDOMPropertyConfig.js +1 -1
  98. package/lib/SelectEventPlugin.js +3 -3
  99. package/lib/ServerReactRootIndex.js +1 -1
  100. package/lib/SimpleEventPlugin.js +1 -1
  101. package/lib/SyntheticClipboardEvent.js +1 -2
  102. package/lib/SyntheticCompositionEvent.js +1 -2
  103. package/lib/SyntheticDragEvent.js +1 -1
  104. package/lib/SyntheticEvent.js +11 -3
  105. package/lib/SyntheticFocusEvent.js +1 -1
  106. package/lib/SyntheticInputEvent.js +1 -2
  107. package/lib/SyntheticKeyboardEvent.js +1 -1
  108. package/lib/SyntheticMouseEvent.js +1 -1
  109. package/lib/SyntheticTouchEvent.js +1 -1
  110. package/lib/SyntheticUIEvent.js +1 -1
  111. package/lib/SyntheticWheelEvent.js +1 -1
  112. package/lib/Transaction.js +3 -3
  113. package/lib/ViewportMetrics.js +1 -1
  114. package/lib/accumulate.js +1 -1
  115. package/lib/accumulateInto.js +1 -1
  116. package/lib/adler32.js +1 -1
  117. package/lib/cloneWithProps.js +1 -1
  118. package/lib/createFullPageComponent.js +1 -1
  119. package/lib/dangerousStyleValue.js +1 -1
  120. package/lib/escapeTextForBrowser.js +6 -6
  121. package/lib/findDOMNode.js +8 -9
  122. package/lib/flattenChildren.js +10 -8
  123. package/lib/forEachAccumulated.js +1 -1
  124. package/lib/getEventCharCode.js +1 -1
  125. package/lib/getEventKey.js +1 -1
  126. package/lib/getEventModifierState.js +1 -1
  127. package/lib/getEventTarget.js +1 -1
  128. package/lib/getIteratorFn.js +1 -1
  129. package/lib/getNodeForCharacterOffset.js +2 -2
  130. package/lib/getReactRootElementInContainer.js +1 -1
  131. package/lib/getTextContentAccessor.js +1 -1
  132. package/lib/instantiateReactComponent.js +1 -1
  133. package/lib/isEventSupported.js +1 -1
  134. package/lib/isTextInputElement.js +1 -1
  135. package/lib/joinClasses.js +1 -1
  136. package/lib/keyMirror.js +1 -1
  137. package/lib/memoizeStringOnly.js +4 -5
  138. package/lib/onlyChild.js +1 -1
  139. package/lib/setInnerHTML.js +12 -1
  140. package/lib/shallowEqual.js +1 -1
  141. package/lib/shouldUpdateReactComponent.js +41 -7
  142. package/lib/traverseAllChildren.js +1 -1
  143. package/lib/update.js +1 -1
  144. package/lib/warning.js +8 -1
  145. package/package.json +1 -1
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactPropTypeLocationNames
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var ReactPropTypeLocationNames = {};
15
15
 
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactPropTypeLocations
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var keyMirror = require("./keyMirror");
15
15
 
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactPropTypes
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var ReactElement = require("./ReactElement");
15
15
  var ReactPropTypeLocationNames = require("./ReactPropTypeLocationNames");
@@ -98,6 +98,7 @@ function createChainableTypeChecker(validate) {
98
98
  ("`" + componentName + "`.")
99
99
  );
100
100
  }
101
+ return null;
101
102
  } else {
102
103
  return validate(props, propName, componentName, location);
103
104
  }
@@ -125,12 +126,13 @@ function createPrimitiveTypeChecker(expectedType) {
125
126
  ("supplied to `" + componentName + "`, expected `" + expectedType + "`.")
126
127
  );
127
128
  }
129
+ return null;
128
130
  }
129
131
  return createChainableTypeChecker(validate);
130
132
  }
131
133
 
132
134
  function createAnyTypeChecker() {
133
- return createChainableTypeChecker(emptyFunction.thatReturns());
135
+ return createChainableTypeChecker(emptyFunction.thatReturns(null));
134
136
  }
135
137
 
136
138
  function createArrayOfTypeChecker(typeChecker) {
@@ -150,6 +152,7 @@ function createArrayOfTypeChecker(typeChecker) {
150
152
  return error;
151
153
  }
152
154
  }
155
+ return null;
153
156
  }
154
157
  return createChainableTypeChecker(validate);
155
158
  }
@@ -163,6 +166,7 @@ function createElementTypeChecker() {
163
166
  ("`" + componentName + "`, expected a ReactElement.")
164
167
  );
165
168
  }
169
+ return null;
166
170
  }
167
171
  return createChainableTypeChecker(validate);
168
172
  }
@@ -177,6 +181,7 @@ function createInstanceTypeChecker(expectedClass) {
177
181
  ("`" + componentName + "`, expected instance of `" + expectedClassName + "`.")
178
182
  );
179
183
  }
184
+ return null;
180
185
  }
181
186
  return createChainableTypeChecker(validate);
182
187
  }
@@ -186,7 +191,7 @@ function createEnumTypeChecker(expectedValues) {
186
191
  var propValue = props[propName];
187
192
  for (var i = 0; i < expectedValues.length; i++) {
188
193
  if (propValue === expectedValues[i]) {
189
- return;
194
+ return null;
190
195
  }
191
196
  }
192
197
 
@@ -219,6 +224,7 @@ function createObjectOfTypeChecker(typeChecker) {
219
224
  }
220
225
  }
221
226
  }
227
+ return null;
222
228
  }
223
229
  return createChainableTypeChecker(validate);
224
230
  }
@@ -228,7 +234,7 @@ function createUnionTypeChecker(arrayOfTypeCheckers) {
228
234
  for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
229
235
  var checker = arrayOfTypeCheckers[i];
230
236
  if (checker(props, propName, componentName, location) == null) {
231
- return;
237
+ return null;
232
238
  }
233
239
  }
234
240
 
@@ -250,6 +256,7 @@ function createNodeChecker() {
250
256
  ("`" + componentName + "`, expected a ReactNode.")
251
257
  );
252
258
  }
259
+ return null;
253
260
  }
254
261
  return createChainableTypeChecker(validate);
255
262
  }
@@ -275,12 +282,13 @@ function createShapeTypeChecker(shapeTypes) {
275
282
  return error;
276
283
  }
277
284
  }
285
+ return null;
278
286
  }
279
287
  return createChainableTypeChecker(validate, 'expected `object`');
280
288
  }
281
289
 
282
290
  function isNode(propValue) {
283
- switch(typeof propValue) {
291
+ switch (typeof propValue) {
284
292
  case 'number':
285
293
  case 'string':
286
294
  return true;
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactPutListenerQueue
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var PooledClass = require("./PooledClass");
15
15
  var ReactBrowserEventEmitter = require("./ReactBrowserEventEmitter");
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var CallbackQueue = require("./CallbackQueue");
16
16
  var PooledClass = require("./PooledClass");
package/lib/ReactRef.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactRef
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var ReactUpdates = require("./ReactUpdates");
15
15
 
@@ -10,7 +10,7 @@
10
10
  * @typechecks
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var ReactRootIndexInjection = {
16
16
  /**
@@ -9,7 +9,7 @@
9
9
  * @typechecks static-only
10
10
  * @providesModule ReactServerRendering
11
11
  */
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var ReactElement = require("./ReactElement");
15
15
  var ReactInstanceHandles = require("./ReactInstanceHandles");
@@ -38,7 +38,8 @@ function renderToString(element) {
38
38
 
39
39
  return transaction.perform(function() {
40
40
  var componentInstance = instantiateReactComponent(element, null);
41
- var markup = componentInstance.mountComponent(id, transaction, emptyObject);
41
+ var markup =
42
+ componentInstance.mountComponent(id, transaction, emptyObject);
42
43
  return ReactMarkupChecksum.addChecksumToMarkup(markup);
43
44
  }, null);
44
45
  } finally {
@@ -10,7 +10,7 @@
10
10
  * @typechecks
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var PooledClass = require("./PooledClass");
16
16
  var CallbackQueue = require("./CallbackQueue");
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactStateSetters
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var ReactStateSetters = {
15
15
  /**
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactTestUtils
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var EventConstants = require("./EventConstants");
15
15
  var EventPluginHub = require("./EventPluginHub");
@@ -10,7 +10,7 @@
10
10
  * @providesModule ReactTransitionChildMapping
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var ReactChildren = require("./ReactChildren");
16
16
 
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactTransitionEvents
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var ExecutionEnvironment = require("./ExecutionEnvironment");
15
15
 
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactTransitionGroup
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var React = require("./React");
15
15
  var ReactTransitionChildMapping = require("./ReactTransitionChildMapping");
@@ -9,7 +9,7 @@
9
9
  * @providesModule ReactUpdates
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var CallbackQueue = require("./CallbackQueue");
15
15
  var PooledClass = require("./PooledClass");
@@ -152,7 +152,7 @@ function runBatchedUpdates(transaction) {
152
152
  for (var j = 0; j < callbacks.length; j++) {
153
153
  transaction.callbackQueue.enqueue(
154
154
  callbacks[j],
155
- component
155
+ component.getPublicInstance()
156
156
  );
157
157
  }
158
158
  }
@@ -192,11 +192,11 @@ flushBatchedUpdates = ReactPerf.measure(
192
192
  */
193
193
  function enqueueUpdate(component, callback) {
194
194
  ("production" !== process.env.NODE_ENV ? invariant(
195
- !callback || typeof callback === "function",
195
+ !callback || typeof callback === 'function',
196
196
  'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +
197
197
  '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +
198
198
  'isn\'t callable.'
199
- ) : invariant(!callback || typeof callback === "function"));
199
+ ) : invariant(!callback || typeof callback === 'function'));
200
200
  ensureInjected();
201
201
 
202
202
  // Various parts of our code (such as ReactCompositeComponent's
@@ -16,7 +16,7 @@
16
16
  * place to live inside React core.
17
17
  */
18
18
 
19
- "use strict";
19
+ 'use strict';
20
20
 
21
21
  var LinkedStateMixin = require("./LinkedStateMixin");
22
22
  var React = require("./React");
@@ -11,7 +11,7 @@
11
11
 
12
12
  /*jslint bitwise: true*/
13
13
 
14
- "use strict";
14
+ 'use strict';
15
15
 
16
16
  var DOMProperty = require("./DOMProperty");
17
17
 
@@ -9,7 +9,7 @@
9
9
  * @providesModule SelectEventPlugin
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var EventConstants = require("./EventConstants");
15
15
  var EventPropagators = require("./EventPropagators");
@@ -94,8 +94,8 @@ function constructSelectEvent(nativeEvent) {
94
94
  // won't dispatch.
95
95
  if (mouseDown ||
96
96
  activeElement == null ||
97
- activeElement != getActiveElement()) {
98
- return;
97
+ activeElement !== getActiveElement()) {
98
+ return null;
99
99
  }
100
100
 
101
101
  // Only fire when selection has actually changed.
@@ -10,7 +10,7 @@
10
10
  * @typechecks
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  /**
16
16
  * Size of the reactRoot ID space. We generate random numbers for React root
@@ -9,7 +9,7 @@
9
9
  * @providesModule SimpleEventPlugin
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var EventConstants = require("./EventConstants");
15
15
  var EventPluginUtils = require("./EventPluginUtils");
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var SyntheticEvent = require("./SyntheticEvent");
16
16
 
@@ -41,4 +41,3 @@ function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent) {
41
41
  SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
42
42
 
43
43
  module.exports = SyntheticClipboardEvent;
44
-
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var SyntheticEvent = require("./SyntheticEvent");
16
16
 
@@ -41,4 +41,3 @@ SyntheticEvent.augmentClass(
41
41
  );
42
42
 
43
43
  module.exports = SyntheticCompositionEvent;
44
-
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var SyntheticMouseEvent = require("./SyntheticMouseEvent");
16
16
 
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var PooledClass = require("./PooledClass");
16
16
 
@@ -88,13 +88,21 @@ assign(SyntheticEvent.prototype, {
88
88
  preventDefault: function() {
89
89
  this.defaultPrevented = true;
90
90
  var event = this.nativeEvent;
91
- event.preventDefault ? event.preventDefault() : event.returnValue = false;
91
+ if (event.preventDefault) {
92
+ event.preventDefault();
93
+ } else {
94
+ event.returnValue = false;
95
+ }
92
96
  this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
93
97
  },
94
98
 
95
99
  stopPropagation: function() {
96
100
  var event = this.nativeEvent;
97
- event.stopPropagation ? event.stopPropagation() : event.cancelBubble = true;
101
+ if (event.stopPropagation) {
102
+ event.stopPropagation();
103
+ } else {
104
+ event.cancelBubble = true;
105
+ }
98
106
  this.isPropagationStopped = emptyFunction.thatReturnsTrue;
99
107
  },
100
108
 
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var SyntheticUIEvent = require("./SyntheticUIEvent");
16
16
 
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var SyntheticEvent = require("./SyntheticEvent");
16
16
 
@@ -42,4 +42,3 @@ SyntheticEvent.augmentClass(
42
42
  );
43
43
 
44
44
  module.exports = SyntheticInputEvent;
45
-
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var SyntheticUIEvent = require("./SyntheticUIEvent");
16
16
 
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var SyntheticUIEvent = require("./SyntheticUIEvent");
16
16
  var ViewportMetrics = require("./ViewportMetrics");