Socket
Socket
Sign inDemoInstall

react

Package Overview
Dependencies
Maintainers
7
Versions
1971
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.3.2 to 15.4.0-rc.1

lib/ReactAddonsDOMDependencies.js

2

lib/canDefineProperty.js

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

*
*
* @providesModule canDefineProperty

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

try {
// $FlowFixMe https://github.com/facebook/flow/issues/285
Object.defineProperty({}, 'x', { get: function () {} });

@@ -20,0 +22,0 @@ canDefineProperty = true;

3

lib/LinkedStateMixin.js

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

*
* @param {string} key state key to update. Note: you may want to use keyOf()
* if you're using Google Closure Compiler advanced mode.
* @param {string} key state key to update.
* @return {ReactLink} ReactLink instance linking to the state.

@@ -31,0 +30,0 @@ */

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

* @providesModule PooledClass
*
*/

@@ -103,2 +104,4 @@

var addPoolingTo = function (CopyConstructor, pooler) {
// Casting as any so that flow ignores the actual implementation and trusts
// it to match the type we declared
var NewKlass = CopyConstructor;

@@ -105,0 +108,0 @@ NewKlass.instancePool = [];

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

var ReactElement = require('./ReactElement');
var ReactPropTypeLocations = require('./ReactPropTypeLocations');
var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames');

@@ -26,33 +25,17 @@ var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue');

var invariant = require('fbjs/lib/invariant');
var keyMirror = require('fbjs/lib/keyMirror');
var keyOf = require('fbjs/lib/keyOf');
var warning = require('fbjs/lib/warning');
var MIXINS_KEY = keyOf({ mixins: null });
var MIXINS_KEY = 'mixins';
// Helper function to allow the creation of anonymous functions which do not
// have .name set to the name of the variable being assigned to.
function identity(fn) {
return fn;
}
/**
* Policies that describe methods in `ReactClassInterface`.
*/
var SpecPolicy = keyMirror({
/**
* These methods may be defined only once by the class specification or mixin.
*/
DEFINE_ONCE: null,
/**
* These methods may be defined by both the class specification and mixins.
* Subsequent definitions will be chained. These methods must return void.
*/
DEFINE_MANY: null,
/**
* These methods are overriding the base class.
*/
OVERRIDE_BASE: null,
/**
* These methods are similar to DEFINE_MANY, except we assume they return
* objects. We try to merge the keys of the return values of all the mixed in
* functions. If there is a key conflict we throw.
*/
DEFINE_MANY_MERGED: null
});
var injectedMixins = [];

@@ -90,3 +73,3 @@

*/
mixins: SpecPolicy.DEFINE_MANY,
mixins: 'DEFINE_MANY',

@@ -100,3 +83,3 @@ /**

*/
statics: SpecPolicy.DEFINE_MANY,
statics: 'DEFINE_MANY',

@@ -109,3 +92,3 @@ /**

*/
propTypes: SpecPolicy.DEFINE_MANY,
propTypes: 'DEFINE_MANY',

@@ -118,3 +101,3 @@ /**

*/
contextTypes: SpecPolicy.DEFINE_MANY,
contextTypes: 'DEFINE_MANY',

@@ -127,3 +110,3 @@ /**

*/
childContextTypes: SpecPolicy.DEFINE_MANY,
childContextTypes: 'DEFINE_MANY',

@@ -142,3 +125,3 @@ // ==== Definition methods ====

*/
getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
getDefaultProps: 'DEFINE_MANY_MERGED',

@@ -159,3 +142,3 @@ /**

*/
getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
getInitialState: 'DEFINE_MANY_MERGED',

@@ -166,3 +149,3 @@ /**

*/
getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
getChildContext: 'DEFINE_MANY_MERGED',

@@ -185,3 +168,3 @@ /**

*/
render: SpecPolicy.DEFINE_ONCE,
render: 'DEFINE_ONCE',

@@ -197,3 +180,3 @@ // ==== Delegate methods ====

*/
componentWillMount: SpecPolicy.DEFINE_MANY,
componentWillMount: 'DEFINE_MANY',

@@ -210,3 +193,3 @@ /**

*/
componentDidMount: SpecPolicy.DEFINE_MANY,
componentDidMount: 'DEFINE_MANY',

@@ -232,3 +215,3 @@ /**

*/
componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
componentWillReceiveProps: 'DEFINE_MANY',

@@ -255,3 +238,3 @@ /**

*/
shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
shouldComponentUpdate: 'DEFINE_ONCE',

@@ -273,3 +256,3 @@ /**

*/
componentWillUpdate: SpecPolicy.DEFINE_MANY,
componentWillUpdate: 'DEFINE_MANY',

@@ -288,3 +271,3 @@ /**

*/
componentDidUpdate: SpecPolicy.DEFINE_MANY,
componentDidUpdate: 'DEFINE_MANY',

@@ -302,3 +285,3 @@ /**

*/
componentWillUnmount: SpecPolicy.DEFINE_MANY,
componentWillUnmount: 'DEFINE_MANY',

@@ -317,3 +300,3 @@ // ==== Advanced methods ====

*/
updateComponent: SpecPolicy.OVERRIDE_BASE
updateComponent: 'OVERRIDE_BASE'

@@ -344,3 +327,3 @@ };

if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
validateTypeDef(Constructor, childContextTypes, 'childContext');
}

@@ -351,3 +334,3 @@ Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);

if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
validateTypeDef(Constructor, contextTypes, 'context');
}

@@ -369,3 +352,3 @@ Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);

if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
validateTypeDef(Constructor, propTypes, 'prop');
}

@@ -379,3 +362,2 @@ Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);

// noop
function validateTypeDef(Constructor, typeDef, location) {

@@ -396,3 +378,3 @@ for (var propName in typeDef) {

if (ReactClassMixin.hasOwnProperty(name)) {
!(specPolicy === SpecPolicy.OVERRIDE_BASE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.', name) : _prodInvariant('73', name) : void 0;
!(specPolicy === 'OVERRIDE_BASE') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.', name) : _prodInvariant('73', name) : void 0;
}

@@ -402,3 +384,3 @@

if (isAlreadyDefined) {
!(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('74', name) : void 0;
!(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : _prodInvariant('74', name) : void 0;
}

@@ -469,9 +451,9 @@ }

// These cases should already be caught by validateMethodOverride.
!(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;
!(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;
// For methods which are defined more than once, call the existing
// methods before calling the new property, merging if appropriate.
if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
if (specPolicy === 'DEFINE_MANY_MERGED') {
proto[name] = createMergedResultFunction(proto[name], property);
} else if (specPolicy === SpecPolicy.DEFINE_MANY) {
} else if (specPolicy === 'DEFINE_MANY') {
proto[name] = createChainedFunction(proto[name], property);

@@ -671,3 +653,6 @@ }

createClass: function (spec) {
var Constructor = function (props, context, updater) {
// To keep our warnings more understandable, we'll use a little hack here to
// ensure that Constructor.name !== 'Constructor'. This makes sure we don't
// unnecessarily identify a class without displayName as 'Constructor'.
var Constructor = identity(function (props, context, updater) {
// This constructor gets overridden by mocks. The argument is used

@@ -707,3 +692,3 @@ // by mocks to assert on what gets mounted.

this.state = initialState;
};
});
Constructor.prototype = new ReactClassComponent();

@@ -710,0 +695,0 @@ Constructor.prototype.constructor = Constructor;

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

*
*
* @providesModule ReactComponentTreeHook

@@ -53,103 +54,78 @@ */

var itemMap;
var rootIDSet;
if (canUseCollections) {
var itemMap = new Map();
var rootIDSet = new Set();
var itemByKey;
var rootByKey;
var setItem = function (id, item) {
itemMap.set(id, item);
};
var getItem = function (id) {
return itemMap.get(id);
};
var removeItem = function (id) {
itemMap['delete'](id);
};
var getItemIDs = function () {
return Array.from(itemMap.keys());
};
if (canUseCollections) {
itemMap = new Map();
rootIDSet = new Set();
var addRoot = function (id) {
rootIDSet.add(id);
};
var removeRoot = function (id) {
rootIDSet['delete'](id);
};
var getRootIDs = function () {
return Array.from(rootIDSet.keys());
};
} else {
itemByKey = {};
rootByKey = {};
}
var itemByKey = {};
var rootByKey = {};
var unmountedIDs = [];
// Use non-numeric keys to prevent V8 performance issues:
// https://github.com/facebook/react/pull/7232
var getKeyFromID = function (id) {
return '.' + id;
};
var getIDFromKey = function (key) {
return parseInt(key.substr(1), 10);
};
// Use non-numeric keys to prevent V8 performance issues:
// https://github.com/facebook/react/pull/7232
function getKeyFromID(id) {
return '.' + id;
}
function getIDFromKey(key) {
return parseInt(key.substr(1), 10);
}
function get(id) {
if (canUseCollections) {
return itemMap.get(id);
} else {
var setItem = function (id, item) {
var key = getKeyFromID(id);
itemByKey[key] = item;
};
var getItem = function (id) {
var key = getKeyFromID(id);
return itemByKey[key];
}
}
function remove(id) {
if (canUseCollections) {
itemMap['delete'](id);
} else {
};
var removeItem = function (id) {
var key = getKeyFromID(id);
delete itemByKey[key];
}
}
function create(id, element, parentID) {
var item = {
element: element,
parentID: parentID,
text: null,
childIDs: [],
isMounted: false,
updateCount: 0
};
var getItemIDs = function () {
return Object.keys(itemByKey).map(getIDFromKey);
};
if (canUseCollections) {
itemMap.set(id, item);
} else {
var addRoot = function (id) {
var key = getKeyFromID(id);
itemByKey[key] = item;
}
}
function addRoot(id) {
if (canUseCollections) {
rootIDSet.add(id);
} else {
var key = getKeyFromID(id);
rootByKey[key] = true;
}
}
function removeRoot(id) {
if (canUseCollections) {
rootIDSet['delete'](id);
} else {
};
var removeRoot = function (id) {
var key = getKeyFromID(id);
delete rootByKey[key];
}
};
var getRootIDs = function () {
return Object.keys(rootByKey).map(getIDFromKey);
};
}
function getRegisteredIDs() {
if (canUseCollections) {
return Array.from(itemMap.keys());
} else {
return Object.keys(itemByKey).map(getIDFromKey);
}
}
var unmountedIDs = [];
function getRootIDs() {
if (canUseCollections) {
return Array.from(rootIDSet.keys());
} else {
return Object.keys(rootByKey).map(getIDFromKey);
}
}
function purgeDeep(id) {
var item = get(id);
var item = getItem(id);
if (item) {
var childIDs = item.childIDs;
remove(id);
removeItem(id);
childIDs.forEach(purgeDeep);

@@ -160,3 +136,3 @@ }

function describeComponentFrame(name, source, ownerName) {
return '\n in ' + name + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
}

@@ -190,3 +166,4 @@

onSetChildren: function (id, nextChildIDs) {
var item = get(id);
var item = getItem(id);
invariant(item, 'Item must have been set');
item.childIDs = nextChildIDs;

@@ -196,3 +173,3 @@

var nextChildID = nextChildIDs[i];
var nextChild = get(nextChildID);
var nextChild = getItem(nextChildID);
!nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;

@@ -205,3 +182,3 @@ !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;

// componentWillMount currently causes not-yet-mounted components to
// be purged from our tree data so their parent ID is missing.
// be purged from our tree data so their parent id is missing.
}

@@ -212,6 +189,14 @@ !(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;

onBeforeMountComponent: function (id, element, parentID) {
create(id, element, parentID);
var item = {
element: element,
parentID: parentID,
text: null,
childIDs: [],
isMounted: false,
updateCount: 0
};
setItem(id, item);
},
onBeforeUpdateComponent: function (id, element) {
var item = get(id);
var item = getItem(id);
if (!item || !item.isMounted) {

@@ -225,3 +210,4 @@ // We may end up here as a result of setState() in componentWillUnmount().

onMountComponent: function (id) {
var item = get(id);
var item = getItem(id);
invariant(item, 'Item must have been set');
item.isMounted = true;

@@ -234,3 +220,3 @@ var isRoot = item.parentID === 0;

onUpdateComponent: function (id) {
var item = get(id);
var item = getItem(id);
if (!item || !item.isMounted) {

@@ -244,3 +230,3 @@ // We may end up here as a result of setState() in componentWillUnmount().

onUnmountComponent: function (id) {
var item = get(id);
var item = getItem(id);
if (item) {

@@ -273,3 +259,3 @@ // We need to check if it exists.

isMounted: function (id) {
var item = get(id);
var item = getItem(id);
return item ? item.isMounted : false;

@@ -280,6 +266,5 @@ },

if (topElement) {
var type = topElement.type;
var name = typeof type === 'function' ? type.displayName || type.name : type;
var name = getDisplayName(topElement);
var owner = topElement._owner;
info += describeComponentFrame(name || 'Unknown', topElement._source, owner && owner.getName());
info += describeComponentFrame(name, topElement._source, owner && owner.getName());
}

@@ -302,3 +287,3 @@

getChildIDs: function (id) {
var item = get(id);
var item = getItem(id);
return item ? item.childIDs : [];

@@ -314,3 +299,3 @@ },

getElement: function (id) {
var item = get(id);
var item = getItem(id);
return item ? item.element : null;

@@ -326,7 +311,7 @@ },

getParentID: function (id) {
var item = get(id);
var item = getItem(id);
return item ? item.parentID : null;
},
getSource: function (id) {
var item = get(id);
var item = getItem(id);
var element = item ? item.element : null;

@@ -347,3 +332,3 @@ var source = element != null ? element._source : null;

getUpdateCount: function (id) {
var item = get(id);
var item = getItem(id);
return item ? item.updateCount : 0;

@@ -353,7 +338,6 @@ },

getRegisteredIDs: getRegisteredIDs,
getRootIDs: getRootIDs
getRootIDs: getRootIDs,
getRegisteredIDs: getItemIDs
};
module.exports = ReactComponentTreeHook;

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

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var React = require('./React');

@@ -35,4 +41,4 @@

} else if (typeof props[timeoutPropName] !== 'number') {
return new Error(timeoutPropName + ' must be a number (in milliseconds)');
}
return new Error(timeoutPropName + ' must be a number (in milliseconds)');
}
}

@@ -47,44 +53,56 @@ };

*/
var ReactCSSTransitionGroup = React.createClass({
displayName: 'ReactCSSTransitionGroup',
propTypes: {
transitionName: ReactCSSTransitionGroupChild.propTypes.name,
var ReactCSSTransitionGroup = function (_React$Component) {
_inherits(ReactCSSTransitionGroup, _React$Component);
transitionAppear: React.PropTypes.bool,
transitionEnter: React.PropTypes.bool,
transitionLeave: React.PropTypes.bool,
transitionAppearTimeout: createTransitionTimeoutPropValidator('Appear'),
transitionEnterTimeout: createTransitionTimeoutPropValidator('Enter'),
transitionLeaveTimeout: createTransitionTimeoutPropValidator('Leave')
},
function ReactCSSTransitionGroup() {
var _temp, _this, _ret;
getDefaultProps: function () {
return {
transitionAppear: false,
transitionEnter: true,
transitionLeave: true
};
},
_classCallCheck(this, ReactCSSTransitionGroup);
_wrapChild: function (child) {
// We need to provide this childFactory so that
// ReactCSSTransitionGroupChild can receive updates to name, enter, and
// leave while it is leaving.
return React.createElement(ReactCSSTransitionGroupChild, {
name: this.props.transitionName,
appear: this.props.transitionAppear,
enter: this.props.transitionEnter,
leave: this.props.transitionLeave,
appearTimeout: this.props.transitionAppearTimeout,
enterTimeout: this.props.transitionEnterTimeout,
leaveTimeout: this.props.transitionLeaveTimeout
}, child);
},
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
render: function () {
return React.createElement(ReactTransitionGroup, _assign({}, this.props, { childFactory: this._wrapChild }));
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this._wrapChild = function (child) {
// We need to provide this childFactory so that
// ReactCSSTransitionGroupChild can receive updates to name, enter, and
// leave while it is leaving.
return React.createElement(ReactCSSTransitionGroupChild, {
name: _this.props.transitionName,
appear: _this.props.transitionAppear,
enter: _this.props.transitionEnter,
leave: _this.props.transitionLeave,
appearTimeout: _this.props.transitionAppearTimeout,
enterTimeout: _this.props.transitionEnterTimeout,
leaveTimeout: _this.props.transitionLeaveTimeout
}, child);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
});
ReactCSSTransitionGroup.prototype.render = function render() {
return React.createElement(ReactTransitionGroup, _assign({}, this.props, { childFactory: this._wrapChild }));
};
return ReactCSSTransitionGroup;
}(React.Component);
ReactCSSTransitionGroup.displayName = 'ReactCSSTransitionGroup';
ReactCSSTransitionGroup.propTypes = {
transitionName: ReactCSSTransitionGroupChild.propTypes.name,
transitionAppear: React.PropTypes.bool,
transitionEnter: React.PropTypes.bool,
transitionLeave: React.PropTypes.bool,
transitionAppearTimeout: createTransitionTimeoutPropValidator('Appear'),
transitionEnterTimeout: createTransitionTimeoutPropValidator('Enter'),
transitionLeaveTimeout: createTransitionTimeoutPropValidator('Leave')
};
ReactCSSTransitionGroup.defaultProps = {
transitionAppear: false,
transitionEnter: true,
transitionLeave: true
};
module.exports = ReactCSSTransitionGroup;

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

var React = require('./React');
var ReactDOM = require('./ReactDOM');
var ReactAddonsDOMDependencies = require('./ReactAddonsDOMDependencies');

@@ -54,3 +54,3 @@ var CSSCore = require('fbjs/lib/CSSCore');

transition: function (animationType, finishCallback, userSpecifiedDelay) {
var node = ReactDOM.findDOMNode(this);
var node = ReactAddonsDOMDependencies.getReactDOM().findDOMNode(this);

@@ -57,0 +57,0 @@ if (!node) {

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

* @providesModule ReactCurrentOwner
*
*/

@@ -21,3 +22,2 @@

*/
var ReactCurrentOwner = {

@@ -24,0 +24,0 @@

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

// The Symbol used to tag the ReactElement type. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
var REACT_ELEMENT_TYPE = require('./ReactElementSymbol');

@@ -129,3 +127,2 @@ var RESERVED_PROPS = {

element._store = {};
var shadowChildren = Array.isArray(props.children) ? props.children.slice(0) : props.children;

@@ -150,8 +147,2 @@ // To make comparing ReactElements easier for testing purposes, we make

});
Object.defineProperty(element, '_shadowChildren', {
configurable: false,
enumerable: false,
writable: false,
value: shadowChildren
});
// Two elements created in two different places should be considered

@@ -168,3 +159,2 @@ // equal for testing purposes and therefore we hide it from enumeration.

element._self = self;
element._shadowChildren = shadowChildren;
element._source = source;

@@ -224,2 +214,7 @@ }

}
if (process.env.NODE_ENV !== 'production') {
if (Object.freeze) {
Object.freeze(childArray);
}
}
props.children = childArray;

@@ -351,4 +346,2 @@ }

ReactElement.REACT_ELEMENT_TYPE = REACT_ELEMENT_TYPE;
module.exports = ReactElement;

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

var ReactElement = require('./ReactElement');
var ReactPropTypeLocations = require('./ReactPropTypeLocations');

@@ -154,3 +153,3 @@ var checkReactTypeSpec = require('./checkReactTypeSpec');

if (componentClass.propTypes) {
checkReactTypeSpec(componentClass.propTypes, element.props, ReactPropTypeLocations.prop, name, element, null);
checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null);
}

@@ -157,0 +156,0 @@ if (typeof componentClass.getDefaultProps === 'function') {

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

*
*
* @providesModule ReactPropTypeLocationNames

@@ -11,0 +12,0 @@ */

@@ -9,15 +9,6 @@ /**

*
*
* @providesModule ReactPropTypeLocations
*/
'use strict';
var keyMirror = require('fbjs/lib/keyMirror');
var ReactPropTypeLocations = keyMirror({
prop: null,
context: null,
childContext: null
});
module.exports = ReactPropTypeLocations;
'use strict';

@@ -134,3 +134,3 @@ /**

if (!manualPropTypeCallCache[cacheKey]) {
process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in the next major version. You may be ' + 'seeing this warning due to a third-party PropTypes library. ' + 'See https://fb.me/react-warning-dont-call-proptypes for details.', propFullName, componentName) : void 0;
process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName) : void 0;
manualPropTypeCallCache[cacheKey] = true;

@@ -143,3 +143,6 @@ }

if (isRequired) {
return new PropTypeError('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
if (props[propName] === null) {
return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
}
return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
}

@@ -146,0 +149,0 @@ return null;

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

*
*
* @providesModule ReactPropTypesSecret

@@ -11,0 +12,0 @@ */

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

var getVendorPrefixedEventName = require('./getVendorPrefixedEventName');
var getVendorPrefixedEventName = require('react-dom/lib/getVendorPrefixedEventName');

@@ -19,0 +19,0 @@ var endEvents = [];

@@ -16,4 +16,10 @@ /**

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var React = require('./React');
var ReactInstanceMap = require('./ReactInstanceMap');
var ReactAddonsDOMDependencies = require('./ReactAddonsDOMDependencies');
var ReactTransitionChildMapping = require('./ReactTransitionChildMapping');

@@ -28,31 +34,124 @@

*/
var ReactTransitionGroup = React.createClass({
displayName: 'ReactTransitionGroup',
propTypes: {
component: React.PropTypes.any,
childFactory: React.PropTypes.func
},
var ReactTransitionGroup = function (_React$Component) {
_inherits(ReactTransitionGroup, _React$Component);
getDefaultProps: function () {
return {
component: 'span',
childFactory: emptyFunction.thatReturnsArgument
};
},
function ReactTransitionGroup() {
var _temp, _this, _ret;
getInitialState: function () {
return {
_classCallCheck(this, ReactTransitionGroup);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
// TODO: can we get useful debug information to show at this point?
children: ReactTransitionChildMapping.getChildMapping(this.props.children)
};
},
children: ReactTransitionChildMapping.getChildMapping(_this.props.children)
}, _this.performAppear = function (key) {
_this.currentlyTransitioningKeys[key] = true;
componentWillMount: function () {
var component = _this.refs[key];
if (component.componentWillAppear) {
component.componentWillAppear(_this._handleDoneAppearing.bind(_this, key));
} else {
_this._handleDoneAppearing(key);
}
}, _this._handleDoneAppearing = function (key) {
var component = _this.refs[key];
if (component.componentDidAppear) {
component.componentDidAppear();
}
delete _this.currentlyTransitioningKeys[key];
var currentChildMapping;
if (process.env.NODE_ENV !== 'production') {
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(_this)._debugID);
} else {
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
}
if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
// This was removed before it had fully appeared. Remove it.
_this.performLeave(key);
}
}, _this.performEnter = function (key) {
_this.currentlyTransitioningKeys[key] = true;
var component = _this.refs[key];
if (component.componentWillEnter) {
component.componentWillEnter(_this._handleDoneEntering.bind(_this, key));
} else {
_this._handleDoneEntering(key);
}
}, _this._handleDoneEntering = function (key) {
var component = _this.refs[key];
if (component.componentDidEnter) {
component.componentDidEnter();
}
delete _this.currentlyTransitioningKeys[key];
var currentChildMapping;
if (process.env.NODE_ENV !== 'production') {
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(_this)._debugID);
} else {
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
}
if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
// This was removed before it had fully entered. Remove it.
_this.performLeave(key);
}
}, _this.performLeave = function (key) {
_this.currentlyTransitioningKeys[key] = true;
var component = _this.refs[key];
if (component.componentWillLeave) {
component.componentWillLeave(_this._handleDoneLeaving.bind(_this, key));
} else {
// Note that this is somewhat dangerous b/c it calls setState()
// again, effectively mutating the component before all the work
// is done.
_this._handleDoneLeaving(key);
}
}, _this._handleDoneLeaving = function (key) {
var component = _this.refs[key];
if (component.componentDidLeave) {
component.componentDidLeave();
}
delete _this.currentlyTransitioningKeys[key];
var currentChildMapping;
if (process.env.NODE_ENV !== 'production') {
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(_this)._debugID);
} else {
currentChildMapping = ReactTransitionChildMapping.getChildMapping(_this.props.children);
}
if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) {
// This entered again before it fully left. Add it again.
_this.performEnter(key);
} else {
_this.setState(function (state) {
var newChildren = _assign({}, state.children);
delete newChildren[key];
return { children: newChildren };
});
}
}, _temp), _possibleConstructorReturn(_this, _ret);
}
ReactTransitionGroup.prototype.componentWillMount = function componentWillMount() {
this.currentlyTransitioningKeys = {};
this.keysToEnter = [];
this.keysToLeave = [];
},
};
componentDidMount: function () {
ReactTransitionGroup.prototype.componentDidMount = function componentDidMount() {
var initialChildMapping = this.state.children;

@@ -64,8 +163,8 @@ for (var key in initialChildMapping) {

}
},
};
componentWillReceiveProps: function (nextProps) {
ReactTransitionGroup.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var nextChildMapping;
if (process.env.NODE_ENV !== 'production') {
nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children, ReactInstanceMap.get(this)._debugID);
nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children, ReactAddonsDOMDependencies.getReactInstanceMap().get(this)._debugID);
} else {

@@ -97,5 +196,5 @@ nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children);

// If we want to someday check for reordering, we could do it here.
},
};
componentDidUpdate: function () {
ReactTransitionGroup.prototype.componentDidUpdate = function componentDidUpdate() {
var keysToEnter = this.keysToEnter;

@@ -108,113 +207,5 @@ this.keysToEnter = [];

keysToLeave.forEach(this.performLeave);
},
};
performAppear: function (key) {
this.currentlyTransitioningKeys[key] = true;
var component = this.refs[key];
if (component.componentWillAppear) {
component.componentWillAppear(this._handleDoneAppearing.bind(this, key));
} else {
this._handleDoneAppearing(key);
}
},
_handleDoneAppearing: function (key) {
var component = this.refs[key];
if (component.componentDidAppear) {
component.componentDidAppear();
}
delete this.currentlyTransitioningKeys[key];
var currentChildMapping;
if (process.env.NODE_ENV !== 'production') {
currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children, ReactInstanceMap.get(this)._debugID);
} else {
currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
}
if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
// This was removed before it had fully appeared. Remove it.
this.performLeave(key);
}
},
performEnter: function (key) {
this.currentlyTransitioningKeys[key] = true;
var component = this.refs[key];
if (component.componentWillEnter) {
component.componentWillEnter(this._handleDoneEntering.bind(this, key));
} else {
this._handleDoneEntering(key);
}
},
_handleDoneEntering: function (key) {
var component = this.refs[key];
if (component.componentDidEnter) {
component.componentDidEnter();
}
delete this.currentlyTransitioningKeys[key];
var currentChildMapping;
if (process.env.NODE_ENV !== 'production') {
currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children, ReactInstanceMap.get(this)._debugID);
} else {
currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
}
if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
// This was removed before it had fully entered. Remove it.
this.performLeave(key);
}
},
performLeave: function (key) {
this.currentlyTransitioningKeys[key] = true;
var component = this.refs[key];
if (component.componentWillLeave) {
component.componentWillLeave(this._handleDoneLeaving.bind(this, key));
} else {
// Note that this is somewhat dangerous b/c it calls setState()
// again, effectively mutating the component before all the work
// is done.
this._handleDoneLeaving(key);
}
},
_handleDoneLeaving: function (key) {
var component = this.refs[key];
if (component.componentDidLeave) {
component.componentDidLeave();
}
delete this.currentlyTransitioningKeys[key];
var currentChildMapping;
if (process.env.NODE_ENV !== 'production') {
currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children, ReactInstanceMap.get(this)._debugID);
} else {
currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
}
if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) {
// This entered again before it fully left. Add it again.
this.performEnter(key);
} else {
this.setState(function (state) {
var newChildren = _assign({}, state.children);
delete newChildren[key];
return { children: newChildren };
});
}
},
render: function () {
ReactTransitionGroup.prototype.render = function render() {
// TODO: we could get rid of the need for the wrapper node

@@ -248,5 +239,18 @@ // by cloning a single child

return React.createElement(this.props.component, props, childrenToRender);
}
});
};
return ReactTransitionGroup;
}(React.Component);
ReactTransitionGroup.displayName = 'ReactTransitionGroup';
ReactTransitionGroup.propTypes = {
component: React.PropTypes.any,
childFactory: React.PropTypes.func
};
ReactTransitionGroup.defaultProps = {
component: 'span',
childFactory: emptyFunction.thatReturnsArgument
};
module.exports = ReactTransitionGroup;

