react 15.2.1 → 15.3.0-rc.1

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.
@@ -15,6 +15,7 @@ var _assign = require('object-assign');
15
15
 
16
16
  function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
17
17
 
18
+ var ReactComponentEnvironment = require('./ReactComponentEnvironment');
18
19
  var ReactDefaultBatchingStrategy = require('./ReactDefaultBatchingStrategy');
19
20
  var ReactEmptyComponent = require('./ReactEmptyComponent');
20
21
  var ReactMultiChild = require('./ReactMultiChild');
@@ -56,6 +57,11 @@ ReactTestComponent.prototype.receiveComponent = function (nextElement, transacti
56
57
  this.updateChildren(nextElement.props.children, transaction, context);
57
58
  };
58
59
  ReactTestComponent.prototype.getHostNode = function () {};
60
+ ReactTestComponent.prototype.getPublicInstance = function () {
61
+ // I can't say this makes a ton of sense but it seems better than throwing.
62
+ // Maybe we'll revise later if someone has a good use case.
63
+ return null;
64
+ };
59
65
  ReactTestComponent.prototype.unmountComponent = function () {};
60
66
  ReactTestComponent.prototype.toJSON = function () {
61
67
  var _currentElement$props = this._currentElement.props;
@@ -121,6 +127,11 @@ ReactEmptyComponent.injection.injectEmptyComponentFactory(function () {
121
127
  return new ReactTestEmptyComponent();
122
128
  });
123
129
 
130
+ ReactComponentEnvironment.injection.injectEnvironment({
131
+ processChildrenUpdates: function () {},
132
+ replaceNodeWithMarkup: function () {}
133
+ });
134
+
124
135
  var ReactTestRenderer = {
125
136
  create: ReactTestMount.render,
126
137
 
@@ -424,6 +424,8 @@ function makeSimulator(eventType) {
424
424
 
425
425
  var fakeNativeEvent = new Event();
426
426
  fakeNativeEvent.target = node;
427
+ fakeNativeEvent.type = eventType.toLowerCase();
428
+
427
429
  // We don't use SyntheticEvent.getPooled in order to not have to worry about
428
430
  // properly destroying any properties assigned from `eventData` upon release
429
431
  var event = new SyntheticEvent(dispatchConfig, ReactDOMComponentTree.getInstanceFromNode(node), fakeNativeEvent, node);
@@ -11,4 +11,4 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- module.exports = '15.2.1';
14
+ module.exports = '15.3.0-rc.1';
@@ -263,6 +263,8 @@ var ATTRS = {
263
263
  xlinkTitle: 'xlink:title',
264
264
  xlinkType: 'xlink:type',
265
265
  xmlBase: 'xml:base',
266
+ xmlns: 0,
267
+ xmlnsXlink: 'xmlns:xlink',
266
268
  xmlLang: 'xml:lang',
267
269
  xmlSpace: 'xml:space',
268
270
  y: 0,
@@ -485,6 +485,10 @@ for (var type in topLevelEventsToDispatchConfig) {
485
485
  var ON_CLICK_KEY = keyOf({ onClick: null });
486
486
  var onClickListeners = {};
487
487
 
488
+ function getDictionaryKey(inst) {
489
+ return '.' + inst._rootNodeID;
490
+ }
491
+
488
492
  var SimpleEventPlugin = {
489
493
 
490
494
  eventTypes: eventTypes,
@@ -608,19 +612,19 @@ var SimpleEventPlugin = {
608
612
  // fire. The workaround for this bug involves attaching an empty click
609
613
  // listener on the target node.
610
614
  if (registrationName === ON_CLICK_KEY) {
611
- var id = inst._rootNodeID;
615
+ var key = getDictionaryKey(inst);
612
616
  var node = ReactDOMComponentTree.getNodeFromInstance(inst);
613
- if (!onClickListeners[id]) {
614
- onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction);
617
+ if (!onClickListeners[key]) {
618
+ onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction);
615
619
  }
616
620
  }
617
621
  },
618
622
 
619
623
  willDeleteListener: function (inst, registrationName) {
620
624
  if (registrationName === ON_CLICK_KEY) {
621
- var id = inst._rootNodeID;
622
- onClickListeners[id].remove();
623
- delete onClickListeners[id];
625
+ var key = getDictionaryKey(inst);
626
+ onClickListeners[key].remove();
627
+ delete onClickListeners[key];
624
628
  }
625
629
  }
626
630
 
@@ -14,6 +14,7 @@
14
14
  var _prodInvariant = require('./reactProdInvariant');
15
15
 
16
16
  var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames');
17
+ var ReactPropTypesSecret = require('./ReactPropTypesSecret');
17
18
 
18
19
  var invariant = require('fbjs/lib/invariant');
19
20
  var warning = require('fbjs/lib/warning');
@@ -43,7 +44,7 @@ function checkReactTypeSpec(typeSpecs, values, location, componentName, element,
43
44
  // This is intentionally an invariant that gets caught. It's the same
44
45
  // behavior as without this statement except with a better message.
45
46
  !(typeof typeSpecs[typeSpecName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
46
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location);
47
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
47
48
  } catch (ex) {
48
49
  error = ex;
49
50
  }
@@ -98,7 +98,14 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
98
98
  }
99
99
  } else {
100
100
  if (process.env.NODE_ENV !== 'production') {
101
- process.env.NODE_ENV !== 'production' ? 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.') : void 0;
101
+ var mapsAsChildrenAddendum = '';
102
+ if (ReactCurrentOwner.current) {
103
+ var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
104
+ if (mapsAsChildrenOwnerName) {
105
+ mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
106
+ }
107
+ }
108
+ process.env.NODE_ENV !== 'production' ? 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.%s', mapsAsChildrenAddendum) : void 0;
102
109
  didWarnAboutMaps = true;
103
110
  }
104
111
  // Iterator will provide entry [k,v] tuples rather than values.
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": "15.2.1",
4
+ "version": "15.3.0-rc.1",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],