react-dom 15.4.0-rc.3 → 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/lib/ReactPerf.js CHANGED
@@ -88,13 +88,13 @@ function getExclusive() {
88
88
  }
89
89
 
90
90
  flushHistory.forEach(function (flush) {
91
- var measurements = flush.measurements;
92
- var treeSnapshot = flush.treeSnapshot;
91
+ var measurements = flush.measurements,
92
+ treeSnapshot = flush.treeSnapshot;
93
93
 
94
94
  measurements.forEach(function (measurement) {
95
- var duration = measurement.duration;
96
- var instanceID = measurement.instanceID;
97
- var timerType = measurement.timerType;
95
+ var duration = measurement.duration,
96
+ instanceID = measurement.instanceID,
97
+ timerType = measurement.timerType;
98
98
 
99
99
  updateAggregatedStats(treeSnapshot, instanceID, timerType, function (stats) {
100
100
  stats.totalDuration += duration;
@@ -125,9 +125,9 @@ function getInclusive() {
125
125
  var affectedIDs = {};
126
126
 
127
127
  function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
128
- var _treeSnapshot$instanc = treeSnapshot[instanceID];
129
- var displayName = _treeSnapshot$instanc.displayName;
130
- var ownerID = _treeSnapshot$instanc.ownerID;
128
+ var _treeSnapshot$instanc = treeSnapshot[instanceID],
129
+ displayName = _treeSnapshot$instanc.displayName,
130
+ ownerID = _treeSnapshot$instanc.ownerID;
131
131
 
132
132
  var owner = treeSnapshot[ownerID];
133
133
  var key = (owner ? owner.displayName + ' > ' : '') + displayName;
@@ -150,8 +150,8 @@ function getInclusive() {
150
150
  var measurements = flush.measurements;
151
151
 
152
152
  measurements.forEach(function (measurement) {
153
- var instanceID = measurement.instanceID;
154
- var timerType = measurement.timerType;
153
+ var instanceID = measurement.instanceID,
154
+ timerType = measurement.timerType;
155
155
 
156
156
  if (timerType !== 'render') {
157
157
  return;
@@ -161,13 +161,13 @@ function getInclusive() {
161
161
  });
162
162
 
163
163
  flushHistory.forEach(function (flush) {
164
- var measurements = flush.measurements;
165
- var treeSnapshot = flush.treeSnapshot;
164
+ var measurements = flush.measurements,
165
+ treeSnapshot = flush.treeSnapshot;
166
166
 
167
167
  measurements.forEach(function (measurement) {
168
- var duration = measurement.duration;
169
- var instanceID = measurement.instanceID;
170
- var timerType = measurement.timerType;
168
+ var duration = measurement.duration,
169
+ instanceID = measurement.instanceID,
170
+ timerType = measurement.timerType;
171
171
 
172
172
  if (timerType !== 'render') {
173
173
  return;
@@ -210,9 +210,9 @@ function getWasted() {
210
210
  var affectedIDs = {};
211
211
 
212
212
  function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
213
- var _treeSnapshot$instanc2 = treeSnapshot[instanceID];
214
- var displayName = _treeSnapshot$instanc2.displayName;
215
- var ownerID = _treeSnapshot$instanc2.ownerID;
213
+ var _treeSnapshot$instanc2 = treeSnapshot[instanceID],
214
+ displayName = _treeSnapshot$instanc2.displayName,
215
+ ownerID = _treeSnapshot$instanc2.ownerID;
216
216
 
217
217
  var owner = treeSnapshot[ownerID];
218
218
  var key = (owner ? owner.displayName + ' > ' : '') + displayName;
@@ -231,9 +231,9 @@ function getWasted() {
231
231
  }
232
232
 
233
233
  flushHistory.forEach(function (flush) {
234
- var measurements = flush.measurements;
235
- var treeSnapshot = flush.treeSnapshot;
236
- var operations = flush.operations;
234
+ var measurements = flush.measurements,
235
+ treeSnapshot = flush.treeSnapshot,
236
+ operations = flush.operations;
237
237
 
238
238
  var isDefinitelyNotWastedByID = {};
239
239
 
@@ -253,8 +253,8 @@ function getWasted() {
253
253
  // These are potential candidates for being wasted renders.
254
254
  var renderedCompositeIDs = {};
255
255
  measurements.forEach(function (measurement) {
256
- var instanceID = measurement.instanceID;
257
- var timerType = measurement.timerType;
256
+ var instanceID = measurement.instanceID,
257
+ timerType = measurement.timerType;
258
258
 
259
259
  if (timerType !== 'render') {
260
260
  return;
@@ -263,9 +263,9 @@ function getWasted() {
263
263
  });
264
264
 
265
265
  measurements.forEach(function (measurement) {
266
- var duration = measurement.duration;
267
- var instanceID = measurement.instanceID;
268
- var timerType = measurement.timerType;
266
+ var duration = measurement.duration,
267
+ instanceID = measurement.instanceID,
268
+ timerType = measurement.timerType;
269
269
 
270
270
  if (timerType !== 'render') {
271
271
  return;
@@ -318,16 +318,16 @@ function getOperations() {
318
318
 
319
319
  var stats = [];
320
320
  flushHistory.forEach(function (flush, flushIndex) {
321
- var operations = flush.operations;
322
- var treeSnapshot = flush.treeSnapshot;
321
+ var operations = flush.operations,
322
+ treeSnapshot = flush.treeSnapshot;
323
323
 
324
324
  operations.forEach(function (operation) {
325
- var instanceID = operation.instanceID;
326
- var type = operation.type;
327
- var payload = operation.payload;
328
- var _treeSnapshot$instanc3 = treeSnapshot[instanceID];
329
- var displayName = _treeSnapshot$instanc3.displayName;
330
- var ownerID = _treeSnapshot$instanc3.ownerID;
325
+ var instanceID = operation.instanceID,
326
+ type = operation.type,
327
+ payload = operation.payload;
328
+ var _treeSnapshot$instanc3 = treeSnapshot[instanceID],
329
+ displayName = _treeSnapshot$instanc3.displayName,
330
+ ownerID = _treeSnapshot$instanc3.ownerID;
331
331
 
332
332
  var owner = treeSnapshot[ownerID];
333
333
  var key = (owner ? owner.displayName + ' > ' : '') + displayName;
@@ -353,9 +353,9 @@ function printExclusive(flushHistory) {
353
353
 
354
354
  var stats = getExclusive(flushHistory);
355
355
  var table = stats.map(function (item) {
356
- var key = item.key;
357
- var instanceCount = item.instanceCount;
358
- var totalDuration = item.totalDuration;
356
+ var key = item.key,
357
+ instanceCount = item.instanceCount,
358
+ totalDuration = item.totalDuration;
359
359
 
360
360
  var renderCount = item.counts.render || 0;
361
361
  var renderDuration = item.durations.render || 0;
@@ -380,10 +380,10 @@ function printInclusive(flushHistory) {
380
380
 
381
381
  var stats = getInclusive(flushHistory);
382
382
  var table = stats.map(function (item) {
383
- var key = item.key;
384
- var instanceCount = item.instanceCount;
385
- var inclusiveRenderDuration = item.inclusiveRenderDuration;
386
- var renderCount = item.renderCount;
383
+ var key = item.key,
384
+ instanceCount = item.instanceCount,
385
+ inclusiveRenderDuration = item.inclusiveRenderDuration,
386
+ renderCount = item.renderCount;
387
387
 
388
388
  return {
389
389
  'Owner > Component': key,
@@ -403,10 +403,10 @@ function printWasted(flushHistory) {
403
403
 
404
404
  var stats = getWasted(flushHistory);
405
405
  var table = stats.map(function (item) {
406
- var key = item.key;
407
- var instanceCount = item.instanceCount;
408
- var inclusiveRenderDuration = item.inclusiveRenderDuration;
409
- var renderCount = item.renderCount;
406
+ var key = item.key,
407
+ instanceCount = item.instanceCount,
408
+ inclusiveRenderDuration = item.inclusiveRenderDuration,
409
+ renderCount = item.renderCount;
410
410
 
411
411
  return {
412
412
  'Owner > Component': key,
@@ -19,8 +19,8 @@ var warning = require('fbjs/lib/warning');
19
19
  * Helper to call ReactRef.attachRefs with this composite component, split out
20
20
  * to avoid allocations in the transaction mount-ready queue.
21
21
  */
22
- function attachRefs(transaction) {
23
- ReactRef.attachRefs(this, this._currentElement, transaction);
22
+ function attachRefs() {
23
+ ReactRef.attachRefs(this, this._currentElement);
24
24
  }
25
25
 
26
26
  var ReactReconciler = {
package/lib/ReactRef.js CHANGED
@@ -15,12 +15,12 @@ var ReactOwner = require('./ReactOwner');
15
15
 
16
16
  var ReactRef = {};
17
17
 
18
- function attachRef(ref, component, owner, transaction) {
18
+ function attachRef(ref, component, owner) {
19
19
  if (typeof ref === 'function') {
20
- ref(component.getPublicInstance(transaction));
20
+ ref(component.getPublicInstance());
21
21
  } else {
22
22
  // Legacy ref
23
- ReactOwner.addComponentAsRefTo(component, ref, owner, transaction);
23
+ ReactOwner.addComponentAsRefTo(component, ref, owner);
24
24
  }
25
25
  }
26
26
 
@@ -33,13 +33,13 @@ function detachRef(ref, component, owner) {
33
33
  }
34
34
  }
35
35
 
36
- ReactRef.attachRefs = function (instance, element, transaction) {
36
+ ReactRef.attachRefs = function (instance, element) {
37
37
  if (element === null || typeof element !== 'object') {
38
38
  return;
39
39
  }
40
40
  var ref = element.ref;
41
41
  if (ref != null) {
42
- attachRef(ref, instance, element._owner, transaction);
42
+ attachRef(ref, instance, element._owner);
43
43
  }
44
44
  };
45
45
 
@@ -11,10 +11,8 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var _require = require('./ReactFiber');
15
-
16
- var createFiberFromElementType = _require.createFiberFromElementType;
17
-
14
+ var _require = require('./ReactFiber'),
15
+ createFiberFromElementType = _require.createFiberFromElementType;
18
16
 
19
17
  exports.createReifiedYield = function (yieldNode) {
20
18
  var fiber = createFiberFromElementType(yieldNode.continuation, yieldNode.key);
@@ -22,10 +22,9 @@ var ReactReconciler = require('./ReactReconciler');
22
22
  var ReactUpdates = require('./ReactUpdates');
23
23
 
24
24
  var emptyObject = require('fbjs/lib/emptyObject');
25
+ var getNextDebugID = require('./getNextDebugID');
25
26
  var invariant = require('fbjs/lib/invariant');
26
27
 
27
- var nextDebugID = 1;
28
-
29
28
  var NoopInternalComponent = function () {
30
29
  function NoopInternalComponent(element) {
31
30
  _classCallCheck(this, NoopInternalComponent);
@@ -34,7 +33,7 @@ var NoopInternalComponent = function () {
34
33
  this._currentElement = element;
35
34
 
36
35
  if (process.env.NODE_ENV !== 'production') {
37
- this._debugID = nextDebugID++;
36
+ this._debugID = getNextDebugID();
38
37
  }
39
38
  }
40
39
 
@@ -61,7 +60,7 @@ var NoopInternalComponent = function () {
61
60
  var ShallowComponentWrapper = function (element) {
62
61
  // TODO: Consolidate with instantiateReactComponent
63
62
  if (process.env.NODE_ENV !== 'production') {
64
- this._debugID = nextDebugID++;
63
+ this._debugID = getNextDebugID();
65
64
  }
66
65
 
67
66
  this.construct(element);
@@ -69,14 +69,14 @@ function findAllInRenderedTreeInternal(inst, test) {
69
69
  * @lends ReactTestUtils
70
70
  */
71
71
  var ReactTestUtils = {
72
- renderIntoDocument: function (instance) {
72
+ renderIntoDocument: function (element) {
73
73
  var div = document.createElement('div');
74
74
  // None of our tests actually require attaching the container to the
75
75
  // DOM, and doing so creates a mess that we rely on test isolation to
76
76
  // clean up, so we're going to stop honoring the name of this method
77
77
  // (and probably rename it eventually) if no problems arise.
78
78
  // document.documentElement.appendChild(div);
79
- return ReactDOM.render(instance, div);
79
+ return ReactDOM.render(element, div);
80
80
  },
81
81
 
82
82
  isElement: function (element) {
@@ -10,4 +10,4 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- module.exports = '15.4.0-rc.3';
13
+ module.exports = '15.4.2';
@@ -18,9 +18,9 @@ var EventPluginUtils = require('./EventPluginUtils');
18
18
  var invariant = require('fbjs/lib/invariant');
19
19
  var warning = require('fbjs/lib/warning');
20
20
 
21
- var isEndish = EventPluginUtils.isEndish;
22
- var isMoveish = EventPluginUtils.isMoveish;
23
- var isStartish = EventPluginUtils.isStartish;
21
+ var isEndish = EventPluginUtils.isEndish,
22
+ isMoveish = EventPluginUtils.isMoveish,
23
+ isStartish = EventPluginUtils.isStartish;
24
24
 
25
25
  /**
26
26
  * Tracks the position and time of each active touch by `touch.identifier`. We
@@ -80,18 +80,6 @@ function isInteractive(tag) {
80
80
  return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
81
81
  }
82
82
 
83
- function shouldPreventMouseEvent(inst) {
84
- if (inst) {
85
- var disabled = inst._currentElement && inst._currentElement.props.disabled;
86
-
87
- if (disabled) {
88
- return isInteractive(inst._tag);
89
- }
90
- }
91
-
92
- return false;
93
- }
94
-
95
83
  var SimpleEventPlugin = {
96
84
 
97
85
  eventTypes: eventTypes,
@@ -162,10 +150,7 @@ var SimpleEventPlugin = {
162
150
  case 'topMouseDown':
163
151
  case 'topMouseMove':
164
152
  case 'topMouseUp':
165
- // Disabled elements should not respond to mouse events
166
- if (shouldPreventMouseEvent(targetInst)) {
167
- return null;
168
- }
153
+ // TODO: Disabled elements should not respond to mouse events
169
154
  /* falls through */
170
155
  case 'topMouseOut':
171
156
  case 'topMouseOver':
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright 2013-present, Facebook, Inc.
3
+ * All rights reserved.
4
+ *
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.
8
+ *
9
+ *
10
+ */
11
+
12
+ 'use strict';
13
+
14
+ var nextDebugID = 1;
15
+
16
+ function getNextDebugID() {
17
+ return nextDebugID++;
18
+ }
19
+
20
+ module.exports = getNextDebugID;
@@ -17,6 +17,7 @@ var ReactCompositeComponent = require('./ReactCompositeComponent');
17
17
  var ReactEmptyComponent = require('./ReactEmptyComponent');
18
18
  var ReactHostComponent = require('./ReactHostComponent');
19
19
 
20
+ var getNextDebugID = require('./getNextDebugID');
20
21
  var invariant = require('fbjs/lib/invariant');
21
22
  var warning = require('fbjs/lib/warning');
22
23
 
@@ -49,8 +50,6 @@ function isInternalComponentType(type) {
49
50
  return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
50
51
  }
51
52
 
52
- var nextDebugID = 1;
53
-
54
53
  /**
55
54
  * Given a ReactNode, create an instance that will actually be mounted.
56
55
  *
@@ -66,7 +65,17 @@ function instantiateReactComponent(node, shouldHaveDebugID) {
66
65
  instance = ReactEmptyComponent.create(instantiateReactComponent);
67
66
  } else if (typeof node === 'object') {
68
67
  var element = node;
69
- !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== '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;
68
+ var type = element.type;
69
+ if (typeof type !== 'function' && typeof type !== 'string') {
70
+ var info = '';
71
+ if (process.env.NODE_ENV !== 'production') {
72
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
73
+ info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
74
+ }
75
+ }
76
+ info += getDeclarationErrorAddendum(element._owner);
77
+ !false ? process.env.NODE_ENV !== '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;
78
+ }
70
79
 
71
80
  // Special case string values
72
81
  if (typeof element.type === 'string') {
@@ -101,7 +110,7 @@ function instantiateReactComponent(node, shouldHaveDebugID) {
101
110
  instance._mountImage = null;
102
111
 
103
112
  if (process.env.NODE_ENV !== 'production') {
104
- instance._debugID = shouldHaveDebugID ? nextDebugID++ : 0;
113
+ instance._debugID = shouldHaveDebugID ? getNextDebugID() : 0;
105
114
  }
106
115
 
107
116
  // Internal instances should fully constructed at this point, so they should
@@ -6,8 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree. An additional grant
7
7
  * of patent rights can be found in the PATENTS file in the same directory.
8
8
  *
9
- * @providesModule renderSubtreeIntoContainer
10
- */
9
+ */
11
10
 
12
11
  'use strict';
13
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-dom",
3
- "version": "15.4.0-rc.3",
3
+ "version": "15.4.2",
4
4
  "description": "React package for working with the DOM.",
5
5
  "main": "index.js",
6
6
  "repository": "facebook/react",
@@ -18,7 +18,7 @@
18
18
  "object-assign": "^4.1.0"
19
19
  },
20
20
  "peerDependencies": {
21
- "react": "^15.4.0-rc.3"
21
+ "react": "^15.4.2"
22
22
  },
23
23
  "files": [
24
24
  "LICENSE",