react 0.14.0-alpha2 → 0.14.0-alpha3

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 (63) hide show
  1. package/dist/JSXTransformer.js +1 -1
  2. package/dist/react-with-addons.js +223 -207
  3. package/dist/react-with-addons.min.js +6 -6
  4. package/dist/react.js +208 -192
  5. package/dist/react.min.js +5 -5
  6. package/lib/CSSCore.js +3 -3
  7. package/lib/CSSPropertyOperations.js +3 -3
  8. package/lib/CallbackQueue.js +1 -1
  9. package/lib/DOMChildrenOperations.js +1 -1
  10. package/lib/DOMProperty.js +4 -4
  11. package/lib/DOMPropertyOperations.js +1 -1
  12. package/lib/Danger.js +8 -8
  13. package/lib/EventPluginHub.js +3 -3
  14. package/lib/EventPluginRegistry.js +7 -7
  15. package/lib/EventPluginUtils.js +3 -3
  16. package/lib/EventPropagators.js +1 -1
  17. package/lib/HTMLDOMPropertyConfig.js +1 -0
  18. package/lib/LinkedValueUtils.js +3 -3
  19. package/lib/LocalEventTrapMixin.js +2 -2
  20. package/lib/PooledClass.js +1 -1
  21. package/lib/React.js +1 -1
  22. package/lib/ReactBrowserComponentMixin.js +1 -1
  23. package/lib/ReactCSSTransitionGroupChild.js +1 -1
  24. package/lib/ReactChildren.js +1 -1
  25. package/lib/ReactClass.js +18 -18
  26. package/lib/ReactComponent.js +3 -3
  27. package/lib/ReactComponentEnvironment.js +1 -1
  28. package/lib/ReactCompositeComponent.js +17 -21
  29. package/lib/ReactDOMClient.js +1 -1
  30. package/lib/ReactDOMComponent.js +9 -9
  31. package/lib/ReactDOMIDOperations.js +2 -2
  32. package/lib/ReactDOMInput.js +2 -2
  33. package/lib/ReactDOMOption.js +3 -4
  34. package/lib/ReactDOMTextarea.js +4 -4
  35. package/lib/ReactElement.js +1 -1
  36. package/lib/ReactElementValidator.js +8 -8
  37. package/lib/ReactEmptyComponent.js +1 -1
  38. package/lib/ReactFragment.js +5 -5
  39. package/lib/ReactInstanceHandles.js +6 -6
  40. package/lib/ReactMount.js +19 -19
  41. package/lib/ReactNativeComponent.js +1 -1
  42. package/lib/ReactOwner.js +2 -2
  43. package/lib/ReactPropTypes.js +12 -0
  44. package/lib/ReactServerRendering.js +2 -2
  45. package/lib/ReactUpdateQueue.js +6 -6
  46. package/lib/ReactUpdates.js +8 -8
  47. package/lib/SimpleEventPlugin.js +2 -2
  48. package/lib/Transaction.js +2 -2
  49. package/lib/accumulateInto.js +1 -1
  50. package/lib/cloneWithProps.js +1 -1
  51. package/lib/createFullPageComponent.js +1 -1
  52. package/lib/createNodesFromMarkup.js +2 -2
  53. package/lib/findDOMNode.js +3 -3
  54. package/lib/flattenChildren.js +1 -1
  55. package/lib/getMarkupWrap.js +1 -1
  56. package/lib/instantiateReactComponent.js +3 -3
  57. package/lib/keyMirror.js +1 -1
  58. package/lib/onlyChild.js +1 -1
  59. package/lib/toArray.js +3 -3
  60. package/lib/traverseAllChildren.js +2 -2
  61. package/lib/update.js +10 -10
  62. package/lib/validateDOMNesting.js +10 -2
  63. package/package.json +1 -1
