From e83a86759bc52f799e442c38c903957b432f40c3 Mon Sep 17 00:00:00 2001 From: Robert Mosolgo Date: Tue, 4 Oct 2016 10:06:42 -0400 Subject: [PATCH] feat(react.js) update to 15.3.2 --- .../development-with-addons/react-server.js | 3370 ++++++++--------- .../development-with-addons/react.js | 3301 ++++++++-------- .../react-source/development/react-server.js | 3194 ++++++++-------- lib/assets/react-source/development/react.js | 3149 ++++++++------- .../production-with-addons/react-server.js | 12 +- .../production-with-addons/react.js | 12 +- .../react-source/production/react-server.js | 12 +- lib/assets/react-source/production/react.js | 12 +- react-builds/package.json | 20 +- 9 files changed, 6464 insertions(+), 6618 deletions(-) diff --git a/lib/assets/react-source/development-with-addons/react-server.js b/lib/assets/react-source/development-with-addons/react-server.js index 9d671d409..3073a7ef3 100644 --- a/lib/assets/react-source/development-with-addons/react-server.js +++ b/lib/assets/react-source/development-with-addons/react-server.js @@ -45,10 +45,10 @@ /***/ function(module, exports, __webpack_require__) { var React = __webpack_require__(1); - var ReactDOM = __webpack_require__(35); - var ReactDOMServer = __webpack_require__(199); + var ReactDOM = __webpack_require__(34); + var ReactDOMServer = __webpack_require__(196); - React.addons = __webpack_require__(175); + React.addons = __webpack_require__(172); window.React = React; window.ReactDOM = ReactDOM; @@ -89,10 +89,10 @@ var ReactClass = __webpack_require__(21); var ReactDOMFactories = __webpack_require__(26); var ReactElement = __webpack_require__(9); - var ReactPropTypes = __webpack_require__(32); - var ReactVersion = __webpack_require__(33); + var ReactPropTypes = __webpack_require__(31); + var ReactVersion = __webpack_require__(32); - var onlyChild = __webpack_require__(34); + var onlyChild = __webpack_require__(33); var warning = __webpack_require__(11); var createElement = ReactElement.createElement; @@ -100,7 +100,7 @@ var cloneElement = ReactElement.cloneElement; if (process.env.NODE_ENV !== 'production') { - var ReactElementValidator = __webpack_require__(28); + var ReactElementValidator = __webpack_require__(27); createElement = ReactElementValidator.createElement; createFactory = ReactElementValidator.createFactory; cloneElement = ReactElementValidator.cloneElement; @@ -174,20 +174,30 @@ var cachedSetTimeout; var cachedClearTimeout; + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); + } (function () { try { - cachedSetTimeout = setTimeout; - } catch (e) { - cachedSetTimeout = function () { - throw new Error('setTimeout is not defined'); + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; } + } catch (e) { + cachedSetTimeout = defaultSetTimout; } try { - cachedClearTimeout = clearTimeout; - } catch (e) { - cachedClearTimeout = function () { - throw new Error('clearTimeout is not defined'); + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { @@ -195,6 +205,11 @@ //normal enviroments in sane situations return setTimeout(fun, 0); } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); @@ -215,6 +230,11 @@ //normal enviroments in sane situations return clearTimeout(marker); } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); @@ -898,6 +918,34 @@ return config.key !== undefined; } + function defineKeyPropWarningGetter(props, displayName) { + var warnAboutAccessingKey = function () { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0; + } + }; + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); + } + + function defineRefPropWarningGetter(props, displayName) { + var warnAboutAccessingRef = function () { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0; + } + }; + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); + } + /** * Factory method to create a new React element. This no longer adheres to * the class pattern, so do not use new to call it. Also, no instanceof check @@ -1004,14 +1052,6 @@ var source = null; 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.createElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0; - } - if (hasValidRef(config)) { ref = config.ref; } @@ -1052,39 +1092,15 @@ } } if (process.env.NODE_ENV !== 'production') { - var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; - - // Create dummy `key` and `ref` property to `props` to warn users against its use - var warnAboutAccessingKey = function () { - if (!specialPropKeyWarningShown) { - specialPropKeyWarningShown = true; - process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0; - } - return undefined; - }; - warnAboutAccessingKey.isReactWarning = true; - - var warnAboutAccessingRef = function () { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0; - } - return undefined; - }; - warnAboutAccessingRef.isReactWarning = true; - - if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) { - if (!props.hasOwnProperty('key')) { - Object.defineProperty(props, 'key', { - get: warnAboutAccessingKey, - configurable: true - }); - } - if (!props.hasOwnProperty('ref')) { - Object.defineProperty(props, 'ref', { - get: warnAboutAccessingRef, - configurable: true - }); + if (key || ref) { + if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + if (ref) { + defineRefPropWarningGetter(props, displayName); + } } } } @@ -1136,14 +1152,6 @@ var owner = element._owner; 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 (hasValidRef(config)) { // Silently steal the ref from the parent. ref = config.ref; @@ -1266,20 +1274,12 @@ var warning = emptyFunction; if (process.env.NODE_ENV !== 'production') { - warning = function warning(condition, format) { - for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } - - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } + (function () { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - if (!condition) { var argIndex = 0; var message = 'Warning: ' + format.replace(/%s/g, function () { return args[argIndex++]; @@ -1293,8 +1293,26 @@ // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} - } - }; + }; + + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } + + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; + })(); } module.exports = warning; @@ -2860,20 +2878,15 @@ var ReactElement = __webpack_require__(9); - var mapObject = __webpack_require__(27); - /** * Create a factory that creates HTML tag elements. * - * @param {string} tag Tag name (e.g. `div`). * @private */ - function createDOMFactory(tag) { - if (process.env.NODE_ENV !== 'production') { - var ReactElementValidator = __webpack_require__(28); - return ReactElementValidator.createFactory(tag); - } - return ReactElement.createFactory(tag); + var createDOMFactory = ReactElement.createFactory; + if (process.env.NODE_ENV !== 'production') { + var ReactElementValidator = __webpack_require__(27); + createDOMFactory = ReactElementValidator.createFactory; } /** @@ -2882,204 +2895,148 @@ * * @public */ - var ReactDOMFactories = mapObject({ - a: 'a', - abbr: 'abbr', - address: 'address', - area: 'area', - article: 'article', - aside: 'aside', - audio: 'audio', - b: 'b', - base: 'base', - bdi: 'bdi', - bdo: 'bdo', - big: 'big', - blockquote: 'blockquote', - body: 'body', - br: 'br', - button: 'button', - canvas: 'canvas', - caption: 'caption', - cite: 'cite', - code: 'code', - col: 'col', - colgroup: 'colgroup', - data: 'data', - datalist: 'datalist', - dd: 'dd', - del: 'del', - details: 'details', - dfn: 'dfn', - dialog: 'dialog', - div: 'div', - dl: 'dl', - dt: 'dt', - em: 'em', - embed: 'embed', - fieldset: 'fieldset', - figcaption: 'figcaption', - figure: 'figure', - footer: 'footer', - form: 'form', - h1: 'h1', - h2: 'h2', - h3: 'h3', - h4: 'h4', - h5: 'h5', - h6: 'h6', - head: 'head', - header: 'header', - hgroup: 'hgroup', - hr: 'hr', - html: 'html', - i: 'i', - iframe: 'iframe', - img: 'img', - input: 'input', - ins: 'ins', - kbd: 'kbd', - keygen: 'keygen', - label: 'label', - legend: 'legend', - li: 'li', - link: 'link', - main: 'main', - map: 'map', - mark: 'mark', - menu: 'menu', - menuitem: 'menuitem', - meta: 'meta', - meter: 'meter', - nav: 'nav', - noscript: 'noscript', - object: 'object', - ol: 'ol', - optgroup: 'optgroup', - option: 'option', - output: 'output', - p: 'p', - param: 'param', - picture: 'picture', - pre: 'pre', - progress: 'progress', - q: 'q', - rp: 'rp', - rt: 'rt', - ruby: 'ruby', - s: 's', - samp: 'samp', - script: 'script', - section: 'section', - select: 'select', - small: 'small', - source: 'source', - span: 'span', - strong: 'strong', - style: 'style', - sub: 'sub', - summary: 'summary', - sup: 'sup', - table: 'table', - tbody: 'tbody', - td: 'td', - textarea: 'textarea', - tfoot: 'tfoot', - th: 'th', - thead: 'thead', - time: 'time', - title: 'title', - tr: 'tr', - track: 'track', - u: 'u', - ul: 'ul', - 'var': 'var', - video: 'video', - wbr: 'wbr', + var ReactDOMFactories = { + a: createDOMFactory('a'), + abbr: createDOMFactory('abbr'), + address: createDOMFactory('address'), + area: createDOMFactory('area'), + article: createDOMFactory('article'), + aside: createDOMFactory('aside'), + audio: createDOMFactory('audio'), + b: createDOMFactory('b'), + base: createDOMFactory('base'), + bdi: createDOMFactory('bdi'), + bdo: createDOMFactory('bdo'), + big: createDOMFactory('big'), + blockquote: createDOMFactory('blockquote'), + body: createDOMFactory('body'), + br: createDOMFactory('br'), + button: createDOMFactory('button'), + canvas: createDOMFactory('canvas'), + caption: createDOMFactory('caption'), + cite: createDOMFactory('cite'), + code: createDOMFactory('code'), + col: createDOMFactory('col'), + colgroup: createDOMFactory('colgroup'), + data: createDOMFactory('data'), + datalist: createDOMFactory('datalist'), + dd: createDOMFactory('dd'), + del: createDOMFactory('del'), + details: createDOMFactory('details'), + dfn: createDOMFactory('dfn'), + dialog: createDOMFactory('dialog'), + div: createDOMFactory('div'), + dl: createDOMFactory('dl'), + dt: createDOMFactory('dt'), + em: createDOMFactory('em'), + embed: createDOMFactory('embed'), + fieldset: createDOMFactory('fieldset'), + figcaption: createDOMFactory('figcaption'), + figure: createDOMFactory('figure'), + footer: createDOMFactory('footer'), + form: createDOMFactory('form'), + h1: createDOMFactory('h1'), + h2: createDOMFactory('h2'), + h3: createDOMFactory('h3'), + h4: createDOMFactory('h4'), + h5: createDOMFactory('h5'), + h6: createDOMFactory('h6'), + head: createDOMFactory('head'), + header: createDOMFactory('header'), + hgroup: createDOMFactory('hgroup'), + hr: createDOMFactory('hr'), + html: createDOMFactory('html'), + i: createDOMFactory('i'), + iframe: createDOMFactory('iframe'), + img: createDOMFactory('img'), + input: createDOMFactory('input'), + ins: createDOMFactory('ins'), + kbd: createDOMFactory('kbd'), + keygen: createDOMFactory('keygen'), + label: createDOMFactory('label'), + legend: createDOMFactory('legend'), + li: createDOMFactory('li'), + link: createDOMFactory('link'), + main: createDOMFactory('main'), + map: createDOMFactory('map'), + mark: createDOMFactory('mark'), + menu: createDOMFactory('menu'), + menuitem: createDOMFactory('menuitem'), + meta: createDOMFactory('meta'), + meter: createDOMFactory('meter'), + nav: createDOMFactory('nav'), + noscript: createDOMFactory('noscript'), + object: createDOMFactory('object'), + ol: createDOMFactory('ol'), + optgroup: createDOMFactory('optgroup'), + option: createDOMFactory('option'), + output: createDOMFactory('output'), + p: createDOMFactory('p'), + param: createDOMFactory('param'), + picture: createDOMFactory('picture'), + pre: createDOMFactory('pre'), + progress: createDOMFactory('progress'), + q: createDOMFactory('q'), + rp: createDOMFactory('rp'), + rt: createDOMFactory('rt'), + ruby: createDOMFactory('ruby'), + s: createDOMFactory('s'), + samp: createDOMFactory('samp'), + script: createDOMFactory('script'), + section: createDOMFactory('section'), + select: createDOMFactory('select'), + small: createDOMFactory('small'), + source: createDOMFactory('source'), + span: createDOMFactory('span'), + strong: createDOMFactory('strong'), + style: createDOMFactory('style'), + sub: createDOMFactory('sub'), + summary: createDOMFactory('summary'), + sup: createDOMFactory('sup'), + table: createDOMFactory('table'), + tbody: createDOMFactory('tbody'), + td: createDOMFactory('td'), + textarea: createDOMFactory('textarea'), + tfoot: createDOMFactory('tfoot'), + th: createDOMFactory('th'), + thead: createDOMFactory('thead'), + time: createDOMFactory('time'), + title: createDOMFactory('title'), + tr: createDOMFactory('tr'), + track: createDOMFactory('track'), + u: createDOMFactory('u'), + ul: createDOMFactory('ul'), + 'var': createDOMFactory('var'), + video: createDOMFactory('video'), + wbr: createDOMFactory('wbr'), // SVG - circle: 'circle', - clipPath: 'clipPath', - defs: 'defs', - ellipse: 'ellipse', - g: 'g', - image: 'image', - line: 'line', - linearGradient: 'linearGradient', - mask: 'mask', - path: 'path', - pattern: 'pattern', - polygon: 'polygon', - polyline: 'polyline', - radialGradient: 'radialGradient', - rect: 'rect', - stop: 'stop', - svg: 'svg', - text: 'text', - tspan: 'tspan' - - }, createDOMFactory); + circle: createDOMFactory('circle'), + clipPath: createDOMFactory('clipPath'), + defs: createDOMFactory('defs'), + ellipse: createDOMFactory('ellipse'), + g: createDOMFactory('g'), + image: createDOMFactory('image'), + line: createDOMFactory('line'), + linearGradient: createDOMFactory('linearGradient'), + mask: createDOMFactory('mask'), + path: createDOMFactory('path'), + pattern: createDOMFactory('pattern'), + polygon: createDOMFactory('polygon'), + polyline: createDOMFactory('polyline'), + radialGradient: createDOMFactory('radialGradient'), + rect: createDOMFactory('rect'), + stop: createDOMFactory('stop'), + svg: createDOMFactory('svg'), + text: createDOMFactory('text'), + tspan: createDOMFactory('tspan') + }; module.exports = ReactDOMFactories; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, /* 27 */ -/***/ function(module, exports) { - - /** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - - 'use strict'; - - var hasOwnProperty = Object.prototype.hasOwnProperty; - - /** - * Executes the provided `callback` once for each enumerable own property in the - * object and constructs a new object from the results. The `callback` is - * invoked with three arguments: - * - * - the property value - * - the property name - * - the object being traversed - * - * Properties that are added after the call to `mapObject` will not be visited - * by `callback`. If the values of existing properties are changed, the value - * passed to `callback` will be the value at the time `mapObject` visits them. - * Properties that are deleted before being visited are not visited. - * - * @grep function objectMap() - * @grep function objMap() - * - * @param {?object} object - * @param {function} callback - * @param {*} context - * @return {?object} - */ - function mapObject(object, callback, context) { - if (!object) { - return null; - } - var result = {}; - for (var name in object) { - if (hasOwnProperty.call(object, name)) { - result[name] = callback.call(context, object[name], name, object); - } - } - return result; - } - - module.exports = mapObject; - -/***/ }, -/* 28 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3103,11 +3060,11 @@ 'use strict'; var ReactCurrentOwner = __webpack_require__(10); - var ReactComponentTreeDevtool = __webpack_require__(29); + var ReactComponentTreeHook = __webpack_require__(28); var ReactElement = __webpack_require__(9); var ReactPropTypeLocations = __webpack_require__(22); - var checkReactTypeSpec = __webpack_require__(30); + var checkReactTypeSpec = __webpack_require__(29); var canDefineProperty = __webpack_require__(13); var getIteratorFn = __webpack_require__(15); @@ -3176,7 +3133,7 @@ childOwner = ' It was passed a child from ' + element._owner.getName() + '.'; } - process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeDevtool.getCurrentStackAddendum(element)) : void 0; + process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0; } /** @@ -3247,7 +3204,9 @@ var validType = typeof type === 'string' || typeof type === 'function'; // We warn in this case but don't throw. We expect the element creation to // succeed and there will likely be errors in render. - process.env.NODE_ENV !== 'production' ? warning(validType, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : void 0; + if (!validType) { + process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : void 0; + } var element = ReactElement.createElement.apply(this, arguments); @@ -3311,7 +3270,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 29 */ +/* 28 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3322,7 +3281,7 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule ReactComponentTreeDevtool + * @providesModule ReactComponentTreeHook */ 'use strict'; @@ -3334,32 +3293,138 @@ var invariant = __webpack_require__(8); var warning = __webpack_require__(11); - var tree = {}; - var unmountedIDs = {}; - var rootIDs = {}; + function isNative(fn) { + // Based on isNative() from Lodash + var funcToString = Function.prototype.toString; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var reIsNative = RegExp('^' + funcToString + // Take an example native function source for comparison + .call(hasOwnProperty) + // Strip regex characters so we can use it for regex + .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + // Remove hasOwnProperty from the template to make it generic + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); + try { + var source = funcToString.call(fn); + return reIsNative.test(source); + } catch (err) { + return false; + } + } + + var canUseCollections = + // Array.from + typeof Array.from === 'function' && + // Map + typeof Map === 'function' && isNative(Map) && + // Map.prototype.keys + Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) && + // Set + typeof Set === 'function' && isNative(Set) && + // Set.prototype.keys + Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys); - function updateTree(id, update) { - if (!tree[id]) { - tree[id] = { - element: null, - parentID: null, - ownerID: null, - text: null, - childIDs: [], - displayName: 'Unknown', - isMounted: false, - updateCount: 0 - }; + var itemMap; + var rootIDSet; + + var itemByKey; + var rootByKey; + + if (canUseCollections) { + itemMap = new Map(); + rootIDSet = new Set(); + } else { + itemByKey = {}; + rootByKey = {}; + } + + var unmountedIDs = []; + + // 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 key = getKeyFromID(id); + return itemByKey[key]; + } + } + + function remove(id) { + if (canUseCollections) { + itemMap['delete'](id); + } else { + 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 + }; + + if (canUseCollections) { + itemMap.set(id, item); + } else { + 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 key = getKeyFromID(id); + delete rootByKey[key]; + } + } + + function getRegisteredIDs() { + if (canUseCollections) { + return Array.from(itemMap.keys()); + } else { + return Object.keys(itemByKey).map(getIDFromKey); + } + } + + function getRootIDs() { + if (canUseCollections) { + return Array.from(rootIDSet.keys()); + } else { + return Object.keys(rootByKey).map(getIDFromKey); } - update(tree[id]); } function purgeDeep(id) { - var item = tree[id]; + var item = get(id); if (item) { var childIDs = item.childIDs; - delete tree[id]; + remove(id); childIDs.forEach(purgeDeep); } } @@ -3368,102 +3433,109 @@ return '\n in ' + name + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : ''); } + function getDisplayName(element) { + 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 { + return element.type.displayName || element.type.name || 'Unknown'; + } + } + function describeID(id) { - var name = ReactComponentTreeDevtool.getDisplayName(id); - var element = ReactComponentTreeDevtool.getElement(id); - var ownerID = ReactComponentTreeDevtool.getOwnerID(id); + var name = ReactComponentTreeHook.getDisplayName(id); + var element = ReactComponentTreeHook.getElement(id); + var ownerID = ReactComponentTreeHook.getOwnerID(id); var ownerName; if (ownerID) { - ownerName = ReactComponentTreeDevtool.getDisplayName(ownerID); + ownerName = ReactComponentTreeHook.getDisplayName(ownerID); } - process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeDevtool: Missing React element for debugID %s when ' + 'building stack', id) : void 0; + process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0; return describeComponentFrame(name, element && element._source, ownerName); } - var ReactComponentTreeDevtool = { - onSetDisplayName: function (id, displayName) { - updateTree(id, function (item) { - return item.displayName = displayName; - }); - }, + var ReactComponentTreeHook = { onSetChildren: function (id, nextChildIDs) { - updateTree(id, function (item) { - item.childIDs = nextChildIDs; - - nextChildIDs.forEach(function (nextChildID) { - var nextChild = tree[nextChildID]; - !nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected devtool events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('68') : void 0; - !(nextChild.displayName != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetDisplayName() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('69') : void 0; - !(nextChild.childIDs != null || nextChild.text != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() or onSetText() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('70') : void 0; - !nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0; - if (nextChild.parentID == null) { - nextChild.parentID = id; - // TODO: This shouldn't be necessary but mounting a new root during in - // componentWillMount currently causes not-yet-mounted components to - // be purged from our tree data so their parent ID is missing. - } - !(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetParent() and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('72', nextChildID, nextChild.parentID, id) : void 0; - }); - }); - }, - onSetOwner: function (id, ownerID) { - updateTree(id, function (item) { - return item.ownerID = ownerID; - }); - }, - onSetParent: function (id, parentID) { - updateTree(id, function (item) { - return item.parentID = parentID; - }); - }, - onSetText: function (id, text) { - updateTree(id, function (item) { - return item.text = text; - }); + var item = get(id); + item.childIDs = nextChildIDs; + + for (var i = 0; i < nextChildIDs.length; i++) { + var nextChildID = nextChildIDs[i]; + var nextChild = get(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; + !(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; + !nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0; + if (nextChild.parentID == null) { + nextChild.parentID = id; + // TODO: This shouldn't be necessary but mounting a new root during in + // componentWillMount currently causes not-yet-mounted components to + // be purged from our tree data so their parent ID is missing. + } + !(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) { - updateTree(id, function (item) { - return item.element = element; - }); + onBeforeMountComponent: function (id, element, parentID) { + create(id, element, parentID); }, onBeforeUpdateComponent: function (id, element) { - updateTree(id, function (item) { - return item.element = element; - }); + var item = get(id); + if (!item || !item.isMounted) { + // We may end up here as a result of setState() in componentWillUnmount(). + // In this case, ignore the element. + return; + } + item.element = element; }, onMountComponent: function (id) { - updateTree(id, function (item) { - return item.isMounted = true; - }); - }, - onMountRootComponent: function (id) { - rootIDs[id] = true; + var item = get(id); + item.isMounted = true; + var isRoot = item.parentID === 0; + if (isRoot) { + addRoot(id); + } }, onUpdateComponent: function (id) { - updateTree(id, function (item) { - return item.updateCount++; - }); + var item = get(id); + if (!item || !item.isMounted) { + // We may end up here as a result of setState() in componentWillUnmount(). + // In this case, ignore the element. + return; + } + item.updateCount++; }, onUnmountComponent: function (id) { - updateTree(id, function (item) { - return item.isMounted = false; - }); - unmountedIDs[id] = true; - delete rootIDs[id]; + var item = get(id); + if (item) { + // We need to check if it exists. + // `item` might not exist if it is inside an error boundary, and a sibling + // error boundary child threw while mounting. Then this instance never + // got a chance to mount, but it still gets an unmounting event during + // the error boundary cleanup. + item.isMounted = false; + var isRoot = item.parentID === 0; + if (isRoot) { + removeRoot(id); + } + } + unmountedIDs.push(id); }, purgeUnmountedComponents: function () { - if (ReactComponentTreeDevtool._preventPurging) { + if (ReactComponentTreeHook._preventPurging) { // Should only be used for testing. return; } - for (var id in unmountedIDs) { + for (var i = 0; i < unmountedIDs.length; i++) { + var id = unmountedIDs[i]; purgeDeep(id); } - unmountedIDs = {}; + unmountedIDs.length = 0; }, isMounted: function (id) { - var item = tree[id]; + var item = get(id); return item ? item.isMounted : false; }, getCurrentStackAddendum: function (topElement) { @@ -3478,64 +3550,75 @@ var currentOwner = ReactCurrentOwner.current; var id = currentOwner && currentOwner._debugID; - info += ReactComponentTreeDevtool.getStackAddendumByID(id); + info += ReactComponentTreeHook.getStackAddendumByID(id); return info; }, getStackAddendumByID: function (id) { var info = ''; while (id) { info += describeID(id); - id = ReactComponentTreeDevtool.getParentID(id); + id = ReactComponentTreeHook.getParentID(id); } return info; }, getChildIDs: function (id) { - var item = tree[id]; + var item = get(id); return item ? item.childIDs : []; }, getDisplayName: function (id) { - var item = tree[id]; - return item ? item.displayName : 'Unknown'; + var element = ReactComponentTreeHook.getElement(id); + if (!element) { + return null; + } + return getDisplayName(element); }, getElement: function (id) { - var item = tree[id]; + var item = get(id); return item ? item.element : null; }, getOwnerID: function (id) { - var item = tree[id]; - return item ? item.ownerID : null; + var element = ReactComponentTreeHook.getElement(id); + if (!element || !element._owner) { + return null; + } + return element._owner._debugID; }, getParentID: function (id) { - var item = tree[id]; + var item = get(id); return item ? item.parentID : null; }, getSource: function (id) { - var item = tree[id]; + var item = get(id); var element = item ? item.element : null; var source = element != null ? element._source : null; return source; }, getText: function (id) { - var item = tree[id]; - return item ? item.text : null; + var element = ReactComponentTreeHook.getElement(id); + if (typeof element === 'string') { + return element; + } else if (typeof element === 'number') { + return '' + element; + } else { + return null; + } }, getUpdateCount: function (id) { - var item = tree[id]; + var item = get(id); return item ? item.updateCount : 0; }, - getRootIDs: function () { - return Object.keys(rootIDs); - }, - getRegisteredIDs: function () { - return Object.keys(tree); - } + + + getRegisteredIDs: getRegisteredIDs, + + getRootIDs: getRootIDs }; - module.exports = ReactComponentTreeDevtool; + module.exports = ReactComponentTreeHook; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 30 */ +/* 29 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3554,12 +3637,12 @@ var _prodInvariant = __webpack_require__(7); var ReactPropTypeLocationNames = __webpack_require__(24); - var ReactPropTypesSecret = __webpack_require__(31); + var ReactPropTypesSecret = __webpack_require__(30); var invariant = __webpack_require__(8); var warning = __webpack_require__(11); - var ReactComponentTreeDevtool; + var ReactComponentTreeHook; if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') { // Temporary hack. @@ -3567,7 +3650,7 @@ // https://github.com/facebook/react/issues/7240 // Remove the inline requires when we don't need them anymore: // https://github.com/facebook/react/pull/7178 - ReactComponentTreeDevtool = __webpack_require__(29); + ReactComponentTreeHook = __webpack_require__(28); } var loggedTypeFailures = {}; @@ -3608,13 +3691,13 @@ var componentStackInfo = ''; if (process.env.NODE_ENV !== 'production') { - if (!ReactComponentTreeDevtool) { - ReactComponentTreeDevtool = __webpack_require__(29); + if (!ReactComponentTreeHook) { + ReactComponentTreeHook = __webpack_require__(28); } if (debugID !== null) { - componentStackInfo = ReactComponentTreeDevtool.getStackAddendumByID(debugID); + componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID); } else if (element !== null) { - componentStackInfo = ReactComponentTreeDevtool.getCurrentStackAddendum(element); + componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element); } } @@ -3628,7 +3711,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 31 */ +/* 30 */ /***/ function(module, exports) { /** @@ -3649,7 +3732,7 @@ module.exports = ReactPropTypesSecret; /***/ }, -/* 32 */ +/* 31 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3667,7 +3750,7 @@ var ReactElement = __webpack_require__(9); var ReactPropTypeLocationNames = __webpack_require__(24); - var ReactPropTypesSecret = __webpack_require__(31); + var ReactPropTypesSecret = __webpack_require__(30); var emptyFunction = __webpack_require__(12); var getIteratorFn = __webpack_require__(15); @@ -3760,6 +3843,20 @@ } /*eslint-enable no-self-compare*/ + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + function createChainableTypeChecker(validate) { if (process.env.NODE_ENV !== 'production') { var manualPropTypeCallCache = {}; @@ -3779,7 +3876,7 @@ if (props[propName] == null) { var locationName = ReactPropTypeLocationNames[location]; if (isRequired) { - return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.')); + return new PropTypeError('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.')); } return null; } else { @@ -3804,7 +3901,7 @@ // 'of type `object`'. var preciseType = getPreciseType(propValue); - return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); } return null; } @@ -3818,13 +3915,13 @@ function createArrayOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { - return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); } var propValue = props[propName]; if (!Array.isArray(propValue)) { var locationName = ReactPropTypeLocationNames[location]; var propType = getPropType(propValue); - return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); } for (var i = 0; i < propValue.length; i++) { var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); @@ -3843,7 +3940,7 @@ if (!ReactElement.isValidElement(propValue)) { var locationName = ReactPropTypeLocationNames[location]; var propType = getPropType(propValue); - return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); } return null; } @@ -3856,7 +3953,7 @@ var locationName = ReactPropTypeLocationNames[location]; var expectedClassName = expectedClass.name || ANONYMOUS; var actualClassName = getClassName(props[propName]); - return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); } return null; } @@ -3879,7 +3976,7 @@ var locationName = ReactPropTypeLocationNames[location]; var valuesString = JSON.stringify(expectedValues); - return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); } return createChainableTypeChecker(validate); } @@ -3887,13 +3984,13 @@ function createObjectOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { - return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); } var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { var locationName = ReactPropTypeLocationNames[location]; - return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); } for (var key in propValue) { if (propValue.hasOwnProperty(key)) { @@ -3923,7 +4020,7 @@ } var locationName = ReactPropTypeLocationNames[location]; - return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); } return createChainableTypeChecker(validate); } @@ -3932,7 +4029,7 @@ function validate(props, propName, componentName, location, propFullName) { if (!isNode(props[propName])) { var locationName = ReactPropTypeLocationNames[location]; - return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); } return null; } @@ -3945,7 +4042,7 @@ var propType = getPropType(propValue); if (propType !== 'object') { var locationName = ReactPropTypeLocationNames[location]; - return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } for (var key in shapeTypes) { var checker = shapeTypes[key]; @@ -4072,7 +4169,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 33 */ +/* 32 */ /***/ function(module, exports) { /** @@ -4088,10 +4185,10 @@ 'use strict'; - module.exports = '15.3.0'; + module.exports = '15.3.2'; /***/ }, -/* 34 */ +/* 33 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -4127,7 +4224,7 @@ * structure. */ function onlyChild(children) { - !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : _prodInvariant('23') : void 0; + !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0; return children; } @@ -4135,16 +4232,16 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 35 */ +/* 34 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - module.exports = __webpack_require__(36); + module.exports = __webpack_require__(35); /***/ }, -/* 36 */ +/* 35 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -4162,16 +4259,16 @@ 'use strict'; - var ReactDOMComponentTree = __webpack_require__(37); - var ReactDefaultInjection = __webpack_require__(40); - var ReactMount = __webpack_require__(167); - var ReactReconciler = __webpack_require__(60); - var ReactUpdates = __webpack_require__(57); - var ReactVersion = __webpack_require__(33); + var ReactDOMComponentTree = __webpack_require__(36); + var ReactDefaultInjection = __webpack_require__(39); + var ReactMount = __webpack_require__(162); + var ReactReconciler = __webpack_require__(59); + var ReactUpdates = __webpack_require__(56); + var ReactVersion = __webpack_require__(32); - var findDOMNode = __webpack_require__(172); - var getHostComponentFromComposite = __webpack_require__(173); - var renderSubtreeIntoContainer = __webpack_require__(174); + var findDOMNode = __webpack_require__(167); + var getHostComponentFromComposite = __webpack_require__(168); + var renderSubtreeIntoContainer = __webpack_require__(169); var warning = __webpack_require__(11); ReactDefaultInjection.inject(); @@ -4212,7 +4309,7 @@ } if (process.env.NODE_ENV !== 'production') { - var ExecutionEnvironment = __webpack_require__(50); + var ExecutionEnvironment = __webpack_require__(49); if (ExecutionEnvironment.canUseDOM && window.top === window.self) { // First check if devtools is not installed @@ -4247,11 +4344,20 @@ } } + if (process.env.NODE_ENV !== 'production') { + var ReactInstrumentation = __webpack_require__(62); + var ReactDOMUnknownPropertyHook = __webpack_require__(170); + var ReactDOMNullInputValuePropHook = __webpack_require__(171); + + ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook); + ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook); + } + module.exports = ReactDOM; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 37 */ +/* 36 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -4269,8 +4375,8 @@ var _prodInvariant = __webpack_require__(7); - var DOMProperty = __webpack_require__(38); - var ReactDOMComponentFlags = __webpack_require__(39); + var DOMProperty = __webpack_require__(37); + var ReactDOMComponentFlags = __webpack_require__(38); var invariant = __webpack_require__(8); @@ -4338,7 +4444,7 @@ } var childInst = children[name]; var childID = getRenderedHostOrTextFromComponent(childInst)._domID; - if (childID == null) { + if (childID === 0) { // We're currently unmounting this child in ReactMultiChild; skip it. continue; } @@ -4445,7 +4551,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 38 */ +/* 37 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -4657,7 +4763,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 39 */ +/* 38 */ /***/ function(module, exports) { /** @@ -4680,7 +4786,7 @@ module.exports = ReactDOMComponentFlags; /***/ }, -/* 40 */ +/* 39 */ /***/ function(module, exports, __webpack_require__) { /** @@ -4696,24 +4802,24 @@ 'use strict'; - var BeforeInputEventPlugin = __webpack_require__(41); - var ChangeEventPlugin = __webpack_require__(56); - var DefaultEventPluginOrder = __webpack_require__(74); - var EnterLeaveEventPlugin = __webpack_require__(75); - var HTMLDOMPropertyConfig = __webpack_require__(80); - var ReactComponentBrowserEnvironment = __webpack_require__(81); - var ReactDOMComponent = __webpack_require__(95); - var ReactDOMComponentTree = __webpack_require__(37); - var ReactDOMEmptyComponent = __webpack_require__(138); - var ReactDOMTreeTraversal = __webpack_require__(139); - var ReactDOMTextComponent = __webpack_require__(140); - var ReactDefaultBatchingStrategy = __webpack_require__(141); - var ReactEventListener = __webpack_require__(142); - var ReactInjection = __webpack_require__(145); - var ReactReconcileTransaction = __webpack_require__(146); - var SVGDOMPropertyConfig = __webpack_require__(154); - var SelectEventPlugin = __webpack_require__(155); - var SimpleEventPlugin = __webpack_require__(156); + var BeforeInputEventPlugin = __webpack_require__(40); + var ChangeEventPlugin = __webpack_require__(55); + var DefaultEventPluginOrder = __webpack_require__(73); + var EnterLeaveEventPlugin = __webpack_require__(74); + var HTMLDOMPropertyConfig = __webpack_require__(79); + var ReactComponentBrowserEnvironment = __webpack_require__(80); + var ReactDOMComponent = __webpack_require__(94); + var ReactDOMComponentTree = __webpack_require__(36); + var ReactDOMEmptyComponent = __webpack_require__(133); + var ReactDOMTreeTraversal = __webpack_require__(134); + var ReactDOMTextComponent = __webpack_require__(135); + var ReactDefaultBatchingStrategy = __webpack_require__(136); + var ReactEventListener = __webpack_require__(137); + var ReactInjection = __webpack_require__(140); + var ReactReconcileTransaction = __webpack_require__(141); + var SVGDOMPropertyConfig = __webpack_require__(149); + var SelectEventPlugin = __webpack_require__(150); + var SimpleEventPlugin = __webpack_require__(151); var alreadyInjected = false; @@ -4769,7 +4875,7 @@ }; /***/ }, -/* 41 */ +/* 40 */ /***/ function(module, exports, __webpack_require__) { /** @@ -4785,12 +4891,12 @@ 'use strict'; - var EventConstants = __webpack_require__(42); - var EventPropagators = __webpack_require__(43); - var ExecutionEnvironment = __webpack_require__(50); - var FallbackCompositionState = __webpack_require__(51); - var SyntheticCompositionEvent = __webpack_require__(53); - var SyntheticInputEvent = __webpack_require__(55); + var EventConstants = __webpack_require__(41); + var EventPropagators = __webpack_require__(42); + var ExecutionEnvironment = __webpack_require__(49); + var FallbackCompositionState = __webpack_require__(50); + var SyntheticCompositionEvent = __webpack_require__(52); + var SyntheticInputEvent = __webpack_require__(54); var keyOf = __webpack_require__(25); @@ -5061,8 +5167,10 @@ function getFallbackBeforeInputChars(topLevelType, nativeEvent) { // If we are currently composing (IME) and using a fallback to do so, // try to extract the composed characters from the fallback object. + // If composition event is available, we extract a string only at + // compositionevent, otherwise extract it at fallback events. if (currentComposition) { - if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) { + if (topLevelType === topLevelTypes.topCompositionEnd || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) { var chars = currentComposition.getData(); FallbackCompositionState.release(currentComposition); currentComposition = null; @@ -5162,7 +5270,7 @@ module.exports = BeforeInputEventPlugin; /***/ }, -/* 42 */ +/* 41 */ /***/ function(module, exports, __webpack_require__) { /** @@ -5264,7 +5372,7 @@ module.exports = EventConstants; /***/ }, -/* 43 */ +/* 42 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -5280,12 +5388,12 @@ 'use strict'; - var EventConstants = __webpack_require__(42); - var EventPluginHub = __webpack_require__(44); - var EventPluginUtils = __webpack_require__(46); + var EventConstants = __webpack_require__(41); + var EventPluginHub = __webpack_require__(43); + var EventPluginUtils = __webpack_require__(45); - var accumulateInto = __webpack_require__(48); - var forEachAccumulated = __webpack_require__(49); + var accumulateInto = __webpack_require__(47); + var forEachAccumulated = __webpack_require__(48); var warning = __webpack_require__(11); var PropagationPhases = EventConstants.PropagationPhases; @@ -5407,7 +5515,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 44 */ +/* 43 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -5425,12 +5533,12 @@ var _prodInvariant = __webpack_require__(7); - var EventPluginRegistry = __webpack_require__(45); - var EventPluginUtils = __webpack_require__(46); - var ReactErrorUtils = __webpack_require__(47); + var EventPluginRegistry = __webpack_require__(44); + var EventPluginUtils = __webpack_require__(45); + var ReactErrorUtils = __webpack_require__(46); - var accumulateInto = __webpack_require__(48); - var forEachAccumulated = __webpack_require__(49); + var accumulateInto = __webpack_require__(47); + var forEachAccumulated = __webpack_require__(48); var invariant = __webpack_require__(8); /** @@ -5468,6 +5576,8 @@ }; var getDictionaryKey = function (inst) { + // Prevents V8 performance issue: + // https://github.com/facebook/react/pull/7232 return '.' + inst._rootNodeID; }; @@ -5662,7 +5772,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 45 */ +/* 44 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -5915,7 +6025,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 46 */ +/* 45 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -5933,8 +6043,8 @@ var _prodInvariant = __webpack_require__(7); - var EventConstants = __webpack_require__(42); - var ReactErrorUtils = __webpack_require__(47); + var EventConstants = __webpack_require__(41); + var ReactErrorUtils = __webpack_require__(46); var invariant = __webpack_require__(8); var warning = __webpack_require__(11); @@ -6150,7 +6260,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 47 */ +/* 46 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -6232,7 +6342,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 48 */ +/* 47 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -6296,7 +6406,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 49 */ +/* 48 */ /***/ function(module, exports) { /** @@ -6332,7 +6442,7 @@ module.exports = forEachAccumulated; /***/ }, -/* 50 */ +/* 49 */ /***/ function(module, exports) { /** @@ -6372,7 +6482,7 @@ module.exports = ExecutionEnvironment; /***/ }, -/* 51 */ +/* 50 */ /***/ function(module, exports, __webpack_require__) { /** @@ -6392,7 +6502,7 @@ var PooledClass = __webpack_require__(6); - var getTextContentAccessor = __webpack_require__(52); + var getTextContentAccessor = __webpack_require__(51); /** * This helper class stores information about text content of a target node, @@ -6472,7 +6582,7 @@ module.exports = FallbackCompositionState; /***/ }, -/* 52 */ +/* 51 */ /***/ function(module, exports, __webpack_require__) { /** @@ -6488,7 +6598,7 @@ 'use strict'; - var ExecutionEnvironment = __webpack_require__(50); + var ExecutionEnvironment = __webpack_require__(49); var contentKey = null; @@ -6510,7 +6620,7 @@ module.exports = getTextContentAccessor; /***/ }, -/* 53 */ +/* 52 */ /***/ function(module, exports, __webpack_require__) { /** @@ -6526,7 +6636,7 @@ 'use strict'; - var SyntheticEvent = __webpack_require__(54); + var SyntheticEvent = __webpack_require__(53); /** * @interface Event @@ -6551,7 +6661,7 @@ module.exports = SyntheticCompositionEvent; /***/ }, -/* 54 */ +/* 53 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -6669,7 +6779,8 @@ if (event.preventDefault) { event.preventDefault(); - } else { + } else if (typeof event.returnValue !== 'unknown') { + // eslint-disable-line valid-typeof event.returnValue = false; } this.isDefaultPrevented = emptyFunction.thatReturnsTrue; @@ -6683,9 +6794,16 @@ if (event.stopPropagation) { event.stopPropagation(); - } else { + } else if (typeof event.cancelBubble !== 'unknown') { + // eslint-disable-line valid-typeof + // The ChangeEventPlugin registers a "propertychange" event for + // IE. This event does not support bubbling or cancelling, and + // any references to cancelBubble throw "Member not found". A + // typeof check of "unknown" circumvents this issue (and is also + // IE specific). event.cancelBubble = true; } + this.isPropagationStopped = emptyFunction.thatReturnsTrue; }, @@ -6817,7 +6935,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 55 */ +/* 54 */ /***/ function(module, exports, __webpack_require__) { /** @@ -6833,7 +6951,7 @@ 'use strict'; - var SyntheticEvent = __webpack_require__(54); + var SyntheticEvent = __webpack_require__(53); /** * @interface Event @@ -6859,7 +6977,7 @@ module.exports = SyntheticInputEvent; /***/ }, -/* 56 */ +/* 55 */ /***/ function(module, exports, __webpack_require__) { /** @@ -6875,17 +6993,17 @@ 'use strict'; - var EventConstants = __webpack_require__(42); - var EventPluginHub = __webpack_require__(44); - var EventPropagators = __webpack_require__(43); - var ExecutionEnvironment = __webpack_require__(50); - var ReactDOMComponentTree = __webpack_require__(37); - var ReactUpdates = __webpack_require__(57); - var SyntheticEvent = __webpack_require__(54); - - var getEventTarget = __webpack_require__(71); - var isEventSupported = __webpack_require__(72); - var isTextInputElement = __webpack_require__(73); + var EventConstants = __webpack_require__(41); + var EventPluginHub = __webpack_require__(43); + var EventPropagators = __webpack_require__(42); + var ExecutionEnvironment = __webpack_require__(49); + var ReactDOMComponentTree = __webpack_require__(36); + var ReactUpdates = __webpack_require__(56); + var SyntheticEvent = __webpack_require__(53); + + var getEventTarget = __webpack_require__(70); + var isEventSupported = __webpack_require__(71); + var isTextInputElement = __webpack_require__(72); var keyOf = __webpack_require__(25); var topLevelTypes = EventConstants.topLevelTypes; @@ -6919,7 +7037,7 @@ var doesChangeEventBubble = false; if (ExecutionEnvironment.canUseDOM) { // See `handleChange` comment below - doesChangeEventBubble = isEventSupported('change') && (!('documentMode' in document) || document.documentMode > 8); + doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8); } function manualDispatchChangeEvent(nativeEvent) { @@ -6985,7 +7103,7 @@ // deleting text, so we ignore its input events. // IE10+ fire input events to often, such when a placeholder // changes or when an input with a placeholder is focused. - isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 11); + isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 11); } /** @@ -7189,7 +7307,7 @@ module.exports = ChangeEventPlugin; /***/ }, -/* 57 */ +/* 56 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -7208,11 +7326,11 @@ var _prodInvariant = __webpack_require__(7), _assign = __webpack_require__(4); - var CallbackQueue = __webpack_require__(58); + var CallbackQueue = __webpack_require__(57); var PooledClass = __webpack_require__(6); - var ReactFeatureFlags = __webpack_require__(59); - var ReactReconciler = __webpack_require__(60); - var Transaction = __webpack_require__(70); + var ReactFeatureFlags = __webpack_require__(58); + var ReactReconciler = __webpack_require__(59); + var Transaction = __webpack_require__(69); var invariant = __webpack_require__(8); @@ -7446,7 +7564,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 58 */ +/* 57 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -7558,7 +7676,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 59 */ +/* 58 */ /***/ function(module, exports) { /** @@ -7585,7 +7703,7 @@ module.exports = ReactFeatureFlags; /***/ }, -/* 60 */ +/* 59 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -7601,8 +7719,8 @@ 'use strict'; - var ReactRef = __webpack_require__(61); - var ReactInstrumentation = __webpack_require__(63); + var ReactRef = __webpack_require__(60); + var ReactInstrumentation = __webpack_require__(62); var warning = __webpack_require__(11); @@ -7627,20 +7745,19 @@ * @final * @internal */ - mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context) { + mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID // 0 in production and for roots + ) { if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement); - ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'mountComponent'); + ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID); } } - var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context); + var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID); if (internalInstance._currentElement && internalInstance._currentElement.ref != null) { transaction.getReactMountReady().enqueue(attachRefs, internalInstance); } if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'mountComponent'); ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID); } } @@ -7664,14 +7781,13 @@ unmountComponent: function (internalInstance, safely) { if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'unmountComponent'); + ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID); } } ReactRef.detachRefs(internalInstance, internalInstance._currentElement); internalInstance.unmountComponent(safely); if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'unmountComponent'); ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID); } } @@ -7706,7 +7822,6 @@ if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement); - ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'receiveComponent'); } } @@ -7724,7 +7839,6 @@ if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'receiveComponent'); ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); } } @@ -7746,14 +7860,12 @@ } if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary'); ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement); } } internalInstance.performUpdateIfNecessary(transaction); if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary'); ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); } } @@ -7765,7 +7877,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 61 */ +/* 60 */ /***/ function(module, exports, __webpack_require__) { /** @@ -7781,7 +7893,7 @@ 'use strict'; - var ReactOwner = __webpack_require__(62); + var ReactOwner = __webpack_require__(61); var ReactRef = {}; @@ -7829,7 +7941,7 @@ var prevEmpty = prevElement === null || prevElement === false; var nextEmpty = nextElement === null || nextElement === false; - return( + return ( // This has a few false positives w/r/t empty components. prevEmpty || nextEmpty || nextElement.ref !== prevElement.ref || // If owner changes but we have an unchanged function ref, don't update refs @@ -7850,7 +7962,7 @@ module.exports = ReactRef; /***/ }, -/* 62 */ +/* 61 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -7950,7 +8062,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 63 */ +/* 62 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -7969,7 +8081,7 @@ var debugTool = null; if (process.env.NODE_ENV !== 'production') { - var ReactDebugTool = __webpack_require__(64); + var ReactDebugTool = __webpack_require__(63); debugTool = ReactDebugTool; } @@ -7977,7 +8089,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 64 */ +/* 63 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -7993,29 +8105,35 @@ 'use strict'; - var ReactInvalidSetStateWarningDevTool = __webpack_require__(65); - var ReactHostOperationHistoryDevtool = __webpack_require__(66); - var ReactComponentTreeDevtool = __webpack_require__(29); - var ReactChildrenMutationWarningDevtool = __webpack_require__(67); - var ExecutionEnvironment = __webpack_require__(50); + var ReactInvalidSetStateWarningHook = __webpack_require__(64); + var ReactHostOperationHistoryHook = __webpack_require__(65); + var ReactComponentTreeHook = __webpack_require__(28); + var ReactChildrenMutationWarningHook = __webpack_require__(66); + var ExecutionEnvironment = __webpack_require__(49); - var performanceNow = __webpack_require__(68); + var performanceNow = __webpack_require__(67); var warning = __webpack_require__(11); - var eventHandlers = []; - var handlerDoesThrowForEvent = {}; + var hooks = []; + var didHookThrowForEvent = {}; - function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) { - eventHandlers.forEach(function (handler) { - try { - if (handler[handlerFunctionName]) { - handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5); - } - } catch (e) { - process.env.NODE_ENV !== 'production' ? warning(handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e + '\n' + e.stack) : void 0; - handlerDoesThrowForEvent[handlerFunctionName] = true; + function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) { + try { + fn.call(context, arg1, arg2, arg3, arg4, arg5); + } catch (e) { + process.env.NODE_ENV !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0; + didHookThrowForEvent[event] = true; + } + } + + function emitEvent(event, arg1, arg2, arg3, arg4, arg5) { + for (var i = 0; i < hooks.length; i++) { + var hook = hooks[i]; + var fn = hook[event]; + if (fn) { + callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5); } - }); + } } var isProfiling = false; @@ -8032,21 +8150,21 @@ var lifeCycleTimerHasWarned = false; function clearHistory() { - ReactComponentTreeDevtool.purgeUnmountedComponents(); - ReactHostOperationHistoryDevtool.clearHistory(); + ReactComponentTreeHook.purgeUnmountedComponents(); + ReactHostOperationHistoryHook.clearHistory(); } function getTreeSnapshot(registeredIDs) { return registeredIDs.reduce(function (tree, id) { - var ownerID = ReactComponentTreeDevtool.getOwnerID(id); - var parentID = ReactComponentTreeDevtool.getParentID(id); + var ownerID = ReactComponentTreeHook.getOwnerID(id); + var parentID = ReactComponentTreeHook.getParentID(id); tree[id] = { - displayName: ReactComponentTreeDevtool.getDisplayName(id), - text: ReactComponentTreeDevtool.getText(id), - updateCount: ReactComponentTreeDevtool.getUpdateCount(id), - childIDs: ReactComponentTreeDevtool.getChildIDs(id), + displayName: ReactComponentTreeHook.getDisplayName(id), + text: ReactComponentTreeHook.getText(id), + updateCount: ReactComponentTreeHook.getUpdateCount(id), + childIDs: ReactComponentTreeHook.getChildIDs(id), // Text nodes don't have owners but this is close enough. - ownerID: ownerID || ReactComponentTreeDevtool.getOwnerID(parentID), + ownerID: ownerID || ReactComponentTreeHook.getOwnerID(parentID), parentID: parentID }; return tree; @@ -8056,7 +8174,7 @@ function resetMeasurements() { var previousStartTime = currentFlushStartTime; var previousMeasurements = currentFlushMeasurements || []; - var previousOperations = ReactHostOperationHistoryDevtool.getHistory(); + var previousOperations = ReactHostOperationHistoryHook.getHistory(); if (currentFlushNesting === 0) { currentFlushStartTime = null; @@ -8066,7 +8184,7 @@ } if (previousMeasurements.length || previousOperations.length) { - var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs(); + var registeredIDs = ReactComponentTreeHook.getRegisteredIDs(); flushHistory.push({ duration: performanceNow() - previousStartTime, measurements: previousMeasurements || [], @@ -8081,7 +8199,14 @@ } function checkDebugID(debugID) { - process.env.NODE_ENV !== 'production' ? warning(debugID, 'ReactDebugTool: debugID may not be empty.') : void 0; + var allowRoot = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; + + if (allowRoot && debugID === 0) { + return; + } + if (!debugID) { + process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0; + } } function beginLifeCycleTimer(debugID, timerType) { @@ -8149,13 +8274,13 @@ } var ReactDebugTool = { - addDevtool: function (devtool) { - eventHandlers.push(devtool); + addHook: function (hook) { + hooks.push(hook); }, - removeDevtool: function (devtool) { - for (var i = 0; i < eventHandlers.length; i++) { - if (eventHandlers[i] === devtool) { - eventHandlers.splice(i, 1); + removeHook: function (hook) { + for (var i = 0; i < hooks.length; i++) { + if (hooks[i] === hook) { + hooks.splice(i, 1); i--; } } @@ -8171,7 +8296,7 @@ isProfiling = true; flushHistory.length = 0; resetMeasurements(); - ReactDebugTool.addDevtool(ReactHostOperationHistoryDevtool); + ReactDebugTool.addHook(ReactHostOperationHistoryHook); }, endProfiling: function () { if (!isProfiling) { @@ -8180,7 +8305,7 @@ isProfiling = false; resetMeasurements(); - ReactDebugTool.removeDevtool(ReactHostOperationHistoryDevtool); + ReactDebugTool.removeHook(ReactHostOperationHistoryHook); }, getFlushHistory: function () { return flushHistory; @@ -8207,20 +8332,6 @@ endLifeCycleTimer(debugID, timerType); emitEvent('onEndLifeCycleTimer', debugID, timerType); }, - onBeginReconcilerTimer: function (debugID, timerType) { - checkDebugID(debugID); - emitEvent('onBeginReconcilerTimer', debugID, timerType); - }, - onEndReconcilerTimer: function (debugID, timerType) { - checkDebugID(debugID); - emitEvent('onEndReconcilerTimer', debugID, timerType); - }, - onError: function (debugID) { - if (currentTimerDebugID != null) { - endLifeCycleTimer(currentTimerDebugID, currentTimerType); - } - emitEvent('onError', debugID); - }, onBeginProcessingChildContext: function () { emitEvent('onBeginProcessingChildContext'); }, @@ -8231,45 +8342,18 @@ checkDebugID(debugID); emitEvent('onHostOperation', debugID, type, payload); }, - onComponentHasMounted: function (debugID) { - checkDebugID(debugID); - emitEvent('onComponentHasMounted', debugID); - }, - onComponentHasUpdated: function (debugID) { - checkDebugID(debugID); - emitEvent('onComponentHasUpdated', debugID); - }, onSetState: function () { emitEvent('onSetState'); }, - onSetDisplayName: function (debugID, displayName) { - checkDebugID(debugID); - emitEvent('onSetDisplayName', debugID, displayName); - }, onSetChildren: function (debugID, childDebugIDs) { checkDebugID(debugID); childDebugIDs.forEach(checkDebugID); emitEvent('onSetChildren', debugID, childDebugIDs); }, - onSetOwner: function (debugID, ownerDebugID) { - checkDebugID(debugID); - emitEvent('onSetOwner', debugID, ownerDebugID); - }, - onSetParent: function (debugID, parentDebugID) { - checkDebugID(debugID); - emitEvent('onSetParent', debugID, parentDebugID); - }, - onSetText: function (debugID, text) { - checkDebugID(debugID); - emitEvent('onSetText', debugID, text); - }, - onMountRootComponent: function (debugID) { - checkDebugID(debugID); - emitEvent('onMountRootComponent', debugID); - }, - onBeforeMountComponent: function (debugID, element) { + onBeforeMountComponent: function (debugID, element, parentDebugID) { checkDebugID(debugID); - emitEvent('onBeforeMountComponent', debugID, element); + checkDebugID(parentDebugID, true); + emitEvent('onBeforeMountComponent', debugID, element, parentDebugID); }, onMountComponent: function (debugID) { checkDebugID(debugID); @@ -8283,6 +8367,10 @@ checkDebugID(debugID); emitEvent('onUpdateComponent', debugID); }, + onBeforeUnmountComponent: function (debugID) { + checkDebugID(debugID); + emitEvent('onBeforeUnmountComponent', debugID); + }, onUnmountComponent: function (debugID) { checkDebugID(debugID); emitEvent('onUnmountComponent', debugID); @@ -8292,9 +8380,13 @@ } }; - ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool); - ReactDebugTool.addDevtool(ReactComponentTreeDevtool); - ReactDebugTool.addDevtool(ReactChildrenMutationWarningDevtool); + // TODO remove these when RN/www gets updated + ReactDebugTool.addDevtool = ReactDebugTool.addHook; + ReactDebugTool.removeDevtool = ReactDebugTool.removeHook; + + ReactDebugTool.addHook(ReactInvalidSetStateWarningHook); + ReactDebugTool.addHook(ReactComponentTreeHook); + ReactDebugTool.addHook(ReactChildrenMutationWarningHook); var url = ExecutionEnvironment.canUseDOM && window.location.href || ''; if (/[?&]react_perf\b/.test(url)) { ReactDebugTool.beginProfiling(); @@ -8304,7 +8396,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 65 */ +/* 64 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -8315,7 +8407,7 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule ReactInvalidSetStateWarningDevTool + * @providesModule ReactInvalidSetStateWarningHook */ 'use strict'; @@ -8330,7 +8422,7 @@ }; } - var ReactInvalidSetStateWarningDevTool = { + var ReactInvalidSetStateWarningHook = { onBeginProcessingChildContext: function () { processingChildContext = true; }, @@ -8342,11 +8434,11 @@ } }; - module.exports = ReactInvalidSetStateWarningDevTool; + module.exports = ReactInvalidSetStateWarningHook; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 66 */ +/* 65 */ /***/ function(module, exports) { /** @@ -8357,14 +8449,14 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule ReactHostOperationHistoryDevtool + * @providesModule ReactHostOperationHistoryHook */ 'use strict'; var history = []; - var ReactHostOperationHistoryDevtool = { + var ReactHostOperationHistoryHook = { onHostOperation: function (debugID, type, payload) { history.push({ instanceID: debugID, @@ -8373,7 +8465,7 @@ }); }, clearHistory: function () { - if (ReactHostOperationHistoryDevtool._preventClearing) { + if (ReactHostOperationHistoryHook._preventClearing) { // Should only be used for tests. return; } @@ -8385,10 +8477,10 @@ } }; - module.exports = ReactHostOperationHistoryDevtool; + module.exports = ReactHostOperationHistoryHook; /***/ }, -/* 67 */ +/* 66 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -8399,17 +8491,15 @@ * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * - * @providesModule ReactChildrenMutationWarningDevtool + * @providesModule ReactChildrenMutationWarningHook */ 'use strict'; - var ReactComponentTreeDevtool = __webpack_require__(29); + var ReactComponentTreeHook = __webpack_require__(28); var warning = __webpack_require__(11); - var elements = {}; - function handleElement(debugID, element) { if (element == null) { return; @@ -8432,31 +8522,25 @@ isMutated = true; } } - process.env.NODE_ENV !== 'production' ? warning(Array.isArray(element._shadowChildren) && !isMutated, 'Component\'s children should not be mutated.%s', ReactComponentTreeDevtool.getStackAddendumByID(debugID)) : void 0; + if (!Array.isArray(element._shadowChildren) || isMutated) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Component\'s children should not be mutated.%s', ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; + } } - var ReactDOMUnknownPropertyDevtool = { - onBeforeMountComponent: function (debugID, element) { - elements[debugID] = element; - }, - onBeforeUpdateComponent: function (debugID, element) { - elements[debugID] = element; - }, - onComponentHasMounted: function (debugID) { - handleElement(debugID, elements[debugID]); - delete elements[debugID]; + var ReactChildrenMutationWarningHook = { + onMountComponent: function (debugID) { + handleElement(debugID, ReactComponentTreeHook.getElement(debugID)); }, - onComponentHasUpdated: function (debugID) { - handleElement(debugID, elements[debugID]); - delete elements[debugID]; + onUpdateComponent: function (debugID) { + handleElement(debugID, ReactComponentTreeHook.getElement(debugID)); } }; - module.exports = ReactDOMUnknownPropertyDevtool; + module.exports = ReactChildrenMutationWarningHook; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 68 */ +/* 67 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -8472,7 +8556,7 @@ * @typechecks */ - var performance = __webpack_require__(69); + var performance = __webpack_require__(68); var performanceNow; @@ -8494,7 +8578,7 @@ module.exports = performanceNow; /***/ }, -/* 69 */ +/* 68 */ /***/ function(module, exports, __webpack_require__) { /** @@ -8510,7 +8594,7 @@ 'use strict'; - var ExecutionEnvironment = __webpack_require__(50); + var ExecutionEnvironment = __webpack_require__(49); var performance; @@ -8521,7 +8605,7 @@ module.exports = performance || {}; /***/ }, -/* 70 */ +/* 69 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -8760,7 +8844,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 71 */ +/* 70 */ /***/ function(module, exports) { /** @@ -8800,7 +8884,7 @@ module.exports = getEventTarget; /***/ }, -/* 72 */ +/* 71 */ /***/ function(module, exports, __webpack_require__) { /** @@ -8816,7 +8900,7 @@ 'use strict'; - var ExecutionEnvironment = __webpack_require__(50); + var ExecutionEnvironment = __webpack_require__(49); var useHasFeature; if (ExecutionEnvironment.canUseDOM) { @@ -8865,7 +8949,7 @@ module.exports = isEventSupported; /***/ }, -/* 73 */ +/* 72 */ /***/ function(module, exports) { /** @@ -8921,7 +9005,7 @@ module.exports = isTextInputElement; /***/ }, -/* 74 */ +/* 73 */ /***/ function(module, exports, __webpack_require__) { /** @@ -8953,7 +9037,7 @@ module.exports = DefaultEventPluginOrder; /***/ }, -/* 75 */ +/* 74 */ /***/ function(module, exports, __webpack_require__) { /** @@ -8969,10 +9053,10 @@ 'use strict'; - var EventConstants = __webpack_require__(42); - var EventPropagators = __webpack_require__(43); - var ReactDOMComponentTree = __webpack_require__(37); - var SyntheticMouseEvent = __webpack_require__(76); + var EventConstants = __webpack_require__(41); + var EventPropagators = __webpack_require__(42); + var ReactDOMComponentTree = __webpack_require__(36); + var SyntheticMouseEvent = __webpack_require__(75); var keyOf = __webpack_require__(25); @@ -9063,7 +9147,7 @@ module.exports = EnterLeaveEventPlugin; /***/ }, -/* 76 */ +/* 75 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9079,10 +9163,10 @@ 'use strict'; - var SyntheticUIEvent = __webpack_require__(77); - var ViewportMetrics = __webpack_require__(78); + var SyntheticUIEvent = __webpack_require__(76); + var ViewportMetrics = __webpack_require__(77); - var getEventModifierState = __webpack_require__(79); + var getEventModifierState = __webpack_require__(78); /** * @interface MouseEvent @@ -9140,7 +9224,7 @@ module.exports = SyntheticMouseEvent; /***/ }, -/* 77 */ +/* 76 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9156,9 +9240,9 @@ 'use strict'; - var SyntheticEvent = __webpack_require__(54); + var SyntheticEvent = __webpack_require__(53); - var getEventTarget = __webpack_require__(71); + var getEventTarget = __webpack_require__(70); /** * @interface UIEvent @@ -9204,7 +9288,7 @@ module.exports = SyntheticUIEvent; /***/ }, -/* 78 */ +/* 77 */ /***/ function(module, exports) { /** @@ -9236,7 +9320,7 @@ module.exports = ViewportMetrics; /***/ }, -/* 79 */ +/* 78 */ /***/ function(module, exports) { /** @@ -9284,7 +9368,7 @@ module.exports = getEventModifierState; /***/ }, -/* 80 */ +/* 79 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9300,7 +9384,7 @@ 'use strict'; - var DOMProperty = __webpack_require__(38); + var DOMProperty = __webpack_require__(37); var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY; var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE; @@ -9321,6 +9405,8 @@ allowFullScreen: HAS_BOOLEAN_VALUE, allowTransparency: 0, alt: 0, + // specifies target context for links with `preload` type + as: 0, async: HAS_BOOLEAN_VALUE, autoComplete: 0, // autoFocus is polyfilled/normalized by AutoFocusUtils @@ -9401,6 +9487,7 @@ optimum: 0, pattern: 0, placeholder: 0, + playsInline: HAS_BOOLEAN_VALUE, poster: 0, preload: 0, profile: 0, @@ -9498,7 +9585,7 @@ module.exports = HTMLDOMPropertyConfig; /***/ }, -/* 81 */ +/* 80 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9514,8 +9601,8 @@ 'use strict'; - var DOMChildrenOperations = __webpack_require__(82); - var ReactDOMIDOperations = __webpack_require__(94); + var DOMChildrenOperations = __webpack_require__(81); + var ReactDOMIDOperations = __webpack_require__(93); /** * Abstracts away all functionality of the reconciler that requires knowledge of @@ -9526,23 +9613,14 @@ processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates, - replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup, - - /** - * If a particular environment requires that some resources be cleaned up, - * specify this in the injected Mixin. In the DOM, we would likely want to - * purge any cached node ID lookups. - * - * @private - */ - unmountIDFromEnvironment: function (rootNodeID) {} + replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup }; module.exports = ReactComponentBrowserEnvironment; /***/ }, -/* 82 */ +/* 81 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -9558,15 +9636,15 @@ 'use strict'; - var DOMLazyTree = __webpack_require__(83); - var Danger = __webpack_require__(89); - var ReactMultiChildUpdateTypes = __webpack_require__(93); - var ReactDOMComponentTree = __webpack_require__(37); - var ReactInstrumentation = __webpack_require__(63); + var DOMLazyTree = __webpack_require__(82); + var Danger = __webpack_require__(88); + var ReactMultiChildUpdateTypes = __webpack_require__(92); + var ReactDOMComponentTree = __webpack_require__(36); + var ReactInstrumentation = __webpack_require__(62); - var createMicrosoftUnsafeLocalFunction = __webpack_require__(86); - var setInnerHTML = __webpack_require__(85); - var setTextContent = __webpack_require__(87); + var createMicrosoftUnsafeLocalFunction = __webpack_require__(85); + var setInnerHTML = __webpack_require__(84); + var setTextContent = __webpack_require__(86); function getNodeAfter(parentNode, node) { // Special case for text components, which return [open, close] comments @@ -9742,7 +9820,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 83 */ +/* 82 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9758,11 +9836,11 @@ 'use strict'; - var DOMNamespaces = __webpack_require__(84); - var setInnerHTML = __webpack_require__(85); + var DOMNamespaces = __webpack_require__(83); + var setInnerHTML = __webpack_require__(84); - var createMicrosoftUnsafeLocalFunction = __webpack_require__(86); - var setTextContent = __webpack_require__(87); + var createMicrosoftUnsafeLocalFunction = __webpack_require__(85); + var setTextContent = __webpack_require__(86); var ELEMENT_NODE_TYPE = 1; var DOCUMENT_FRAGMENT_NODE_TYPE = 11; @@ -9865,7 +9943,7 @@ module.exports = DOMLazyTree; /***/ }, -/* 84 */ +/* 83 */ /***/ function(module, exports) { /** @@ -9890,7 +9968,7 @@ module.exports = DOMNamespaces; /***/ }, -/* 85 */ +/* 84 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9906,13 +9984,13 @@ 'use strict'; - var ExecutionEnvironment = __webpack_require__(50); - var DOMNamespaces = __webpack_require__(84); + var ExecutionEnvironment = __webpack_require__(49); + var DOMNamespaces = __webpack_require__(83); var WHITESPACE_TEST = /^[ \r\n\t\f]/; var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/; - var createMicrosoftUnsafeLocalFunction = __webpack_require__(86); + var createMicrosoftUnsafeLocalFunction = __webpack_require__(85); // SVG temp container for IE lacking innerHTML var reusableSVGContainer; @@ -9932,9 +10010,9 @@ if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) { reusableSVGContainer = reusableSVGContainer || document.createElement('div'); reusableSVGContainer.innerHTML = '' + html + ''; - var newNodes = reusableSVGContainer.firstChild.childNodes; - for (var i = 0; i < newNodes.length; i++) { - node.appendChild(newNodes[i]); + var svgNode = reusableSVGContainer.firstChild; + while (svgNode.firstChild) { + node.appendChild(svgNode.firstChild); } } else { node.innerHTML = html; @@ -9993,7 +10071,7 @@ module.exports = setInnerHTML; /***/ }, -/* 86 */ +/* 85 */ /***/ function(module, exports) { /** @@ -10030,7 +10108,7 @@ module.exports = createMicrosoftUnsafeLocalFunction; /***/ }, -/* 87 */ +/* 86 */ /***/ function(module, exports, __webpack_require__) { /** @@ -10046,9 +10124,9 @@ 'use strict'; - var ExecutionEnvironment = __webpack_require__(50); - var escapeTextContentForBrowser = __webpack_require__(88); - var setInnerHTML = __webpack_require__(85); + var ExecutionEnvironment = __webpack_require__(49); + var escapeTextContentForBrowser = __webpack_require__(87); + var setInnerHTML = __webpack_require__(84); /** * Set the textContent property of a node, ensuring that whitespace is preserved @@ -10083,7 +10161,7 @@ module.exports = setTextContent; /***/ }, -/* 88 */ +/* 87 */ /***/ function(module, exports) { /** @@ -10191,6 +10269,7 @@ } // end code copied and modified from escape-html + /** * Escapes text to prevent scripting attacks. * @@ -10210,7 +10289,7 @@ module.exports = escapeTextContentForBrowser; /***/ }, -/* 89 */ +/* 88 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -10228,10 +10307,10 @@ var _prodInvariant = __webpack_require__(7); - var DOMLazyTree = __webpack_require__(83); - var ExecutionEnvironment = __webpack_require__(50); + var DOMLazyTree = __webpack_require__(82); + var ExecutionEnvironment = __webpack_require__(49); - var createNodesFromMarkup = __webpack_require__(90); + var createNodesFromMarkup = __webpack_require__(89); var emptyFunction = __webpack_require__(12); var invariant = __webpack_require__(8); @@ -10264,7 +10343,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 90 */ +/* 89 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {'use strict'; @@ -10282,10 +10361,10 @@ /*eslint-disable fb-www/unsafe-html*/ - var ExecutionEnvironment = __webpack_require__(50); + var ExecutionEnvironment = __webpack_require__(49); - var createArrayFromMixed = __webpack_require__(91); - var getMarkupWrap = __webpack_require__(92); + var createArrayFromMixed = __webpack_require__(90); + var getMarkupWrap = __webpack_require__(91); var invariant = __webpack_require__(8); /** @@ -10353,7 +10432,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 91 */ +/* 90 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {'use strict'; @@ -10429,7 +10508,7 @@ * @return {boolean} */ function hasArrayNature(obj) { - return( + return ( // not null/false !!obj && ( // arrays are objects, NodeLists are functions in Safari @@ -10485,7 +10564,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 92 */ +/* 91 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {'use strict'; @@ -10502,7 +10581,7 @@ /*eslint-disable fb-www/unsafe-html */ - var ExecutionEnvironment = __webpack_require__(50); + var ExecutionEnvironment = __webpack_require__(49); var invariant = __webpack_require__(8); @@ -10585,7 +10664,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) /***/ }, -/* 93 */ +/* 92 */ /***/ function(module, exports, __webpack_require__) { /** @@ -10622,7 +10701,7 @@ module.exports = ReactMultiChildUpdateTypes; /***/ }, -/* 94 */ +/* 93 */ /***/ function(module, exports, __webpack_require__) { /** @@ -10638,8 +10717,8 @@ 'use strict'; - var DOMChildrenOperations = __webpack_require__(82); - var ReactDOMComponentTree = __webpack_require__(37); + var DOMChildrenOperations = __webpack_require__(81); + var ReactDOMComponentTree = __webpack_require__(36); /** * Operations used to process updates to DOM nodes. @@ -10661,7 +10740,7 @@ module.exports = ReactDOMIDOperations; /***/ }, -/* 95 */ +/* 94 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -10682,35 +10761,34 @@ var _prodInvariant = __webpack_require__(7), _assign = __webpack_require__(4); - var AutoFocusUtils = __webpack_require__(96); - var CSSPropertyOperations = __webpack_require__(98); - var DOMLazyTree = __webpack_require__(83); - var DOMNamespaces = __webpack_require__(84); - var DOMProperty = __webpack_require__(38); - var DOMPropertyOperations = __webpack_require__(106); - var EventConstants = __webpack_require__(42); - var EventPluginHub = __webpack_require__(44); - var EventPluginRegistry = __webpack_require__(45); - var ReactBrowserEventEmitter = __webpack_require__(112); - var ReactComponentBrowserEnvironment = __webpack_require__(81); - var ReactDOMButton = __webpack_require__(115); - var ReactDOMComponentFlags = __webpack_require__(39); - var ReactDOMComponentTree = __webpack_require__(37); - var ReactDOMInput = __webpack_require__(117); - var ReactDOMOption = __webpack_require__(119); - var ReactDOMSelect = __webpack_require__(120); - var ReactDOMTextarea = __webpack_require__(121); - var ReactInstrumentation = __webpack_require__(63); - var ReactMultiChild = __webpack_require__(122); - var ReactServerRenderingTransaction = __webpack_require__(134); + var AutoFocusUtils = __webpack_require__(95); + var CSSPropertyOperations = __webpack_require__(97); + var DOMLazyTree = __webpack_require__(82); + var DOMNamespaces = __webpack_require__(83); + var DOMProperty = __webpack_require__(37); + var DOMPropertyOperations = __webpack_require__(105); + var EventConstants = __webpack_require__(41); + var EventPluginHub = __webpack_require__(43); + var EventPluginRegistry = __webpack_require__(44); + var ReactBrowserEventEmitter = __webpack_require__(107); + var ReactDOMButton = __webpack_require__(110); + var ReactDOMComponentFlags = __webpack_require__(38); + var ReactDOMComponentTree = __webpack_require__(36); + var ReactDOMInput = __webpack_require__(112); + var ReactDOMOption = __webpack_require__(114); + var ReactDOMSelect = __webpack_require__(115); + var ReactDOMTextarea = __webpack_require__(116); + var ReactInstrumentation = __webpack_require__(62); + var ReactMultiChild = __webpack_require__(117); + var ReactServerRenderingTransaction = __webpack_require__(129); var emptyFunction = __webpack_require__(12); - var escapeTextContentForBrowser = __webpack_require__(88); + var escapeTextContentForBrowser = __webpack_require__(87); var invariant = __webpack_require__(8); - var isEventSupported = __webpack_require__(72); + var isEventSupported = __webpack_require__(71); var keyOf = __webpack_require__(25); - var shallowEqual = __webpack_require__(129); - var validateDOMNesting = __webpack_require__(137); + var shallowEqual = __webpack_require__(124); + var validateDOMNesting = __webpack_require__(132); var warning = __webpack_require__(11); var Flags = ReactDOMComponentFlags; @@ -10862,12 +10940,13 @@ ReactDOMOption.postMountWrapper(inst); } - var setContentChildForInstrumentation = emptyFunction; + var setAndValidateContentChildDev = emptyFunction; if (process.env.NODE_ENV !== 'production') { - setContentChildForInstrumentation = function (content) { + setAndValidateContentChildDev = function (content) { var hasExistingContent = this._contentDebugID != null; var debugID = this._debugID; - var contentDebugID = debugID + '#text'; + // This ID represents the inlined child that has no backing instance: + var contentDebugID = -debugID; if (content == null) { if (hasExistingContent) { @@ -10877,18 +10956,13 @@ return; } + validateDOMNesting(null, String(content), this, this._ancestorInfo); this._contentDebugID = contentDebugID; - var text = '' + content; - - ReactInstrumentation.debugTool.onSetDisplayName(contentDebugID, '#text'); - ReactInstrumentation.debugTool.onSetParent(contentDebugID, debugID); - ReactInstrumentation.debugTool.onSetText(contentDebugID, text); - if (hasExistingContent) { ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content); ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID); } else { - ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content); + ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID); ReactInstrumentation.debugTool.onMountComponent(contentDebugID); ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]); } @@ -11049,15 +11123,15 @@ this._previousStyleCopy = null; this._hostNode = null; this._hostParent = null; - this._rootNodeID = null; - this._domID = null; + this._rootNodeID = 0; + this._domID = 0; this._hostContainerInfo = null; this._wrapperState = null; this._topLevelWrapper = null; this._flags = 0; if (process.env.NODE_ENV !== 'production') { this._ancestorInfo = null; - setContentChildForInstrumentation.call(this, null); + setAndValidateContentChildDev.call(this, null); } } @@ -11071,14 +11145,12 @@ * * @internal * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction - * @param {?ReactDOMComponent} the containing DOM component instance + * @param {?ReactDOMComponent} the parent component instance * @param {?object} info about the host container * @param {object} context * @return {string} The computed markup. */ mountComponent: function (transaction, hostParent, hostContainerInfo, context) { - var _this = this; - this._rootNodeID = globalIdCounter++; this._domID = hostContainerInfo._idCounter++; this._hostParent = hostParent; @@ -11159,7 +11231,7 @@ if (parentInfo) { // parentInfo should always be present except for the top-level // component when server rendering - validateDOMNesting(this._tag, this, parentInfo); + validateDOMNesting(this._tag, null, this, parentInfo); } this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this); } @@ -11234,15 +11306,6 @@ break; } - if (process.env.NODE_ENV !== 'production') { - if (this._debugID) { - var callback = function () { - return ReactInstrumentation.debugTool.onComponentHasMounted(_this._debugID); - }; - transaction.getReactMountReady().enqueue(callback, this); - } - } - return mountImage; }, @@ -11337,7 +11400,7 @@ // TODO: Validate that text is allowed as a child of this node ret = escapeTextContentForBrowser(contentToUse); if (process.env.NODE_ENV !== 'production') { - setContentChildForInstrumentation.call(this, contentToUse); + setAndValidateContentChildDev.call(this, contentToUse); } } else if (childrenToUse != null) { var mountImages = this.mountChildren(childrenToUse, transaction, context); @@ -11374,7 +11437,7 @@ if (contentToUse != null) { // TODO: Validate that text is allowed as a child of this node if (process.env.NODE_ENV !== 'production') { - setContentChildForInstrumentation.call(this, contentToUse); + setAndValidateContentChildDev.call(this, contentToUse); } DOMLazyTree.queueText(lazyTree, contentToUse); } else if (childrenToUse != null) { @@ -11411,8 +11474,6 @@ * @overridable */ updateComponent: function (transaction, prevElement, nextElement, context) { - var _this2 = this; - var lastProps = prevElement.props; var nextProps = this._currentElement.props; @@ -11422,7 +11483,6 @@ nextProps = ReactDOMButton.getHostProps(this, nextProps); break; case 'input': - ReactDOMInput.updateWrapper(this); lastProps = ReactDOMInput.getHostProps(this, lastProps); nextProps = ReactDOMInput.getHostProps(this, nextProps); break; @@ -11435,7 +11495,6 @@ nextProps = ReactDOMSelect.getHostProps(this, nextProps); break; case 'textarea': - ReactDOMTextarea.updateWrapper(this); lastProps = ReactDOMTextarea.getHostProps(this, lastProps); nextProps = ReactDOMTextarea.getHostProps(this, nextProps); break; @@ -11445,19 +11504,21 @@ this._updateDOMProperties(lastProps, nextProps, transaction); this._updateDOMChildren(lastProps, nextProps, transaction, context); - if (this._tag === 'select') { - // value update needs to occur after