Socket
Socket
Sign inDemoInstall

react

Package Overview
Dependencies
Maintainers
7
Versions
1975
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react - npm Package Compare versions

Comparing version 15.0.3-alpha.2 to 15.1.0-alpha.1

lib/ReactComponentTreeDevtool.js

10

lib/CSSPropertyOperations.js

@@ -16,3 +16,3 @@ /**

var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
var ReactPerf = require('./ReactPerf');
var ReactInstrumentation = require('./ReactInstrumentation');

@@ -171,2 +171,6 @@ var camelizeStyleName = require('fbjs/lib/camelizeStyleName');

setValueForStyles: function (node, styles, component) {
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onNativeOperation(component._debugID, 'update styles', styles);
}
var style = node.style;

@@ -203,6 +207,2 @@ for (var styleName in styles) {

ReactPerf.measureMethods(CSSPropertyOperations, 'CSSPropertyOperations', {
setValueForStyles: 'setValueForStyles'
});
module.exports = CSSPropertyOperations;

@@ -17,3 +17,4 @@ /**

var ReactMultiChildUpdateTypes = require('./ReactMultiChildUpdateTypes');
var ReactPerf = require('./ReactPerf');
var ReactDOMComponentTree = require('./ReactDOMComponentTree');
var ReactInstrumentation = require('./ReactInstrumentation');

@@ -113,4 +114,16 @@ var createMicrosoftUnsafeLocalFunction = require('./createMicrosoftUnsafeLocalFunction');

}
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, 'replace text', stringText);
}
}
var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
if (process.env.NODE_ENV !== 'production') {
dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
ReactInstrumentation.debugTool.onNativeOperation(prevInstance._debugID, 'replace with', markup.toString());
};
}
/**

@@ -121,3 +134,3 @@ * Operations for updating with DOM children.

dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,

@@ -134,2 +147,6 @@ replaceDelimitedText: replaceDelimitedText,

processUpdates: function (parentNode, updates) {
if (process.env.NODE_ENV !== 'production') {
var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
}
for (var k = 0; k < updates.length; k++) {

@@ -140,14 +157,29 @@ var update = updates[k];

insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'insert child', { toIndex: update.toIndex, content: update.content.toString() });
}
break;
case ReactMultiChildUpdateTypes.MOVE_EXISTING:
moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'move child', { fromIndex: update.fromIndex, toIndex: update.toIndex });
}
break;
case ReactMultiChildUpdateTypes.SET_MARKUP:
setInnerHTML(parentNode, update.content);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'replace children', update.content.toString());
}
break;
case ReactMultiChildUpdateTypes.TEXT_CONTENT:
setTextContent(parentNode, update.content);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'replace text', update.content.toString());
}
break;
case ReactMultiChildUpdateTypes.REMOVE_NODE:
removeChild(parentNode, update.fromNode);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'remove child', { fromIndex: update.fromIndex });
}
break;

@@ -160,6 +192,2 @@ }

ReactPerf.measureMethods(DOMChildrenOperations, 'DOMChildrenOperations', {
replaceDelimitedText: 'replaceDelimitedText'
});
module.exports = DOMChildrenOperations;

@@ -97,2 +97,6 @@ /**

function toString() {
return this.node.nodeName;
}
function DOMLazyTree(node) {

@@ -103,3 +107,4 @@ return {

html: null,
text: null
text: null,
toString: toString
};

@@ -106,0 +111,0 @@ }

@@ -15,4 +15,5 @@ /**

var DOMProperty = require('./DOMProperty');
var ReactDOMComponentTree = require('./ReactDOMComponentTree');
var ReactDOMInstrumentation = require('./ReactDOMInstrumentation');
var ReactPerf = require('./ReactPerf');
var ReactInstrumentation = require('./ReactInstrumentation');

@@ -125,5 +126,2 @@ var quoteAttributeValueForBrowser = require('./quoteAttributeValueForBrowser');

setValueForProperty: function (node, name, value) {
if (process.env.NODE_ENV !== 'production') {
ReactDOMInstrumentation.debugTool.onSetValueForProperty(node, name, value);
}
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;

@@ -136,2 +134,3 @@ if (propertyInfo) {

this.deleteValueForProperty(node, name);
return;
} else if (propertyInfo.mustUseProperty) {

@@ -161,3 +160,11 @@ var propName = propertyInfo.propertyName;

DOMPropertyOperations.setValueForAttribute(node, name, value);
return;
}
if (process.env.NODE_ENV !== 'production') {
ReactDOMInstrumentation.debugTool.onSetValueForProperty(node, name, value);
var payload = {};
payload[name] = value;
ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
}
},

@@ -174,2 +181,8 @@

}
if (process.env.NODE_ENV !== 'production') {
var payload = {};
payload[name] = value;
ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
}
},

@@ -184,5 +197,2 @@

deleteValueForProperty: function (node, name) {
if (process.env.NODE_ENV !== 'production') {
ReactDOMInstrumentation.debugTool.onDeleteValueForProperty(node, name);
}
var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;

@@ -209,2 +219,7 @@ if (propertyInfo) {

}
if (process.env.NODE_ENV !== 'production') {
ReactDOMInstrumentation.debugTool.onDeleteValueForProperty(node, name);
ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name);
}
}

@@ -214,8 +229,2 @@

ReactPerf.measureMethods(DOMPropertyOperations, 'DOMPropertyOperations', {
setValueForProperty: 'setValueForProperty',
setValueForAttribute: 'setValueForAttribute',
deleteValueForProperty: 'deleteValueForProperty'
});
module.exports = DOMPropertyOperations;

@@ -25,2 +25,4 @@ /**

*
* See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode
*
* @param {ReactComponent|DOMElement} componentOrElement

@@ -27,0 +29,0 @@ * @return {?DOMElement} The root node of this element.

@@ -19,2 +19,3 @@ /**

var ReactNativeComponent = require('./ReactNativeComponent');
var ReactInstrumentation = require('./ReactInstrumentation');

@@ -42,2 +43,17 @@ var invariant = require('fbjs/lib/invariant');

function getDisplayName(instance) {
var element = instance._currentElement;
if (element == null) {
return '#empty';
} else if (typeof element === 'string' || typeof element === 'number') {
return '#text';
} else if (typeof element.type === 'string') {
return element.type;
} else if (instance.getName) {
return instance.getName() || 'Unknown';
} else {
return element.type.displayName || element.type.name || 'Unknown';
}
}
/**

@@ -54,2 +70,4 @@ * Check if the type reference is a known internal type. I.e. not a user

var nextDebugID = 1;
/**

@@ -65,3 +83,4 @@ * Given a ReactNode, create an instance that will actually be mounted.

if (node === null || node === false) {
var isEmpty = node === null || node === false;
if (isEmpty) {
instance = ReactEmptyComponent.create(instantiateReactComponent);

@@ -104,2 +123,14 @@ } else if (typeof node === 'object') {

if (process.env.NODE_ENV !== 'production') {
var debugID = isEmpty ? 0 : nextDebugID++;
instance._debugID = debugID;
var displayName = getDisplayName(instance);
ReactInstrumentation.debugTool.onSetDisplayName(debugID, displayName);
var owner = node && node._owner;
if (owner) {
ReactInstrumentation.debugTool.onSetOwner(debugID, owner._debugID);
}
}
// Internal instances should fully constructed at this point, so they should

@@ -106,0 +137,0 @@ // not get any new fields added to them at this point.

@@ -19,2 +19,3 @@ /**

* A simple mixin around ReactLink.forState().
* See https://facebook.github.io/react/docs/two-way-binding-helpers.html
*/