package/lib/keyMirror.js CHANGED
@@ -35,7 +35,7 @@ var invariant = require("./invariant");
35
35
  var keyMirror = function (obj) {
36
36
  var ret = {};
37
37
  var key;
38
- 'production' !== process.env.NODE_ENV ? invariant(obj instanceof Object && !Array.isArray(obj), 'keyMirror(...): Argument must be an object.') : invariant(obj instanceof Object && !Array.isArray(obj));
38
+ !(obj instanceof Object && !Array.isArray(obj)) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : undefined;
39
39
  for (key in obj) {
40
40
  if (!obj.hasOwnProperty(key)) {
41
41
  continue;
package/lib/onlyChild.js CHANGED
@@ -26,7 +26,7 @@ var invariant = require("./invariant");
26
26
  * structure.
27
27
  */
28
28
  function onlyChild(children) {
29
- 'production' !== process.env.NODE_ENV ? invariant(ReactElement.isValidElement(children), 'onlyChild must be passed a children with exactly one child.') : invariant(ReactElement.isValidElement(children));
29
+ !ReactElement.isValidElement(children) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : undefined;
30
30
  return children;
31
31
  }
32
32
 
package/lib/toArray.js CHANGED
@@ -28,11 +28,11 @@ function toArray(obj) {
28
28
 
29
29
  // Some browse builtin objects can report typeof 'function' (e.g. NodeList in
30
30
  // old versions of Safari).
31
- 'production' !== process.env.NODE_ENV ? invariant(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function'), 'toArray: Array-like object expected') : invariant(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function'));
31
+ !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : undefined;
32
32
 
33
- 'production' !== process.env.NODE_ENV ? invariant(typeof length === 'number', 'toArray: Object needs a length property') : invariant(typeof length === 'number');
33
+ !(typeof length === 'number') ? 'production' !== process.env.NODE_ENV ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : undefined;
34
34
 
35
- 'production' !== process.env.NODE_ENV ? invariant(length === 0 || length - 1 in obj, 'toArray: Object should have keys for indices') : invariant(length === 0 || length - 1 in obj);
35
+ !(length === 0 || length - 1 in obj) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : undefined;
36
36
 
37
37
  // Old IE doesn't give collections access to hasOwnProperty. Assume inputs
38
38
  // without method will throw during the slice call and skip straight to the
@@ -126,7 +126,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
126
126
  }
127
127
  } else {
128
128
  if ('production' !== process.env.NODE_ENV) {
129
- 'production' !== process.env.NODE_ENV ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : null;
129
+ 'production' !== process.env.NODE_ENV ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : undefined;
130
130
  didWarnAboutMaps = true;
131
131
  }
132
132
  // Iterator will provide entry [k,v] tuples rather than values.
@@ -140,7 +140,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
140
140
  }
141
141
  }
142
142
  } else if (type === 'object') {
143
- 'production' !== process.env.NODE_ENV ? invariant(children.nodeType !== 1, 'traverseAllChildren(...): Encountered an invalid child; DOM ' + 'elements are not valid children of React components.') : invariant(children.nodeType !== 1);
143
+ !(children.nodeType !== 1) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'traverseAllChildren(...): Encountered an invalid child; DOM ' + 'elements are not valid children of React components.') : invariant(false) : undefined;
144
144
  var fragment = ReactFragment.extract(children);
145
145
  for (var key in fragment) {
146
146
  if (fragment.hasOwnProperty(key)) {
package/lib/update.js CHANGED
@@ -44,16 +44,16 @@ ALL_COMMANDS_LIST.forEach(function (command) {
44
44
  });
45
45
 
46
46
  function invariantArrayCase(value, spec, command) {
47
- 'production' !== process.env.NODE_ENV ? invariant(Array.isArray(value), 'update(): expected target of %s to be an array; got %s.', command, value) : invariant(Array.isArray(value));
47
+ !Array.isArray(value) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'update(): expected target of %s to be an array; got %s.', command, value) : invariant(false) : undefined;
48
48
  var specValue = spec[command];
49
- 'production' !== process.env.NODE_ENV ? invariant(Array.isArray(specValue), 'update(): expected spec of %s to be an array; got %s. ' + 'Did you forget to wrap your parameter in an array?', command, specValue) : invariant(Array.isArray(specValue));
49
+ !Array.isArray(specValue) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'update(): expected spec of %s to be an array; got %s. ' + 'Did you forget to wrap your parameter in an array?', command, specValue) : invariant(false) : undefined;
50
50
  }
51
51
 
