react 15.5.4 → 15.6.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 (61) hide show
  1. package/LICENSE +16 -26
  2. package/dist/react-with-addons.js +1647 -1416
  3. package/dist/react-with-addons.min.js +6 -8
  4. package/dist/react.js +1737 -1456
  5. package/dist/react.min.js +5 -7
  6. package/lib/KeyEscapeUtils.js +3 -5
  7. package/lib/LinkedStateMixin.js +3 -5
  8. package/lib/PooledClass.js +3 -5
  9. package/lib/React.js +48 -22
  10. package/lib/ReactAddonsDOMDependencies.js +3 -5
  11. package/lib/ReactAddonsDOMDependenciesUMDShim.js +3 -5
  12. package/lib/{ReactComponent.js → ReactBaseClasses.js} +32 -9
  13. package/lib/ReactCSSTransitionGroup.js +4 -6
  14. package/lib/ReactCSSTransitionGroupChild.js +3 -5
  15. package/lib/ReactChildren.js +3 -5
  16. package/lib/ReactComponentTreeDevtool.js +3 -5
  17. package/lib/ReactComponentTreeHook.js +52 -9
  18. package/lib/ReactComponentTreeHookUMDShim.js +3 -5
  19. package/lib/ReactComponentWithPureRenderMixin.js +3 -5
  20. package/lib/ReactCurrentOwner.js +3 -7
  21. package/lib/ReactCurrentOwnerUMDShim.js +3 -5
  22. package/lib/ReactDOMFactories.js +3 -6
  23. package/lib/ReactElement.js +3 -5
  24. package/lib/ReactElementSymbol.js +3 -5
  25. package/lib/ReactElementType.js +3 -5
  26. package/lib/ReactElementValidator.js +9 -9
  27. package/lib/ReactFragment.js +3 -5
  28. package/lib/ReactLink.js +4 -27
  29. package/lib/ReactNoopUpdateQueue.js +3 -6
  30. package/lib/ReactPropTypeLocationNames.js +3 -5
  31. package/lib/ReactPropTypeLocations.js +3 -5
  32. package/lib/ReactPropTypes.js +3 -5
  33. package/lib/ReactPropTypesSecret.js +3 -5
  34. package/lib/ReactStateSetters.js +3 -5
  35. package/lib/ReactTransitionChildMapping.js +3 -5
  36. package/lib/ReactTransitionEvents.js +3 -5
  37. package/lib/ReactTransitionGroup.js +7 -6
  38. package/lib/ReactUMDEntry.js +3 -5
  39. package/lib/ReactUMDShim.js +3 -5
  40. package/lib/ReactVersion.js +4 -6
  41. package/lib/ReactWithAddons.js +3 -5
  42. package/lib/ReactWithAddonsUMDEntry.js +3 -5
  43. package/lib/canDefineProperty.js +3 -5
  44. package/lib/checkReactTypeSpec.js +3 -5
  45. package/lib/createClass.js +20 -0
  46. package/lib/deprecated.js +6 -8
  47. package/lib/flattenChildren.js +3 -5
  48. package/lib/getIteratorFn.js +3 -5
  49. package/lib/getNextDebugID.js +3 -5
  50. package/lib/getNextDebugIDUMDShim.js +3 -5
  51. package/lib/lowPriorityWarning.js +62 -0
  52. package/lib/onlyChild.js +3 -5
  53. package/lib/reactProdInvariant.js +2 -4
  54. package/lib/shallowCompare.js +3 -5
  55. package/lib/sliceChildren.js +3 -5
  56. package/lib/traverseAllChildren.js +4 -6
  57. package/lib/update.js +3 -5
  58. package/package.json +4 -4
  59. package/PATENTS +0 -33
  60. package/lib/ReactClass.js +0 -722
  61. package/lib/ReactPureComponent.js +0 -41
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  *
10
8
  */
@@ -18,13 +16,11 @@
18
16
  * currently being constructed.
19
17
  */
20
18
  var ReactCurrentOwner = {
21
-
22
19
  /**
23
20
  * @internal
24
21
  * @type {ReactComponent}
25
22
  */
26
23
  current: null
27
-
28
24
  };
29
25
 
30
26
  module.exports = ReactCurrentOwner;
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -25,7 +23,6 @@ if (process.env.NODE_ENV !== 'production') {
25
23
 
26
24
  /**
27
25
  * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
28
- * This is also accessible via `React.DOM`.
29
26
  *
30
27
  * @public
31
28
  */
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2014-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2014-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2014-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2014-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  *
10
8
  */
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2016-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2016-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  *
10
8
  */
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2014-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2014-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -26,6 +24,7 @@ var checkReactTypeSpec = require('./checkReactTypeSpec');
26
24
  var canDefineProperty = require('./canDefineProperty');
27
25
  var getIteratorFn = require('./getIteratorFn');
28
26
  var warning = require('fbjs/lib/warning');
27
+ var lowPriorityWarning = require('./lowPriorityWarning');
29
28
 
30
29
  function getDeclarationErrorAddendum() {
31
30
  if (ReactCurrentOwner.current) {
@@ -166,7 +165,6 @@ function validatePropTypes(element) {
166
165
  }
167
166
 
168
167
  var ReactElementValidator = {
169
-
170
168
  createElement: function (type, props, children) {
171
169
  var validType = typeof type === 'string' || typeof type === 'function';
172
170
  // We warn in this case but don't throw. We expect the element creation to
@@ -175,7 +173,7 @@ var ReactElementValidator = {
175
173
  if (typeof type !== 'function' && typeof type !== 'string') {
176
174
  var info = '';
177
175
  if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
178
- info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
176
+ info += ' You likely forgot to export your component from the file ' + "it's defined in.";
179
177
  }
180
178
 
181
179
  var sourceInfo = getSourceInfoErrorAddendum(props);
@@ -187,7 +185,10 @@ var ReactElementValidator = {
187
185
 
188
186
  info += ReactComponentTreeHook.getCurrentStackAddendum();
189
187
 
188
+ var currentSource = props !== null && props !== undefined && props.__source !== undefined ? props.__source : null;
189
+ ReactComponentTreeHook.pushNonStandardWarningStack(true, currentSource);
190
190
  process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0;
191
+ ReactComponentTreeHook.popNonStandardWarningStack();
191
192
  }
192
193
  }
193
194
 
@@ -225,7 +226,7 @@ var ReactElementValidator = {
225
226
  Object.defineProperty(validatedFactory, 'type', {
226
227
  enumerable: false,
227
228
  get: function () {
228
- process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0;
229
+ lowPriorityWarning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
229
230
  Object.defineProperty(this, 'type', {
230
231
  value: type
231
232
  });
@@ -246,7 +247,6 @@ var ReactElementValidator = {
246
247
  validatePropTypes(newElement);
247
248
  return newElement;
248
249
  }
249
-
250
250
  };
251
251
 
252
252
  module.exports = ReactElementValidator;
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2015-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2015-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
package/lib/ReactLink.js CHANGED
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -33,8 +31,6 @@
33
31
  * consumption of ReactLink easier; see LinkedValueUtils and LinkedStateMixin.
34
32
  */
35
33
 
36
- var React = require('./React');
37
-
38
34
  /**
39
35
  * Deprecated: An an easy way to express two-way binding with React.
40
36
  * See https://facebook.github.io/react/docs/two-way-binding-helpers.html
@@ -42,29 +38,10 @@ var React = require('./React');
42
38
  * @param {*} value current value of the link
43
39
  * @param {function} requestChange callback to request a change
44
40
  */
41
+
45
42
  function ReactLink(value, requestChange) {
46
43
  this.value = value;
47
44
  this.requestChange = requestChange;
48
45
  }
49
46
 
50
- /**
51
- * Creates a PropType that enforces the ReactLink API and optionally checks the
52
- * type of the value being passed inside the link. Example:
53
- *
54
- * MyComponent.propTypes = {
55
- * tabIndexLink: ReactLink.PropTypes.link(React.PropTypes.number)
56
- * }
57
- */
58
- function createLinkTypeChecker(linkType) {
59
- var shapes = {
60
- value: linkType === undefined ? React.PropTypes.any.isRequired : linkType.isRequired,
61
- requestChange: React.PropTypes.func.isRequired
62
- };
63
- return React.PropTypes.shape(shapes);
64
- }
65
-
66
- ReactLink.PropTypes = {
67
- link: createLinkTypeChecker
68
- };
69
-
70
47
  module.exports = ReactLink;
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2015-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2015-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -23,7 +21,6 @@ function warnNoop(publicInstance, callerName) {
23
21
  * This is the abstract API for an update queue.
24
22
  */
25
23
  var ReactNoopUpdateQueue = {
26
-
27
24
  /**
28
25
  * Checks whether or not this composite component is mounted.
29
26
  * @param {ReactClass} publicInstance The instance we want to test.
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  *
10
8
  */
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  *
10
8
  */
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  *
10
8
  */
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -195,7 +193,10 @@ var ReactTransitionGroup = function (_React$Component) {
195
193
  // already been removed. In case you need this behavior you can provide
196
194
  // a childFactory function to wrap every child, even the ones that are
197
195
  // leaving.
198
- childrenToRender.push(React.cloneElement(this.props.childFactory(child), { ref: key, key: key }));
196
+ childrenToRender.push(React.cloneElement(this.props.childFactory(child), {
197
+ ref: key,
198
+ key: key
199
+ }));
199
200
  }
200
201
  }
201
202
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8
 
@@ -1,10 +1,8 @@
1
1
  /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
2
+ * Copyright (c) 2013-present, Facebook, Inc.
4
3
  *
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.
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  */
10
8