@@ -21,0 +22,0 @@ var LinkedStateMixin = {

@@ -19,7 +19,10 @@ /**

* Returns the first child in a collection of children and verifies that there
* is only one child in the collection. The current implementation of this
* function assumes that a single child gets passed without a wrapper, but the
* purpose of this helper function is to abstract away the particular structure
* of children.
* is only one child in the collection.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
*
* The current implementation of this function assumes that a single child gets
* passed without a wrapper, but the purpose of this helper function is to
* abstract away the particular structure of children.
*
* @param {?object} children Child collection structure.

@@ -26,0 +29,0 @@ * @return {ReactElement} The first and only `ReactElement` contained in the

@@ -58,2 +58,4 @@ /**

*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
*
* The provided forEachFunc(child, index) will be called for each

@@ -134,3 +136,5 @@ * leaf child.

*
* The provided mapFunction(child, index) will be called for each
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
*
* The provided mapFunction(child, key, index) will be called for each
* leaf child.

@@ -160,2 +164,4 @@ *

*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
*
* @param {?*} children Children tree container.

@@ -171,2 +177,4 @@ * @return {number} The number of children.

* return an array with appropriately re-keyed children.
*
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
*/

@@ -173,0 +181,0 @@ function toArray(children) {

@@ -630,2 +630,3 @@ /**

* Creates a composite component class given a class specification.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
*

@@ -632,0 +633,0 @@ * @param {object} spec Class specification (which must define `render`).

@@ -16,3 +16,2 @@ /**

var ReactDOMIDOperations = require('./ReactDOMIDOperations');
var ReactPerf = require('./ReactPerf');

@@ -41,6 +40,2 @@ /**

ReactPerf.measureMethods(ReactComponentBrowserEnvironment, 'ReactComponentBrowserEnvironment', {
replaceNodeWithMarkup: 'replaceNodeWithMarkup'
});
module.exports = ReactComponentBrowserEnvironment;

@@ -39,2 +39,4 @@ /**

* use `forceUpdate()` when you know deep data structures have changed.
*
* See https://facebook.github.io/react/docs/pure-render-mixin.html
*/

@@ -41,0 +43,0 @@ var ReactComponentWithPureRenderMixin = {

@@ -23,3 +23,2 @@ /**

var ReactNodeTypes = require('./ReactNodeTypes');
var ReactPerf = require('./ReactPerf');
var ReactPropTypeLocations = require('./ReactPropTypeLocations');

@@ -60,2 +59,24 @@ var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames');

function invokeComponentDidMountWithTimer() {
var publicInstance = this._instance;
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidMount');
}
publicInstance.componentDidMount();
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidMount');
}
}
function invokeComponentDidUpdateWithTimer(prevProps, prevState, prevContext) {
var publicInstance = this._instance;
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidUpdate');
}
publicInstance.componentDidUpdate(prevProps, prevState, prevContext);
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidUpdate');
}
}
function shouldConstruct(Component) {

@@ -120,2 +141,3 @@ return Component.prototype && Component.prototype.isReactComponent;

// See ReactUpdateQueue
this._updateBatchNumber = null;
this._pendingElement = null;

@@ -229,3 +251,7 @@ this._pendingStateQueue = null;

if (inst.componentDidMount) {
transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
if (process.env.NODE_ENV !== 'production') {
transaction.getReactMountReady().enqueue(invokeComponentDidMountWithTimer, this);
} else {
transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
}
}

@@ -251,7 +277,31 @@

var Component = this._currentElement.type;
var instanceOrElement;
if (shouldConstruct(Component)) {
return new Component(publicProps, publicContext, ReactUpdateQueue);
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'ctor');
}
}
instanceOrElement = new Component(publicProps, publicContext, ReactUpdateQueue);
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'ctor');
}
}
} else {
return Component(publicProps, publicContext, ReactUpdateQueue);
// This can still be an instance in case of factory components
// but we'll count this as time spent rendering as the more common case.
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');
}
}
instanceOrElement = Component(publicProps, publicContext, ReactUpdateQueue);
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');
}
}
}
return instanceOrElement;
},

@@ -286,3 +336,13 @@

if (inst.componentWillMount) {
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillMount');
}
}
inst.componentWillMount();
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillMount');
}
}
// When mounting, calls to `setState` by `componentWillMount` will set

@@ -305,2 +365,8 @@ // `this._pendingStateQueue` without triggering a re-render.

if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onSetChildren(this._debugID, this._renderedComponent._debugID !== 0 ? [this._renderedComponent._debugID] : []);
}
}
return markup;

@@ -327,2 +393,7 @@ },

inst._calledComponentWillUnmount = true;
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUnmount');
}
}
if (safely) {

@@ -334,2 +405,7 @@ var name = this.getName() + '.componentWillUnmount()';

}
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUnmount');
}
}
}

@@ -517,6 +593,6 @@

ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
}
if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
} else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
} else {
this._updateBatchNumber = null;
}

@@ -568,8 +644,31 @@ },

if (willReceive && inst.componentWillReceiveProps) {
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillReceiveProps');
}
}
inst.componentWillReceiveProps(nextProps, nextContext);
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillReceiveProps');
}
}
}
var nextState = this._processPendingState(nextProps, nextContext);
var shouldUpdate = true;
var shouldUpdate = this._pendingForceUpdate || !inst.shouldComponentUpdate || inst.shouldComponentUpdate(nextProps, nextState, nextContext);
if (!this._pendingForceUpdate && inst.shouldComponentUpdate) {
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'shouldComponentUpdate');
}
}
shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'shouldComponentUpdate');
}
}
}

@@ -580,2 +679,3 @@ if (process.env.NODE_ENV !== 'production') {

this._updateBatchNumber = null;
if (shouldUpdate) {

@@ -646,3 +746,13 @@ this._pendingForceUpdate = false;

if (inst.componentWillUpdate) {
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUpdate');
}
}
inst.componentWillUpdate(nextProps, nextState, nextContext);
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUpdate');
}
}
}

@@ -659,3 +769,7 @@

if (hasComponentDidUpdate) {
transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
if (process.env.NODE_ENV !== 'production') {
transaction.getReactMountReady().enqueue(invokeComponentDidUpdateWithTimer.bind(this, prevProps, prevState, prevContext), this);
} else {
transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
}
}

@@ -682,4 +796,12 @@ },

this._renderedComponent = this._instantiateReactComponent(nextRenderedElement);
var nextMarkup = ReactReconciler.mountComponent(this._renderedComponent, transaction, this._nativeParent, this._nativeContainerInfo, this._processChildContext(context));
this._replaceNodeWithMarkup(oldNativeNode, nextMarkup);
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onSetChildren(this._debugID, this._renderedComponent._debugID !== 0 ? [this._renderedComponent._debugID] : []);
}
}
this._replaceNodeWithMarkup(oldNativeNode, nextMarkup, prevComponentInstance);
}

@@ -693,4 +815,4 @@ },

*/
_replaceNodeWithMarkup: function (oldNativeNode, nextMarkup) {
ReactComponentEnvironment.replaceNodeWithMarkup(oldNativeNode, nextMarkup);
_replaceNodeWithMarkup: function (oldNativeNode, nextMarkup, prevInstance) {
ReactComponentEnvironment.replaceNodeWithMarkup(oldNativeNode, nextMarkup, prevInstance);
},

@@ -703,4 +825,16 @@

var inst = this._instance;
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');
}
}
var renderedComponent = inst.render();
if (process.env.NODE_ENV !== 'production') {
if (this._debugID !== 0) {
ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');
}
}
if (process.env.NODE_ENV !== 'production') {
// We allow auto-mocks to proceed as if they're returning null.

@@ -731,2 +865,3 @@ if (renderedComponent === undefined && inst.render._isMockFunction) {

renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;
return renderedComponent;

@@ -800,8 +935,2 @@ },

ReactPerf.measureMethods(ReactCompositeComponentMixin, 'ReactCompositeComponent', {
mountComponent: 'mountComponent',
updateComponent: 'updateComponent',
_renderValidatedComponent: '_renderValidatedComponent'
});
var ReactCompositeComponent = {

@@ -808,0 +937,0 @@

@@ -40,2 +40,7 @@ /**

/**
* An easy way to perform CSS transitions and animations when a React component
* enters or leaves the DOM.
* See https://facebook.github.io/react/docs/animation.html#high-level-api-reactcsstransitiongroup
*/
var ReactCSSTransitionGroup = React.createClass({

@@ -42,0 +47,0 @@ displayName: 'ReactCSSTransitionGroup',

@@ -14,3 +14,5 @@ /**

var ReactInvalidSetStateWarningDevTool = require('./ReactInvalidSetStateWarningDevTool');
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
var performanceNow = require('fbjs/lib/performanceNow');
var warning = require('fbjs/lib/warning');

@@ -36,2 +38,53 @@

var isProfiling = false;
var flushHistory = [];
var currentFlushNesting = 0;
var currentFlushMeasurements = null;
var currentFlushStartTime = null;
var currentTimerDebugID = null;
var currentTimerStartTime = null;
var currentTimerType = null;
function resetMeasurements() {
if (process.env.NODE_ENV !== 'production') {
if (!isProfiling || currentFlushNesting === 0) {
currentFlushStartTime = null;
currentFlushMeasurements = null;
return;
}
var previousStartTime = currentFlushStartTime;
var previousMeasurements = currentFlushMeasurements || [];
var previousOperations = ReactNativeOperationHistoryDevtool.getHistory();
if (previousMeasurements.length || previousOperations.length) {
var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs();
flushHistory.push({
duration: performanceNow() - previousStartTime,
measurements: previousMeasurements || [],
operations: previousOperations || [],
treeSnapshot: registeredIDs.reduce(function (tree, id) {
var ownerID = ReactComponentTreeDevtool.getOwnerID(id);
var parentID = ReactComponentTreeDevtool.getParentID(id);
tree[id] = {
displayName: ReactComponentTreeDevtool.getDisplayName(id),
text: ReactComponentTreeDevtool.getText(id),
updateCount: ReactComponentTreeDevtool.getUpdateCount(id),
childIDs: ReactComponentTreeDevtool.getChildIDs(id),
// Text nodes don't have owners but this is close enough.
ownerID: ownerID || ReactComponentTreeDevtool.getOwnerID(parentID),
parentID: parentID
};
return tree;
}, {})
});
}
currentFlushStartTime = performanceNow();
currentFlushMeasurements = [];
ReactComponentTreeDevtool.purgeUnmountedComponents();
ReactNativeOperationHistoryDevtool.clearHistory();
}
}
var ReactDebugTool = {

@@ -49,2 +102,75 @@ addDevtool: function (devtool) {

},
beginProfiling: function () {
if (process.env.NODE_ENV !== 'production') {
if (isProfiling) {
return;
}
isProfiling = true;
flushHistory.length = 0;
resetMeasurements();
}
},
endProfiling: function () {
if (process.env.NODE_ENV !== 'production') {
if (!isProfiling) {
return;
}
isProfiling = false;
resetMeasurements();
}
},
getFlushHistory: function () {
if (process.env.NODE_ENV !== 'production') {
return flushHistory;
}
},
onBeginFlush: function () {
if (process.env.NODE_ENV !== 'production') {
currentFlushNesting++;
resetMeasurements();
}
emitEvent('onBeginFlush');
},
onEndFlush: function () {
if (process.env.NODE_ENV !== 'production') {
resetMeasurements();
currentFlushNesting--;
}
emitEvent('onEndFlush');
},
onBeginLifeCycleTimer: function (debugID, timerType) {
emitEvent('onBeginLifeCycleTimer', debugID, timerType);
if (process.env.NODE_ENV !== 'production') {
if (isProfiling && currentFlushNesting > 0) {
process.env.NODE_ENV !== 'production' ? warning(!currentTimerType, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
currentTimerStartTime = performanceNow();
currentTimerDebugID = debugID;
currentTimerType = timerType;
}
}
},
onEndLifeCycleTimer: function (debugID, timerType) {
if (process.env.NODE_ENV !== 'production') {
if (isProfiling && currentFlushNesting > 0) {
process.env.NODE_ENV !== 'production' ? warning(currentTimerType === timerType, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
currentFlushMeasurements.push({
timerType: timerType,
instanceID: debugID,
duration: performanceNow() - currentTimerStartTime
});
currentTimerStartTime = null;
currentTimerDebugID = null;
currentTimerType = null;
}
}
emitEvent('onEndLifeCycleTimer', debugID, timerType);
},
onBeginReconcilerTimer: function (debugID, timerType) {
emitEvent('onBeginReconcilerTimer', debugID, timerType);
},
onEndReconcilerTimer: function (debugID, timerType) {
emitEvent('onEndReconcilerTimer', debugID, timerType);
},
onBeginProcessingChildContext: function () {

@@ -56,21 +182,47 @@ emitEvent('onBeginProcessingChildContext');

},
onNativeOperation: function (debugID, type, payload) {
emitEvent('onNativeOperation', debugID, type, payload);
},
onSetState: function () {
emitEvent('onSetState');
},
onMountRootComponent: function (internalInstance) {
emitEvent('onMountRootComponent', internalInstance);
onSetDisplayName: function (debugID, displayName) {
emitEvent('onSetDisplayName', debugID, displayName);
},
onMountComponent: function (internalInstance) {
emitEvent('onMountComponent', internalInstance);
onSetChildren: function (debugID, childDebugIDs) {
emitEvent('onSetChildren', debugID, childDebugIDs);
},
onUpdateComponent: function (internalInstance) {
emitEvent('onUpdateComponent', internalInstance);
onSetOwner: function (debugID, ownerDebugID) {
emitEvent('onSetOwner', debugID, ownerDebugID);
},
onUnmountComponent: function (internalInstance) {
emitEvent('onUnmountComponent', internalInstance);
onSetText: function (debugID, text) {
emitEvent('onSetText', debugID, text);
},
onMountRootComponent: function (debugID) {
emitEvent('onMountRootComponent', debugID);
},
onMountComponent: function (debugID) {
emitEvent('onMountComponent', debugID);
},
onUpdateComponent: function (debugID) {
emitEvent('onUpdateComponent', debugID);
},
onUnmountComponent: function (debugID) {
emitEvent('onUnmountComponent', debugID);
}
};
ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);
if (process.env.NODE_ENV !== 'production') {
var ReactInvalidSetStateWarningDevTool = require('./ReactInvalidSetStateWarningDevTool');
var ReactNativeOperationHistoryDevtool = require('./ReactNativeOperationHistoryDevtool');
var ReactComponentTreeDevtool = require('./ReactComponentTreeDevtool');
ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);
ReactDebugTool.addDevtool(ReactComponentTreeDevtool);
ReactDebugTool.addDevtool(ReactNativeOperationHistoryDevtool);
var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
if (/[?&]react_perf\b/.test(url)) {
ReactDebugTool.beginProfiling();
}
}
module.exports = ReactDebugTool;

@@ -18,3 +18,2 @@ /**

var EnterLeaveEventPlugin = require('./EnterLeaveEventPlugin');
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
var HTMLDOMPropertyConfig = require('./HTMLDOMPropertyConfig');

@@ -82,10 +81,2 @@ var ReactComponentBrowserEnvironment = require('./ReactComponentBrowserEnvironment');

ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
if (process.env.NODE_ENV !== 'production') {
var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
if (/[?&]react_perf\b/.test(url)) {
var ReactDefaultPerf = require('./ReactDefaultPerf');
ReactDefaultPerf.start();
}
}
}

@@ -92,0 +83,0 @@

@@ -19,3 +19,2 @@ /**

var ReactMount = require('./ReactMount');
var ReactPerf = require('./ReactPerf');
var ReactReconciler = require('./ReactReconciler');

@@ -32,7 +31,5 @@ var ReactUpdates = require('./ReactUpdates');

var render = ReactPerf.measure('React', 'render', ReactMount.render);
var React = {
findDOMNode: findDOMNode,
render: render,
render: ReactMount.render,
unmountComponentAtNode: ReactMount.unmountComponentAtNode,

@@ -39,0 +36,0 @@ version: ReactVersion,

@@ -36,6 +36,7 @@ /**

var ReactDOMTextarea = require('./ReactDOMTextarea');
var ReactInstrumentation = require('./ReactInstrumentation');
var ReactMultiChild = require('./ReactMultiChild');
var ReactPerf = require('./ReactPerf');
var ReactServerRenderingTransaction = require('./ReactServerRenderingTransaction');
var emptyFunction = require('fbjs/lib/emptyFunction');
var escapeTextContentForBrowser = require('./escapeTextContentForBrowser');

@@ -188,2 +189,15 @@ var invariant = require('fbjs/lib/invariant');

var setContentChildForInstrumentation = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
setContentChildForInstrumentation = function (contentToUse) {
var debugID = this._debugID;
var contentDebugID = debugID + '#text';
this._contentDebugID = contentDebugID;
ReactInstrumentation.debugTool.onSetDisplayName(contentDebugID, '#text');
ReactInstrumentation.debugTool.onSetText(contentDebugID, '' + contentToUse);
ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
};
}
// There are so many media events, it makes sense to just

@@ -349,2 +363,3 @@ // maintain a list rather than create a `trapBubbledEvent` for each

this._ancestorInfo = null;
this._contentDebugID = null;
}

@@ -595,2 +610,5 @@ }

ret = escapeTextContentForBrowser(contentToUse);
if (process.env.NODE_ENV !== 'production') {
setContentChildForInstrumentation.call(this, contentToUse);
}
} else if (childrenToUse != null) {

@@ -630,2 +648,5 @@ var mountImages = this.mountChildren(childrenToUse, transaction, context);

// TODO: Validate that text is allowed as a child of this node
if (process.env.NODE_ENV !== 'production') {
setContentChildForInstrumentation.call(this, contentToUse);
}
DOMLazyTree.queueText(lazyTree, contentToUse);

@@ -839,2 +860,5 @@ } else if (childrenToUse != null) {

this.updateTextContent('');
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
}
}

@@ -845,2 +869,6 @@

this.updateTextContent('' + nextContent);
if (process.env.NODE_ENV !== 'production') {
this._contentDebugID = this._debugID + '#text';
setContentChildForInstrumentation.call(this, nextContent);
}
}

@@ -851,3 +879,13 @@ } else if (nextHtml != null) {

}
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
}
} else if (nextChildren != null) {
if (process.env.NODE_ENV !== 'production') {
if (this._contentDebugID) {
ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
this._contentDebugID = null;
}
}
this.updateChildren(nextChildren, transaction, context);

@@ -902,2 +940,9 @@ }

this._wrapperState = null;
if (process.env.NODE_ENV !== 'production') {
if (this._contentDebugID) {
ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
this._contentDebugID = null;
}
}
},

@@ -911,9 +956,4 @@

ReactPerf.measureMethods(ReactDOMComponent.Mixin, 'ReactDOMComponent', {
mountComponent: 'mountComponent',
receiveComponent: 'receiveComponent'
});
_assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
module.exports = ReactDOMComponent;

@@ -16,3 +16,2 @@ /**

var ReactDOMComponentTree = require('./ReactDOMComponentTree');
var ReactPerf = require('./ReactPerf');

@@ -36,6 +35,2 @@ /**

ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', {
dangerouslyProcessChildrenUpdates: 'dangerouslyProcessChildrenUpdates'
});
module.exports = ReactDOMIDOperations;

@@ -88,2 +88,4 @@ /**

var owner = inst._currentElement._owner;
if (props.valueLink !== undefined && !didWarnValueLink) {

@@ -98,7 +100,7 @@ process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;

if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
didWarnCheckedDefaultChecked = true;
}
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
process.env.NODE_ENV !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
didWarnValueDefaultValue = true;

@@ -105,0 +107,0 @@ }

@@ -19,3 +19,3 @@ /**

var ReactDOMComponentTree = require('./ReactDOMComponentTree');
var ReactPerf = require('./ReactPerf');
var ReactInstrumentation = require('./ReactInstrumentation');

@@ -68,2 +68,4 @@ var escapeTextContentForBrowser = require('./escapeTextContentForBrowser');

if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onSetText(this._debugID, this._stringText);
var parentInfo;

@@ -132,2 +134,6 @@ if (nativeParent != null) {

DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onSetText(this._debugID, nextStringText);
}
}

@@ -167,7 +173,2 @@ }

ReactPerf.measureMethods(ReactDOMTextComponent.prototype, 'ReactDOMTextComponent', {
mountComponent: 'mountComponent',
receiveComponent: 'receiveComponent'
});
module.exports = ReactDOMTextComponent;

@@ -116,2 +116,6 @@ /**

/**
* Create and return a new ReactElement of the given type.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
*/
ReactElement.createElement = function (type, config, children) {

@@ -130,2 +134,7 @@ var propName;

if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(
/* eslint-disable no-proto */
config.__proto__ == null || config.__proto__ === Object.prototype,
/* eslint-enable no-proto */
'React.createElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
ref = !config.hasOwnProperty('ref') || Object.getOwnPropertyDescriptor(config, 'ref').get ? null : config.ref;

@@ -202,2 +211,6 @@ key = !config.hasOwnProperty('key') || Object.getOwnPropertyDescriptor(config, 'key').get ? null : '' + config.key;

/**
* Return a function that produces ReactElements of a given type.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
*/
ReactElement.createFactory = function (type) {

@@ -220,2 +233,6 @@ var factory = ReactElement.createElement.bind(null, type);

/**
* Clone and return a new ReactElement using element as the starting point.
* See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
*/
ReactElement.cloneElement = function (element, config, children) {

@@ -241,2 +258,9 @@ var propName;

if (config != null) {
if (process.env.NODE_ENV !== 'production') {
process.env.NODE_ENV !== 'production' ? warning(
/* eslint-disable no-proto */
config.__proto__ == null || config.__proto__ === Object.prototype,
/* eslint-enable no-proto */
'React.cloneElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
}
if (config.ref !== undefined) {

@@ -284,2 +308,4 @@ // Silently steal the ref from the parent.

/**
* Verifies the object is a ReactElement.
* See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
* @param {?object} object

@@ -286,0 +312,0 @@ * @return {boolean} True if `object` is a valid component.

@@ -14,2 +14,4 @@ /**

var SyntheticDragEvent = require('./SyntheticDragEvent');
var caughtError = null;

@@ -59,20 +61,68 @@

if (process.env.NODE_ENV !== 'production') {
/**
* To help development we can get better devtools integration by simulating a
* real browser event.
*/
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
var fakeNode = document.createElement('react');
ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
var boundFunc = func.bind(null, a, b);
var evtType = 'react-' + name;
fakeNode.addEventListener(evtType, boundFunc, false);
var evt = document.createEvent('Event');
evt.initEvent(evtType, false, false);
fakeNode.dispatchEvent(evt);
fakeNode.removeEventListener(evtType, boundFunc, false);
var fakeNode;
var cacheCanWrapEvent;
(function () {
/**
* IE and Edge don't allow access to the DataTransfer.dropEffect property when
* it's wrapped in another event. This function detects whether we're in an
* environment that behaves this way.
*
* @param {*} ev Event that is being tested
*/
var canWrapEvent = function (ev) {
if (!(ev instanceof SyntheticDragEvent)) {
return true;
} else if (cacheCanWrapEvent !== null) {
return cacheCanWrapEvent;
}
var canAccessDropEffect = false;
function handleWrappedEvent() {
try {
ev.dataTransfer.dropEffect; // eslint-disable-line no-unused-expressions
canAccessDropEffect = true;
} catch (e) {}
}
var wrappedEventName = 'react-wrappeddragevent';
var wrappedEvent = document.createEvent('Event');
wrappedEvent.initEvent(wrappedEventName, false, false);
fakeNode.addEventListener(wrappedEventName, handleWrappedEvent, false);
fakeNode.dispatchEvent(wrappedEvent);
fakeNode.removeEventListener(wrappedEventName, handleWrappedEvent, false);
cacheCanWrapEvent = canAccessDropEffect;
return canAccessDropEffect;
};
}
/**
* To help development we can get better devtools integration by simulating a
* real browser event.
*/
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
fakeNode = document.createElement('react');
ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
if (!canWrapEvent(a)) {
invokeGuardedCallback(name, func, a, b);
return;
}
var boundFunc = func.bind(null, a, b);
var evtType = 'react-' + name;
fakeNode.addEventListener(evtType, boundFunc, false);
var evt = document.createEvent('Event');
evt.initEvent(evtType, false, false);
fakeNode.dispatchEvent(evt);
fakeNode.removeEventListener(evtType, boundFunc, false);
};
}
cacheCanWrapEvent = null;
})();
}
module.exports = ReactErrorUtils;

@@ -34,4 +34,7 @@ /**

var ReactFragment = {
// Wrap a keyed object in an opaque proxy that warns you if you access any
// of its properties.
/**
* Wrap a keyed object in an opaque proxy that warns you if you access any
* of its properties.
* See https://facebook.github.io/react/docs/create-fragment.html
*/
create: function (object) {

@@ -38,0 +41,0 @@ if (typeof object !== 'object' || !object || Array.isArray(object)) {

@@ -22,3 +22,2 @@ /**

var ReactNativeComponent = require('./ReactNativeComponent');
var ReactPerf = require('./ReactPerf');
var ReactUpdates = require('./ReactUpdates');

@@ -35,3 +34,2 @@

NativeComponent: ReactNativeComponent.injection,
Perf: ReactPerf.injection,
Updates: ReactUpdates.injection

@@ -38,0 +36,0 @@ };

@@ -40,2 +40,5 @@ /**

/**
* Deprecated: An an easy way to express two-way binding with React.
* See https://facebook.github.io/react/docs/two-way-binding-helpers.html
*
* @param {*} value current value of the link

@@ -42,0 +45,0 @@ * @param {function} requestChange callback to request a change

@@ -25,3 +25,2 @@ /**

var ReactMarkupChecksum = require('./ReactMarkupChecksum');
var ReactPerf = require('./ReactPerf');
var ReactReconciler = require('./ReactReconciler');

@@ -264,2 +263,6 @@ var ReactUpdateQueue = require('./ReactUpdateQueue');

_renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onBeginFlush();
}
// Various parts of our code (such as ReactCompositeComponent's

@@ -275,2 +278,8 @@ // _renderValidatedComponent) assume that calls to render aren't nested;

if (process.env.NODE_ENV !== 'production') {
// Mute future events from the top level wrapper.
// It is an implementation detail that devtools should not know about.
componentInstance._debugID = 0;
}
// The initial render is synchronous but any updates that happen during

@@ -286,3 +295,5 @@ // rendering, in componentWillMount or componentDidMount, will be batched

if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onMountRootComponent(componentInstance);
// The instance here is TopLevelWrapper so we report mount for its child.
ReactInstrumentation.debugTool.onMountRootComponent(componentInstance._renderedComponent._debugID);
ReactInstrumentation.debugTool.onEndFlush();
}

@@ -367,2 +378,3 @@

* Renders a React component into the DOM in the supplied `container`.
* See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
*

@@ -384,2 +396,3 @@ * If the React component was previously rendered into `container`, this will

* Unmounts and destroys the React component rendered in the `container`.
* See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode
*

@@ -476,10 +489,9 @@ * @param {DOMElement} container DOM element containing a React component.

}
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(container.firstChild)._debugID, 'mount', markup.toString());
}
}
};
ReactPerf.measureMethods(ReactMount, 'ReactMount', {
_renderNewRootComponent: '_renderNewRootComponent',
_mountImageIntoNode: '_mountImageIntoNode'
});
module.exports = ReactMount;

@@ -15,2 +15,3 @@ /**

var ReactComponentEnvironment = require('./ReactComponentEnvironment');
var ReactInstrumentation = require('./ReactInstrumentation');
var ReactMultiChildUpdateTypes = require('./ReactMultiChildUpdateTypes');

@@ -22,2 +23,3 @@

var emptyFunction = require('fbjs/lib/emptyFunction');
var flattenChildren = require('./flattenChildren');

@@ -139,2 +141,11 @@ var invariant = require('fbjs/lib/invariant');

var setChildrenForInstrumentation = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
setChildrenForInstrumentation = function (children) {
ReactInstrumentation.debugTool.onSetChildren(this._debugID, children ? Object.keys(children).map(function (key) {
return children[key]._debugID;
}) : []);
};
}
/**

@@ -201,2 +212,3 @@ * ReactMultiChild are capable of reconciling multiple children.

this._renderedChildren = children;
var mountImages = [];

@@ -212,2 +224,7 @@ var index = 0;

}
if (process.env.NODE_ENV !== 'production') {
setChildrenForInstrumentation.call(this, children);
}
return mountImages;

@@ -319,2 +336,6 @@ },

this._renderedChildren = nextChildren;
if (process.env.NODE_ENV !== 'production') {
setChildrenForInstrumentation.call(this, nextChildren);
}
},

@@ -321,0 +342,0 @@

@@ -16,3 +16,2 @@ /**

var ReactMultiChildUpdateTypes = require('./ReactMultiChildUpdateTypes');
var ReactPerf = require('./ReactPerf');
var UIManager = require('UIManager');

@@ -68,5 +67,3 @@

var ReactNativeDOMIDOperations = {
dangerouslyProcessChildrenUpdates: ReactPerf.measure(
// FIXME(frantic): #4441289 Hack to avoid modifying react-tools
'ReactDOMIDOperations', 'dangerouslyProcessChildrenUpdates', dangerouslyProcessChildrenUpdates),
dangerouslyProcessChildrenUpdates: dangerouslyProcessChildrenUpdates,

@@ -79,8 +76,8 @@ /**

*/
dangerouslyReplaceNodeWithMarkupByID: ReactPerf.measure('ReactDOMIDOperations', 'dangerouslyReplaceNodeWithMarkupByID', function (id, mountImage) {
dangerouslyReplaceNodeWithMarkupByID: function (id, mountImage) {
var oldTag = id;
UIManager.replaceExistingNonRootView(oldTag, mountImage);
})
}
};
module.exports = ReactNativeDOMIDOperations;

@@ -15,5 +15,5 @@ /**

var ReactElement = require('./ReactElement');
var ReactInstrumentation = require('./ReactInstrumentation');
var ReactNativeContainerInfo = require('./ReactNativeContainerInfo');
var ReactNativeTagHandles = require('./ReactNativeTagHandles');
var ReactPerf = require('./ReactPerf');
var ReactReconciler = require('./ReactReconciler');

@@ -113,2 +113,12 @@ var ReactUpdateQueue = require('./ReactUpdateQueue');

if (process.env.NODE_ENV !== 'production') {
// Mute future events from the top level wrapper.
// It is an implementation detail that devtools should not know about.
instance._debugID = 0;
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onBeginFlush();
}
}
// The initial render is synchronous but any updates that happen during

@@ -119,2 +129,7 @@ // rendering, in componentWillMount or componentDidMount, will be batched

ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, instance, containerTag);
if (process.env.NODE_ENV !== 'production') {
// The instance here is TopLevelWrapper so we report mount for its child.
ReactInstrumentation.debugTool.onMountRootComponent(instance._renderedComponent._debugID);
ReactInstrumentation.debugTool.onEndFlush();
}
var component = instance.getPublicInstance();

@@ -131,5 +146,3 @@ if (callback) {

*/
_mountImageIntoNode: ReactPerf.measure(
// FIXME(frantic): #4441289 Hack to avoid modifying react-tools
'ReactComponentBrowserEnvironment', 'mountImageIntoNode', function (mountImage, containerID) {
_mountImageIntoNode: function (mountImage, containerID) {
// Since we now know that the `mountImage` has been mounted, we can

@@ -139,3 +152,3 @@ // mark it as such.

UIManager.setChildren(containerID, [childTag]);
}),
},

@@ -193,4 +206,2 @@ /**

ReactNativeMount.renderComponent = ReactPerf.measure('ReactMount', '_renderNewRootComponent', ReactNativeMount.renderComponent);
module.exports = ReactNativeMount;

@@ -16,2 +16,3 @@ /**

var ReactInstrumentation = require('./ReactInstrumentation');
var ReactNativeComponentTree = require('./ReactNativeComponentTree');

@@ -34,2 +35,6 @@ var ReactNativeTagHandles = require('./ReactNativeTagHandles');

mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onSetText(this._debugID, this._stringText);
}
// TODO: nativeParent should have this context already. Stop abusing context.

@@ -59,2 +64,5 @@ !context.isInAParentText ? process.env.NODE_ENV !== 'production' ? invariant(false, 'RawText "%s" must be wrapped in an explicit <Text> component.', this._stringText) : invariant(false) : void 0;

UIManager.updateView(this._rootNodeID, 'RCTRawText', { text: this._stringText });
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onSetText(this._debugID, nextStringText);
}
}

@@ -61,0 +69,0 @@ }

/**
* Copyright 2013-present, Facebook, Inc.
* Copyright 2016-present, Facebook, Inc.
* All rights reserved.

@@ -14,84 +14,406 @@ *

/**
* ReactPerf is a general AOP system designed to measure performance. This
* module only has the hooks: see ReactDefaultPerf for the analysis tool.
*/
var _assign = require('object-assign');
var ReactPerf = {
/**
* Boolean to enable/disable measurement. Set to false by default to prevent
* accidental logging and perf loss.
*/
enableMeasure: false,
var _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
/**
* Holds onto the measure function in use. By default, don't measure
* anything, but we'll override this if we inject a measure function.
*/
storedMeasure: _noMeasure,
var ReactDebugTool = require('./ReactDebugTool');
var warning = require('fbjs/lib/warning');
/**
* @param {object} object
* @param {string} objectName
* @param {object<string>} methodNames
*/
measureMethods: function (object, objectName, methodNames) {
if (process.env.NODE_ENV !== 'production') {
for (var key in methodNames) {
if (!methodNames.hasOwnProperty(key)) {
continue;
}
object[key] = ReactPerf.measure(objectName, methodNames[key], object[key]);
}
function roundFloat(val) {
var base = arguments.length <= 1 || arguments[1] === undefined ? 2 : arguments[1];
var n = Math.pow(10, base);
return Math.floor(val * n) / n;
}
function getFlushHistory() {
return ReactDebugTool.getFlushHistory();
}
function getExclusive() {
var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0];
var aggregatedStats = {};
var affectedIDs = {};
function updateAggregatedStats(treeSnapshot, instanceID, timerType, applyUpdate) {
var displayName = treeSnapshot[instanceID].displayName;
var key = displayName;
var stats = aggregatedStats[key];
if (!stats) {
affectedIDs[key] = {};
stats = aggregatedStats[key] = {
key: key,
instanceCount: 0,
counts: {},
durations: {},
totalDuration: 0
};
}
},
if (!stats.durations[timerType]) {
stats.durations[timerType] = 0;
}
if (!stats.counts[timerType]) {
stats.counts[timerType] = 0;
}
affectedIDs[key][instanceID] = true;
applyUpdate(stats);
}
/**
* Use this to wrap methods you want to measure. Zero overhead in production.
*
* @param {string} objName
* @param {string} fnName
* @param {function} func
* @return {function}
*/
measure: function (objName, fnName, func) {
if (process.env.NODE_ENV !== 'production') {
var measuredFunc = null;
var wrapper = function () {
if (ReactPerf.enableMeasure) {
if (!measuredFunc) {
measuredFunc = ReactPerf.storedMeasure(objName, fnName, func);
}
return measuredFunc.apply(this, arguments);
}
return func.apply(this, arguments);
flushHistory.forEach(function (flush) {
var measurements = flush.measurements;
var treeSnapshot = flush.treeSnapshot;
measurements.forEach(function (measurement) {
var duration = measurement.duration;
var instanceID = measurement.instanceID;
var timerType = measurement.timerType;
updateAggregatedStats(treeSnapshot, instanceID, timerType, function (stats) {
stats.totalDuration += duration;
stats.durations[timerType] += duration;
stats.counts[timerType]++;
});
});
});
return Object.keys(aggregatedStats).map(function (key) {
return _extends({}, aggregatedStats[key], {
instanceCount: Object.keys(affectedIDs[key]).length
});
}).sort(function (a, b) {
return b.totalDuration - a.totalDuration;
});
}
function getInclusive() {
var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0];
var aggregatedStats = {};
var affectedIDs = {};
function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
var _treeSnapshot$instanc = treeSnapshot[instanceID];
var displayName = _treeSnapshot$instanc.displayName;
var ownerID = _treeSnapshot$instanc.ownerID;
var owner = treeSnapshot[ownerID];
var key = (owner ? owner.displayName + ' > ' : '') + displayName;
var stats = aggregatedStats[key];
if (!stats) {
affectedIDs[key] = {};
stats = aggregatedStats[key] = {
key: key,
instanceCount: 0,
inclusiveRenderDuration: 0,
renderCount: 0
};
wrapper.displayName = objName + '_' + fnName;
return wrapper;
}
return func;
},
affectedIDs[key][instanceID] = true;
applyUpdate(stats);
}
injection: {
/**
* @param {function} measure
*/
injectMeasure: function (measure) {
ReactPerf.storedMeasure = measure;
var isCompositeByID = {};
flushHistory.forEach(function (flush) {
var measurements = flush.measurements;
measurements.forEach(function (measurement) {
var instanceID = measurement.instanceID;
var timerType = measurement.timerType;
if (timerType !== 'render') {
return;
}
isCompositeByID[instanceID] = true;
});
});
flushHistory.forEach(function (flush) {
var measurements = flush.measurements;
var treeSnapshot = flush.treeSnapshot;
measurements.forEach(function (measurement) {
var duration = measurement.duration;
var instanceID = measurement.instanceID;
var timerType = measurement.timerType;
if (timerType !== 'render') {
return;
}
updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
stats.renderCount++;
});
var nextParentID = instanceID;
while (nextParentID) {
// As we traverse parents, only count inclusive time towards composites.
// We know something is a composite if its render() was called.
if (isCompositeByID[nextParentID]) {
updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
stats.inclusiveRenderDuration += duration;
});
}
nextParentID = treeSnapshot[nextParentID].parentID;
}
});
});
return Object.keys(aggregatedStats).map(function (key) {
return _extends({}, aggregatedStats[key], {
instanceCount: Object.keys(affectedIDs[key]).length
});
}).sort(function (a, b) {
return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
});
}
function getWasted() {
var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0];
var aggregatedStats = {};
var affectedIDs = {};
function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
var _treeSnapshot$instanc2 = treeSnapshot[instanceID];
var displayName = _treeSnapshot$instanc2.displayName;
var ownerID = _treeSnapshot$instanc2.ownerID;
var owner = treeSnapshot[ownerID];
var key = (owner ? owner.displayName + ' > ' : '') + displayName;
var stats = aggregatedStats[key];
if (!stats) {
affectedIDs[key] = {};
stats = aggregatedStats[key] = {
key: key,
instanceCount: 0,
inclusiveRenderDuration: 0,
renderCount: 0
};
}
affectedIDs[key][instanceID] = true;
applyUpdate(stats);
}
};
/**
* Simply passes through the measured function, without measuring it.
*
* @param {string} objName
* @param {string} fnName
* @param {function} func
* @return {function}
*/
function _noMeasure(objName, fnName, func) {
return func;
flushHistory.forEach(function (flush) {
var measurements = flush.measurements;
var treeSnapshot = flush.treeSnapshot;
var operations = flush.operations;
var isDefinitelyNotWastedByID = {};
// Find native components associated with an operation in this batch.
// Mark all components in their parent tree as definitely not wasted.
operations.forEach(function (operation) {
var instanceID = operation.instanceID;
var nextParentID = instanceID;
while (nextParentID) {
isDefinitelyNotWastedByID[nextParentID] = true;
nextParentID = treeSnapshot[nextParentID].parentID;
}
});
// Find composite components that rendered in this batch.
// These are potential candidates for being wasted renders.
var renderedCompositeIDs = {};
measurements.forEach(function (measurement) {
var instanceID = measurement.instanceID;
var timerType = measurement.timerType;
if (timerType !== 'render') {
return;
}
renderedCompositeIDs[instanceID] = true;
});
measurements.forEach(function (measurement) {
var duration = measurement.duration;
var instanceID = measurement.instanceID;
var timerType = measurement.timerType;
if (timerType !== 'render') {
return;
}
// If there was a DOM update below this component, or it has just been
// mounted, its render() is not considered wasted.
var updateCount = treeSnapshot[instanceID].updateCount;
if (isDefinitelyNotWastedByID[instanceID] || updateCount === 0) {
return;
}
// We consider this render() wasted.
updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
stats.renderCount++;
});
var nextParentID = instanceID;
while (nextParentID) {
// Any parents rendered during this batch are considered wasted
// unless we previously marked them as dirty.
var isWasted = renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID];
if (isWasted) {
updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
stats.inclusiveRenderDuration += duration;
});
}
nextParentID = treeSnapshot[nextParentID].parentID;
}
});
});
return Object.keys(aggregatedStats).map(function (key) {
return _extends({}, aggregatedStats[key], {
instanceCount: Object.keys(affectedIDs[key]).length
});
}).sort(function (a, b) {
return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
});
}
module.exports = ReactPerf;
function getOperations() {
var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0];
var stats = [];
flushHistory.forEach(function (flush, flushIndex) {
var operations = flush.operations;
var treeSnapshot = flush.treeSnapshot;
operations.forEach(function (operation) {
var instanceID = operation.instanceID;
var type = operation.type;
var payload = operation.payload;
var _treeSnapshot$instanc3 = treeSnapshot[instanceID];
var displayName = _treeSnapshot$instanc3.displayName;
var ownerID = _treeSnapshot$instanc3.ownerID;
var owner = treeSnapshot[ownerID];
var key = (owner ? owner.displayName + ' > ' : '') + displayName;
stats.push({
flushIndex: flushIndex,
instanceID: instanceID,
key: key,
type: type,
ownerID: ownerID,
payload: payload
});
});
});
return stats;
}
function printExclusive(flushHistory) {
var stats = getExclusive(flushHistory);
var table = stats.map(function (item) {
var key = item.key;
var instanceCount = item.instanceCount;
var totalDuration = item.totalDuration;
var renderCount = item.counts.render || 0;
var renderDuration = item.durations.render || 0;
return {
'Component': key,
'Total time (ms)': roundFloat(totalDuration),
'Instance count': instanceCount,
'Total render time (ms)': roundFloat(renderDuration),
'Average render time (ms)': renderCount ? roundFloat(renderDuration / renderCount) : undefined,
'Render count': renderCount,
'Total lifecycle time (ms)': roundFloat(totalDuration - renderDuration)
};
});
console.table(table);
}
function printInclusive(flushHistory) {
var stats = getInclusive(flushHistory);
var table = stats.map(function (item) {
var key = item.key;
var instanceCount = item.instanceCount;
var inclusiveRenderDuration = item.inclusiveRenderDuration;
var renderCount = item.renderCount;
return {
'Owner > Component': key,
'Inclusive render time (ms)': roundFloat(inclusiveRenderDuration),
'Instance count': instanceCount,
'Render count': renderCount
};
});
console.table(table);
}
function printWasted(flushHistory) {
var stats = getWasted(flushHistory);
var table = stats.map(function (item) {
var key = item.key;
var instanceCount = item.instanceCount;
var inclusiveRenderDuration = item.inclusiveRenderDuration;
var renderCount = item.renderCount;
return {
'Owner > Component': key,
'Inclusive wasted time (ms)': roundFloat(inclusiveRenderDuration),
'Instance count': instanceCount,
'Render count': renderCount
};
});
console.table(table);
}
function printOperations(flushHistory) {
var stats = getOperations(flushHistory);
var table = stats.map(function (stat) {
return {
'Owner > Node': stat.key,
'Operation': stat.type,
'Payload': typeof stat.payload === 'object' ? JSON.stringify(stat.payload) : stat.payload,
'Flush index': stat.flushIndex,
'Owner Component ID': stat.ownerID,
'DOM Component ID': stat.instanceID
};
});
console.table(table);
}
var warnedAboutPrintDOM = false;
function printDOM(measurements) {
process.env.NODE_ENV !== 'production' ? warning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.') : void 0;
warnedAboutPrintDOM = true;
return printOperations(measurements);
}
var warnedAboutGetMeasurementsSummaryMap = false;
function getMeasurementsSummaryMap(measurements) {
process.env.NODE_ENV !== 'production' ? warning(warnedAboutGetMeasurementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' + '`ReactPerf.getWasted(...)` instead.') : void 0;
warnedAboutGetMeasurementsSummaryMap = true;
return getWasted(measurements);
}
function start() {
ReactDebugTool.beginProfiling();
}
function stop() {
ReactDebugTool.endProfiling();
}
var ReactPerfAnalysis = {
getLastMeasurements: getFlushHistory,
getExclusive: getExclusive,
getInclusive: getInclusive,
getWasted: getWasted,
getOperations: getOperations,
printExclusive: printExclusive,
printInclusive: printInclusive,
printWasted: printWasted,
printOperations: printOperations,
start: start,
stop: stop,
// Deprecated:
printDOM: printDOM,
getMeasurementsSummaryMap: getMeasurementsSummaryMap
};
module.exports = ReactPerfAnalysis;

@@ -17,2 +17,4 @@ /**

var invariant = require('fbjs/lib/invariant');
/**

@@ -40,2 +42,7 @@ * Helper to call ReactRef.attachRefs with this composite component, split out

mountComponent: function (internalInstance, transaction, nativeParent, nativeContainerInfo, context) {
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'mountComponent');
}
}
var markup = internalInstance.mountComponent(transaction, nativeParent, nativeContainerInfo, context);

@@ -46,3 +53,6 @@ if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {

if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onMountComponent(internalInstance);
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'mountComponent');
ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
}
}

@@ -67,6 +77,14 @@ return markup;

unmountComponent: function (internalInstance, safely) {
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'unmountComponent');
}
}
ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
internalInstance.unmountComponent(safely);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onUnmountComponent(internalInstance);
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'unmountComponent');
ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
}
}

@@ -101,2 +119,8 @@ },

if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'receiveComponent');
}
}
var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);

@@ -115,3 +139,6 @@

if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onUpdateComponent(internalInstance);
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'receiveComponent');
ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
}
}

@@ -127,6 +154,20 @@ },

*/
performUpdateIfNecessary: function (internalInstance, transaction) {
performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
if (internalInstance._updateBatchNumber !== updateBatchNumber) {
// The component's enqueued batch number should always be the current
// batch or the following one.
!(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : invariant(false) : void 0;
return;
}
if (process.env.NODE_ENV !== 'production') {
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary');
}
}
internalInstance.performUpdateIfNecessary(transaction);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onUpdateComponent(internalInstance);
if (internalInstance._debugID !== 0) {
ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary');
ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
}
}

@@ -133,0 +174,0 @@ }

@@ -16,3 +16,5 @@ /**

var ReactElement = require('./ReactElement');
var ReactInstrumentation = require('./ReactInstrumentation');
var ReactMarkupChecksum = require('./ReactMarkupChecksum');
var ReactReconciler = require('./ReactReconciler');
var ReactServerBatchingStrategy = require('./ReactServerBatchingStrategy');

@@ -39,3 +41,6 @@ var ReactServerRenderingTransaction = require('./ReactServerRenderingTransaction');

var componentInstance = instantiateReactComponent(element);
var markup = componentInstance.mountComponent(transaction, null, ReactDOMContainerInfo(), emptyObject);
var markup = ReactReconciler.mountComponent(componentInstance, transaction, null, ReactDOMContainerInfo(), emptyObject);
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onUnmountComponent(componentInstance._debugID);
}
if (!makeStaticMarkup) {

@@ -54,2 +59,7 @@ markup = ReactMarkupChecksum.addChecksumToMarkup(markup);

/**
* Render a ReactElement to its initial HTML. This should only be used on the
* server.
* See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostring
*/
function renderToString(element) {

@@ -60,2 +70,7 @@ !ReactElement.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : invariant(false) : void 0;

/**
* Similar to renderToString, except this doesn't create extra DOM attributes
* such as data-react-id that React uses internally.
* See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostaticmarkup
*/
function renderToStaticMarkup(element) {

@@ -62,0 +77,0 @@ !ReactElement.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : invariant(false) : void 0;

@@ -66,2 +66,6 @@ /**

/**
* Utilities for making it easy to test React components.
*
* See https://facebook.github.io/react/docs/test-utils.html
*
* Todo: Support the entire DOM.scry query syntax. For now, these simple

@@ -68,0 +72,0 @@ * utilities will suffice for testing purposes.

@@ -21,2 +21,7 @@ /**

/**
* A basis for animatins. When children are declaratively added or removed,
* special lifecycle hooks are called.
* See https://facebook.github.io/react/docs/animation.html#low-level-api-reacttransitiongroup
*/
var ReactTransitionGroup = React.createClass({

@@ -23,0 +28,0 @@ displayName: 'ReactTransitionGroup',

@@ -19,3 +19,3 @@ /**

var ReactFeatureFlags = require('./ReactFeatureFlags');
var ReactPerf = require('./ReactPerf');
var ReactInstrumentation = require('./ReactInstrumentation');
var ReactReconciler = require('./ReactReconciler');

@@ -27,2 +27,3 @@ var Transaction = require('./Transaction');

var dirtyComponents = [];
var updateBatchNumber = 0;
var asapCallbackQueue = CallbackQueue.getPooled();

@@ -122,2 +123,9 @@ var asapEnqueued = false;

// Any updates enqueued while reconciling must be performed after this entire
// batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
// C, B could update twice in a single batch if C's render enqueues an update
// to B (since B would have already updated, we should skip it, and the only
// way we can know to do so is by checking the batch counter).
updateBatchNumber++;
for (var i = 0; i < len; i++) {

@@ -146,3 +154,3 @@ // If a component is unmounted before pending changes apply, it will still

ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction);
ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);

@@ -162,2 +170,6 @@ if (markerName) {

var flushBatchedUpdates = function () {
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onBeginFlush();
}
// ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents

@@ -182,4 +194,7 @@ // array and perform any updates enqueued by mount-ready handlers (i.e.,

}
if (process.env.NODE_ENV !== 'production') {
ReactInstrumentation.debugTool.onEndFlush();
}
};
flushBatchedUpdates = ReactPerf.measure('ReactUpdates', 'flushBatchedUpdates', flushBatchedUpdates);

@@ -205,2 +220,5 @@ /**

dirtyComponents.push(component);
if (component._updateBatchNumber == null) {
component._updateBatchNumber = updateBatchNumber + 1;
}
}

@@ -207,0 +225,0 @@

@@ -14,2 +14,2 @@ /**

module.exports = '15.0.3-alpha.2';
module.exports = '15.1.0-alpha.1';

@@ -36,3 +36,3 @@ /**

if (process.env.NODE_ENV !== 'production') {
React.addons.Perf = require('./ReactDefaultPerf');
React.addons.Perf = require('./ReactPerf');
React.addons.TestUtils = require('./ReactTestUtils');

@@ -39,0 +39,0 @@ }

@@ -19,2 +19,3 @@ /**

* See ReactComponentWithPureRenderMixin
* See also https://facebook.github.io/react/docs/shallow-compare.html
*/

@@ -21,0 +22,0 @@ function shallowCompare(instance, nextProps, nextState) {

@@ -53,2 +53,6 @@ /**

/**
* Returns a updated shallow copy of an object without mutating the original.
* See https://facebook.github.io/react/docs/update.html for details.
*/
function update(value, spec) {

@@ -55,0 +59,0 @@ !(typeof spec === 'object') ? process.env.NODE_ENV !== 'production' ? 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) : void 0;

{
"name": "react",
"description": "React is a JavaScript library for building user interfaces.",
"version": "15.0.3-alpha.2",
"version": "15.1.0-alpha.1",
"keywords": [

@@ -6,0 +6,0 @@ "react"

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc