react-dom 15.4.1 → 15.4.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.
package/dist/react-dom.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * ReactDOM v15.4.1
2
+ * ReactDOM v15.4.2
3
3
  */
4
4
 
5
5
  ;(function(f) {
@@ -3848,17 +3848,6 @@ var fourArgumentPooler = function (a1, a2, a3, a4) {
3848
3848
  }
3849
3849
  };
3850
3850
 
3851
- var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
3852
- var Klass = this;
3853
- if (Klass.instancePool.length) {
3854
- var instance = Klass.instancePool.pop();
3855
- Klass.call(instance, a1, a2, a3, a4, a5);
3856
- return instance;
3857
- } else {
3858
- return new Klass(a1, a2, a3, a4, a5);
3859
- }
3860
- };
3861
-
3862
3851
  var standardReleaser = function (instance) {
3863
3852
  var Klass = this;
3864
3853
  !(instance instanceof Klass) ? "development" !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
@@ -3898,8 +3887,7 @@ var PooledClass = {
3898
3887
  oneArgumentPooler: oneArgumentPooler,
3899
3888
  twoArgumentPooler: twoArgumentPooler,
3900
3889
  threeArgumentPooler: threeArgumentPooler,
3901
- fourArgumentPooler: fourArgumentPooler,
3902
- fiveArgumentPooler: fiveArgumentPooler
3890
+ fourArgumentPooler: fourArgumentPooler
3903
3891
  };
3904
3892
 
3905
3893
  module.exports = PooledClass;
@@ -4698,7 +4686,7 @@ var ReactCompositeComponent = {
4698
4686
  // Since plain JS classes are defined without any special initialization
4699
4687
  // logic, we can not catch common errors early. Therefore, we have to
4700
4688
  // catch them here, at initialization time, instead.
4701
- "development" !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
4689
+ "development" !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0;
4702
4690
  "development" !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0;
4703
4691
  "development" !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0;
4704
4692
  "development" !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0;
@@ -6160,12 +6148,18 @@ ReactDOMComponent.Mixin = {
6160
6148
  } else {
6161
6149
  var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
6162
6150
  var childrenToUse = contentToUse != null ? null : props.children;
6151
+ // TODO: Validate that text is allowed as a child of this node
6163
6152
  if (contentToUse != null) {
6164
- // TODO: Validate that text is allowed as a child of this node
6165
- if ("development" !== 'production') {
6166
- setAndValidateContentChildDev.call(this, contentToUse);
6153
+ // Avoid setting textContent when the text is empty. In IE11 setting
6154
+ // textContent on a text area will cause the placeholder to not
6155
+ // show within the textarea until it has been focused and blurred again.
6156
+ // https://github.com/facebook/react/issues/6731#issuecomment-254874553
6157
+ if (contentToUse !== '') {
6158
+ if ("development" !== 'production') {
6159
+ setAndValidateContentChildDev.call(this, contentToUse);
6160
+ }
6161
+ DOMLazyTree.queueText(lazyTree, contentToUse);
6167
6162
  }
6168
- DOMLazyTree.queueText(lazyTree, contentToUse);
6169
6163
  } else if (childrenToUse != null) {
6170
6164
  var mountImages = this.mountChildren(childrenToUse, transaction, context);
6171
6165
  for (var i = 0; i < mountImages.length; i++) {
@@ -6514,6 +6508,13 @@ var Flags = ReactDOMComponentFlags;
6514
6508
 
6515
6509
  var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
6516
6510
 
6511
+ /**
6512
+ * Check if a given node should be cached.
6513
+ */
6514
+ function shouldPrecacheNode(node, nodeID) {
6515
+ return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' ';
6516
+ }
6517
+
6517
6518
  /**
6518
6519
  * Drill down (through composites and empty components) until we get a host or
6519
6520
  * host text component.
@@ -6579,7 +6580,7 @@ function precacheChildNodes(inst, node) {
6579
6580
  }
6580
6581
  // We assume the child nodes are in the same order as the child instances.
6581
6582
  for (; childNode !== null; childNode = childNode.nextSibling) {
6582
- if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {
6583
+ if (shouldPrecacheNode(childNode, childID)) {
6583
6584
  precacheNode(childInst, childNode);
6584
6585
  continue outer;
6585
6586
  }
@@ -6983,7 +6984,17 @@ var ReactDOMInput = {
6983
6984
  }
6984
6985
  } else {
6985
6986
  if (props.value == null && props.defaultValue != null) {
6986
- node.defaultValue = '' + props.defaultValue;
6987
+ // In Chrome, assigning defaultValue to certain input types triggers input validation.
6988
+ // For number inputs, the display value loses trailing decimal points. For email inputs,
6989
+ // Chrome raises "The specified value <x> is not a valid email address".
6990
+ //
6991
+ // Here we check to see if the defaultValue has actually changed, avoiding these problems
6992
+ // when the user is inputting text
6993
+ //
6994
+ // https://github.com/facebook/react/issues/7253
6995
+ if (node.defaultValue !== '' + props.defaultValue) {
6996
+ node.defaultValue = '' + props.defaultValue;
6997
+ }
6987
6998
  }
6988
6999
  if (props.checked == null && props.defaultChecked != null) {
6989
7000
  node.defaultChecked = !!props.defaultChecked;
@@ -8066,9 +8077,15 @@ var ReactDOMTextarea = {
8066
8077
  // This is in postMount because we need access to the DOM node, which is not
8067
8078
  // available until after the component has mounted.
8068
8079
  var node = ReactDOMComponentTree.getNodeFromInstance(inst);
8080
+ var textContent = node.textContent;
8069
8081
 
8070
- // Warning: node.value may be the empty string at this point (IE11) if placeholder is set.
8071
- node.value = node.textContent; // Detach value from defaultValue
8082
+ // Only set node.value if textContent is equal to the expected
8083
+ // initial value. In IE10/IE11 there is a bug where the placeholder attribute
8084
+ // will populate textContent as well.
8085
+ // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
8086
+ if (textContent === inst._wrapperState.initialValue) {
8087
+ node.value = textContent;
8088
+ }
8072
8089
  }
8073
8090
  };
8074
8091
 
@@ -8229,27 +8246,28 @@ module.exports = {
8229
8246
 
8230
8247
  'use strict';
8231
8248
 
8232
- var _assign = _dereq_(158);
8233
-
8249
+ var React = _dereq_(134);
8234
8250
  var ReactDOM = _dereq_(31);
8235
8251
 
8236
- var ReactDOMUMDEntry = _assign({
8237
- __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
8238
- ReactInstanceMap: _dereq_(63)
8239
- }
8240
- }, ReactDOM);
8252
+ var ReactDOMUMDEntry = ReactDOM;
8241
8253
 
8242
8254
  if ("development" !== 'production') {
8243
- _assign(ReactDOMUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
8255
+ ReactDOMUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
8244
8256
  // ReactPerf and ReactTestUtils currently only work with the DOM renderer
8245
8257
  // so we expose them from here, but only in DEV mode.
8246
8258
  ReactPerf: _dereq_(71),
8247
8259
  ReactTestUtils: _dereq_(80)
8248
- });
8260
+ };
8261
+ }
8262
+
8263
+ // Inject ReactDOM into React for the addons UMD build that depends on ReactDOM (TransitionGroup).
8264
+ // We can remove this after we deprecate and remove the addons UMD build.
8265
+ if (React.addons) {
8266
+ React.__SECRET_INJECTED_REACT_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOMUMDEntry;
8249
8267
  }
8250
8268
 
8251
8269
  module.exports = ReactDOMUMDEntry;
8252
- },{"158":158,"31":31,"63":63,"71":71,"80":80}],49:[function(_dereq_,module,exports){
8270
+ },{"134":134,"31":31,"71":71,"80":80}],49:[function(_dereq_,module,exports){
8253
8271
  /**
8254
8272
  * Copyright 2013-present, Facebook, Inc.
8255
8273
  * All rights reserved.
@@ -9226,14 +9244,11 @@ module.exports = ReactFeatureFlags;
9226
9244
 
9227
9245
  'use strict';
9228
9246
 
9229
- var _prodInvariant = _dereq_(125),
9230
- _assign = _dereq_(158);
9247
+ var _prodInvariant = _dereq_(125);
9231
9248
 
9232
9249
  var invariant = _dereq_(150);
9233
9250
 
9234
9251
  var genericComponentClass = null;
9235
- // This registry keeps track of wrapper classes around host tags.
9236
- var tagToComponentClass = {};
9237
9252
  var textComponentClass = null;
9238
9253
 
9239
9254
  var ReactHostComponentInjection = {
@@ -9246,11 +9261,6 @@ var ReactHostComponentInjection = {
9246
9261
  // rendered as props.
9247
9262
  injectTextComponentClass: function (componentClass) {
9248
9263
  textComponentClass = componentClass;
9249
- },
9250
- // This accepts a keyed object with classes as values. Each key represents a
9251
- // tag. That particular tag will use this class instead of the generic one.
9252
- injectComponentClasses: function (componentClasses) {
9253
- _assign(tagToComponentClass, componentClasses);
9254
9264
  }
9255
9265
  };
9256
9266
 
@@ -9289,7 +9299,7 @@ var ReactHostComponent = {
9289
9299
  };
9290
9300
 
9291
9301
  module.exports = ReactHostComponent;
9292
- },{"125":125,"150":150,"158":158}],60:[function(_dereq_,module,exports){
9302
+ },{"125":125,"150":150}],60:[function(_dereq_,module,exports){
9293
9303
  /**
9294
9304
  * Copyright 2016-present, Facebook, Inc.
9295
9305
  * All rights reserved.
@@ -13006,7 +13016,7 @@ module.exports = ReactUpdates;
13006
13016
 
13007
13017
  'use strict';
13008
13018
 
13009
- module.exports = '15.4.1';
13019
+ module.exports = '15.4.2';
13010
13020
  },{}],84:[function(_dereq_,module,exports){
13011
13021
  /**
13012
13022
  * Copyright 2013-present, Facebook, Inc.
@@ -16015,7 +16025,17 @@ function instantiateReactComponent(node, shouldHaveDebugID) {
16015
16025
  instance = ReactEmptyComponent.create(instantiateReactComponent);
16016
16026
  } else if (typeof node === 'object') {
16017
16027
  var element = node;
16018
- !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? "development" !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : _prodInvariant('130', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : void 0;
16028
+ var type = element.type;
16029
+ if (typeof type !== 'function' && typeof type !== 'string') {
16030
+ var info = '';
16031
+ if ("development" !== 'production') {
16032
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
16033
+ info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
16034
+ }
16035
+ }
16036
+ info += getDeclarationErrorAddendum(element._owner);
16037
+ !false ? "development" !== 'production' ? invariant(false, 'Element 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) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0;
16038
+ }
16019
16039
 
16020
16040
  // Special case string values
16021
16041
  if (typeof element.type === 'string') {
@@ -17853,12 +17873,18 @@ module.exports = hyphenateStyleName;
17853
17873
  * will remain to ensure logic does not differ in production.
17854
17874
  */
17855
17875
 
17856
- function invariant(condition, format, a, b, c, d, e, f) {
17857
- if ("development" !== 'production') {
17876
+ var validateFormat = function validateFormat(format) {};
17877
+
17878
+ if ("development" !== 'production') {
17879
+ validateFormat = function validateFormat(format) {
17858
17880
  if (format === undefined) {
17859
17881
  throw new Error('invariant requires an error message argument');
17860
17882
  }
17861
- }
17883
+ };
17884
+ }
17885
+
17886
+ function invariant(condition, format, a, b, c, d, e, f) {
17887
+ validateFormat(format);
17862
17888
 
17863
17889
  if (!condition) {
17864
17890
  var error;