@@ -16,12 +16,18 @@ /**

var ReactDOM = require('./ReactDOM');
var ReactDOMServer = require('./ReactDOMServer');
var React = require('./React');
// `version` will be added here by ReactIsomorphic.
// `version` will be added here by the React module.
var ReactUMDEntry = _assign({
__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOM,
__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOMServer
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
ReactCurrentOwner: require('./ReactCurrentOwner')
}
}, React);
if (process.env.NODE_ENV !== 'production') {
_assign(ReactUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
// ReactComponentTreeHook should not be included in production.
ReactComponentTreeHook: require('./ReactComponentTreeHook')
});
}
module.exports = ReactUMDEntry;

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

module.exports = '15.3.2';
module.exports = '15.4.0-rc.1';

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

var React = require('./React');
var ReactAddonsDOMDependencies = require('./ReactAddonsDOMDependencies');
var ReactComponentWithPureRenderMixin = require('./ReactComponentWithPureRenderMixin');

@@ -37,6 +38,18 @@ var ReactCSSTransitionGroup = require('./ReactCSSTransitionGroup');

if (process.env.NODE_ENV !== 'production') {
React.addons.Perf = require('./ReactPerf');
React.addons.TestUtils = require('./ReactTestUtils');
// For the UMD build we get these lazily from the global since they're tied
// to the DOM renderer and it hasn't loaded yet.
Object.defineProperty(React.addons, 'Perf', {
enumerable: true,
get: function () {
return ReactAddonsDOMDependencies.getReactPerf();
}
});
Object.defineProperty(React.addons, 'TestUtils', {
enumerable: true,
get: function () {
return ReactAddonsDOMDependencies.getReactTestUtils();
}
});
}
module.exports = React;

@@ -16,12 +16,18 @@ /**

var ReactDOM = require('./ReactDOM');
var ReactDOMServer = require('./ReactDOMServer');
var ReactWithAddons = require('./ReactWithAddons');
// `version` will be added here by ReactIsomorphic.
// `version` will be added here by the React module.
var ReactWithAddonsUMDEntry = _assign({
__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOM,
__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOMServer
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
ReactCurrentOwner: require('./ReactCurrentOwner')
}
}, ReactWithAddons);
if (process.env.NODE_ENV !== 'production') {
_assign(ReactWithAddonsUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
// ReactComponentTreeHook should not be included in production.
ReactComponentTreeHook: require('./ReactComponentTreeHook')
});
}
module.exports = ReactWithAddonsUMDEntry;

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

var ReactCurrentOwner = require('./ReactCurrentOwner');
var ReactElement = require('./ReactElement');
var REACT_ELEMENT_TYPE = require('./ReactElementSymbol');

@@ -29,2 +29,8 @@ var getIteratorFn = require('./getIteratorFn');

/**
* This is inlined from ReactElement since this file is shared between
* isomorphic and renderers. We could extract this to a
*
*/
/**
* TODO: Test that a single child and an array with one item have the same key

@@ -70,3 +76,6 @@ * pattern.

if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
if (children === null || type === 'string' || type === 'number' ||
// The following is inlined from ReactElement. This means we can optimize
// some checks. React Fiber also inlines this logic for similar purposes.
type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
callback(traverseContext, children,

@@ -73,0 +82,0 @@ // If it's the only child, treat the name as if it was wrapped in an array

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

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

@@ -34,8 +33,8 @@ var hasOwnProperty = {}.hasOwnProperty;

var COMMAND_PUSH = keyOf({ $push: null });
var COMMAND_UNSHIFT = keyOf({ $unshift: null });
var COMMAND_SPLICE = keyOf({ $splice: null });
var COMMAND_SET = keyOf({ $set: null });
var COMMAND_MERGE = keyOf({ $merge: null });
var COMMAND_APPLY = keyOf({ $apply: null });
var COMMAND_PUSH = '$push';
var COMMAND_UNSHIFT = '$unshift';
var COMMAND_SPLICE = '$splice';
var COMMAND_SET = '$set';
var COMMAND_MERGE = '$merge';
var COMMAND_APPLY = '$apply';

@@ -42,0 +41,0 @@ var ALL_COMMANDS_LIST = [COMMAND_PUSH, COMMAND_UNSHIFT, COMMAND_SPLICE, COMMAND_SET, COMMAND_MERGE, COMMAND_APPLY];

{
"name": "react",
"description": "React is a JavaScript library for building user interfaces.",
"version": "15.3.2",
"version": "15.4.0-rc.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