52
52
  function update(value, spec) {
53
- 'production' !== process.env.NODE_ENV ? invariant(typeof spec === 'object', 'update(): You provided a key path to update() that did not contain one ' + 'of %s. Did you forget to include {%s: ...}?', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : invariant(typeof spec === 'object');
53
+ !(typeof spec === 'object') ? 'production' !== process.env.NODE_ENV ? invariant(false, 'update(): You provided a key path to update() that did not contain one ' + 'of %s. Did you forget to include {%s: ...}?', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : invariant(false) : undefined;
54
54
 
55
55
  if (hasOwnProperty.call(spec, COMMAND_SET)) {
56
- 'production' !== process.env.NODE_ENV ? invariant(Object.keys(spec).length === 1, 'Cannot have more than one key in an object with %s', COMMAND_SET) : invariant(Object.keys(spec).length === 1);
56
+ !(Object.keys(spec).length === 1) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'Cannot have more than one key in an object with %s', COMMAND_SET) : invariant(false) : undefined;
57
57
 
58
58
  return spec[COMMAND_SET];
59
59
  }
@@ -62,8 +62,8 @@ function update(value, spec) {
62
62
 
63
63
  if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
64
64
  var mergeObj = spec[COMMAND_MERGE];
65
- 'production' !== process.env.NODE_ENV ? invariant(mergeObj && typeof mergeObj === 'object', 'update(): %s expects a spec of type \'object\'; got %s', COMMAND_MERGE, mergeObj) : invariant(mergeObj && typeof mergeObj === 'object');
66
- 'production' !== process.env.NODE_ENV ? invariant(nextValue && typeof nextValue === 'object', 'update(): %s expects a target of type \'object\'; got %s', COMMAND_MERGE, nextValue) : invariant(nextValue && typeof nextValue === 'object');
65
+ !(mergeObj && typeof mergeObj === 'object') ? 'production' !== process.env.NODE_ENV ? invariant(false, 'update(): %s expects a spec of type \'object\'; got %s', COMMAND_MERGE, mergeObj) : invariant(false) : undefined;
66
+ !(nextValue && typeof nextValue === 'object') ? 'production' !== process.env.NODE_ENV ? invariant(false, 'update(): %s expects a target of type \'object\'; got %s', COMMAND_MERGE, nextValue) : invariant(false) : undefined;
67
67
  assign(nextValue, spec[COMMAND_MERGE]);
68
68
  }
69
69
 
@@ -82,16 +82,16 @@ function update(value, spec) {
82
82
  }
83
83
 
84
84
  if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
85
- 'production' !== process.env.NODE_ENV ? invariant(Array.isArray(value), 'Expected %s target to be an array; got %s', COMMAND_SPLICE, value) : invariant(Array.isArray(value));
86
- 'production' !== process.env.NODE_ENV ? invariant(Array.isArray(spec[COMMAND_SPLICE]), 'update(): expected spec of %s to be an array of arrays; got %s. ' + 'Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : invariant(Array.isArray(spec[COMMAND_SPLICE]));
85
+ !Array.isArray(value) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'Expected %s target to be an array; got %s', COMMAND_SPLICE, value) : invariant(false) : undefined;
86
+ !Array.isArray(spec[COMMAND_SPLICE]) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. ' + 'Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : invariant(false) : undefined;
87
87
  spec[COMMAND_SPLICE].forEach(function (args) {
88
- 'production' !== process.env.NODE_ENV ? invariant(Array.isArray(args), 'update(): expected spec of %s to be an array of arrays; got %s. ' + 'Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : invariant(Array.isArray(args));
88
+ !Array.isArray(args) ? 'production' !== process.env.NODE_ENV ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. ' + 'Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : invariant(false) : undefined;
89
89
  nextValue.splice.apply(nextValue, args);
90
90
  });
91
91
  }
92
92
 
93
93
  if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
94
- 'production' !== process.env.NODE_ENV ? invariant(typeof spec[COMMAND_APPLY] === 'function', 'update(): expected spec of %s to be a function; got %s.', COMMAND_APPLY, spec[COMMAND_APPLY]) : invariant(typeof spec[COMMAND_APPLY] === 'function');
94
+ !(typeof spec[COMMAND_APPLY] === 'function') ? 'production' !== process.env.NODE_ENV ? invariant(false, 'update(): expected spec of %s to be a function; got %s.', COMMAND_APPLY, spec[COMMAND_APPLY]) : invariant(false) : undefined;
95
95
  nextValue = spec[COMMAND_APPLY](nextValue);
96
96
  }
97
97
 
@@ -282,6 +282,8 @@ if ('production' !== process.env.NODE_ENV) {
282
282
  return stack;
283
283
  };
284
284
 
285
+ var didWarn = {};
286
+
285
287
  validateDOMNesting = function (childTag, childInstance, ancestorInfo) {
286
288
  ancestorInfo = ancestorInfo || emptyAncestorInfo;
287
289
  var parentInfo = ancestorInfo.parentTag;
@@ -327,14 +329,20 @@ if ('production' !== process.env.NODE_ENV) {
327
329
  // If we're warning about an invalid (non-parent) ancestry, add '...'
328
330
  invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
329
331
 
332
+ var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
333
+ if (didWarn[warnKey]) {
334
+ return;
335
+ }
336
+ didWarn[warnKey] = true;
337
+
330
338
  if (invalidParent) {
331
339
  var info = '';
332
340
  if (ancestorTag === 'table' && childTag === 'tr') {
333
341
  info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
334
342
  }
335
- 'production' !== process.env.NODE_ENV ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a child of <%s>. ' + 'See %s.%s', childTag, ancestorTag, ownerInfo, info) : null;
343
+ 'production' !== process.env.NODE_ENV ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a child of <%s>. ' + 'See %s.%s', childTag, ancestorTag, ownerInfo, info) : undefined;
336
344
  } else {
337
- 'production' !== process.env.NODE_ENV ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a descendant of ' + '<%s>. See %s.', childTag, ancestorTag, ownerInfo) : null;
345
+ 'production' !== process.env.NODE_ENV ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a descendant of ' + '<%s>. See %s.', childTag, ancestorTag, ownerInfo) : undefined;
338
346
  }
339
347
  }
340
348
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react",
3
3
  "description": "React is a JavaScript library for building user interfaces.",
4
- "version": "0.14.0-alpha2",
4
+ "version": "0.14.0-alpha3",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],