From bb0a25cb853ddbd2971bf1d0c74b6c4694015367 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 11 Nov 2016 14:03:42 +0800 Subject: Updates --- examples/common.css.map | 2 +- examples/common.js | 13182 ++++++++++++++++--------------- examples/common.js.map | 2 +- examples/disabled.html | 13 +- examples/disabled.js | 6 +- examples/disabled.js.map | 2 +- examples/format.html | 311 + examples/format.js | 57 + examples/format.js.map | 1 + examples/hidden.html | 13 +- examples/hidden.js | 12 +- examples/hidden.js.map | 2 +- examples/pick-time.html | 13 +- examples/pick-time.js | 12 +- examples/pick-time.js.map | 2 +- examples/value-and-defaultValue.html | 13 +- examples/value-and-defaultValue.js | 12 +- examples/value-and-defaultValue.js.map | 2 +- 18 files changed, 7334 insertions(+), 6323 deletions(-) create mode 100644 examples/format.html create mode 100644 examples/format.js create mode 100644 examples/format.js.map (limited to 'examples') diff --git a/examples/common.css.map b/examples/common.css.map index 055bc6d..d66e16f 100644 --- a/examples/common.css.map +++ b/examples/common.css.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./assets/index.less","webpack:///index.less","webpack:///./assets/index/Picker.less","webpack:///./assets/index/Panel.less","webpack:///./assets/index/Header.less","webpack:///./assets/index/Select.less"],"names":[],"mappings":"AAEA;EACE;EACA;CCDD;ADDD;EAII;CCAH;ACLC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAAA;CDOH;AEtBD;EACE;EACA;EACA;EACA;CFwBD;AE5BD;EAOI;CFwBH;AErBC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CFuBH;AG5CC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;CH8CH;AG5CG;EACE;EACA;EACA;EACA;CH8CL;AG3CG;EACE;CH6CL;AGzCC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CH2CH;AGxCC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EAAA;CH0CH;AGvCC;EACE;CHyCH;AIvFD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CJyFD;AIvFC;EACE;CJyFH;AItFC;EACE;EACA;CJwFH;AIrFC;EACE;CJuFH;AI5GD;EAyBI;EACA;EACA;EACA;EACA;EACA;CJsFH;AIpHD;EAkCI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;KAAA;MAAA;UAAA;CJqFH;AInFG;EACE;CJqFL;AIjFC;EACE;EACA;CJmFH;AIhFC;EACE;CJkFH;AIjFG;EACE;EACA;CJmFL","file":"common.css","sourcesContent":["@prefixClass: rc-time-picker;\n\n.@{prefixClass} {\n display: inline-block;\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n}\n\n@import \"./index/Picker\";\n@import \"./index/Panel\";\n@import \"./index/Header\";\n@import \"./index/Select\";\n\n\n\n/** WEBPACK FOOTER **\n ** ./assets/index.less\n **/",".rc-time-picker {\n display: inline-block;\n box-sizing: border-box;\n}\n.rc-time-picker * {\n box-sizing: border-box;\n}\n.rc-time-picker-input {\n width: 100%;\n position: relative;\n display: inline-block;\n padding: 4px 7px;\n height: 28px;\n cursor: text;\n font-size: 12px;\n line-height: 1.5;\n color: #666;\n background-color: #fff;\n background-image: none;\n border: 1px solid #d9d9d9;\n border-radius: 6px;\n transition: border 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), background 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), box-shadow 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n.rc-time-picker-panel {\n z-index: 1070;\n width: 170px;\n position: absolute;\n box-sizing: border-box;\n}\n.rc-time-picker-panel * {\n box-sizing: border-box;\n}\n.rc-time-picker-panel-inner {\n display: inline-block;\n position: relative;\n outline: none;\n list-style: none;\n font-size: 12px;\n text-align: left;\n background-color: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 5px #ccc;\n background-clip: padding-box;\n border: 1px solid #ccc;\n line-height: 1.5;\n}\n.rc-time-picker-panel-input {\n margin: 0;\n padding: 0;\n width: 100%;\n cursor: auto;\n line-height: 1.5;\n outline: 0;\n border: 1px solid transparent;\n}\n.rc-time-picker-panel-input-wrap {\n box-sizing: border-box;\n position: relative;\n padding: 6px;\n border-bottom: 1px solid #e9e9e9;\n}\n.rc-time-picker-panel-input-invalid {\n border-color: red;\n}\n.rc-time-picker-panel-clear-btn {\n position: absolute;\n right: 6px;\n cursor: pointer;\n overflow: hidden;\n width: 20px;\n height: 20px;\n text-align: center;\n line-height: 20px;\n top: 6px;\n margin: 0;\n}\n.rc-time-picker-panel-clear-btn:after {\n content: \"x\";\n font-size: 12px;\n color: #aaa;\n display: inline-block;\n line-height: 1;\n width: 20px;\n transition: color 0.3s ease;\n}\n.rc-time-picker-panel-clear-btn:hover:after {\n color: #666;\n}\n.rc-time-picker-panel-select {\n float: left;\n font-size: 12px;\n border: 1px solid #e9e9e9;\n border-width: 0 1px;\n margin-left: -1px;\n box-sizing: border-box;\n width: 56px;\n overflow: hidden;\n position: relative;\n}\n.rc-time-picker-panel-select:hover {\n overflow-y: auto;\n}\n.rc-time-picker-panel-select:first-child {\n border-left: 0;\n margin-left: 0;\n}\n.rc-time-picker-panel-select:last-child {\n border-right: 0;\n}\n.rc-time-picker-panel-select ul {\n list-style: none;\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n width: 100%;\n max-height: 144px;\n}\n.rc-time-picker-panel-select li {\n list-style: none;\n box-sizing: content-box;\n margin: 0;\n padding: 0 0 0 16px;\n width: 100%;\n height: 24px;\n line-height: 24px;\n text-align: left;\n cursor: pointer;\n user-select: none;\n}\n.rc-time-picker-panel-select li:hover {\n background: #edfaff;\n}\nli.rc-time-picker-panel-select-option-selected {\n background: #edfaff;\n color: #2db7f5;\n}\nli.rc-time-picker-panel-select-option-disabled {\n color: #bfbfbf;\n}\nli.rc-time-picker-panel-select-option-disabled:hover {\n background: transparent;\n cursor: not-allowed;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** index.less\n **/",".@{prefixClass} {\n &-input {\n width: 100%;\n position: relative;\n display: inline-block;\n padding: 4px 7px;\n height: 28px;\n cursor: text;\n font-size: 12px;\n line-height: 1.5;\n color: #666;\n background-color: #fff;\n background-image: none;\n border: 1px solid #d9d9d9;\n border-radius: 6px;\n transition: border .2s cubic-bezier(0.645, 0.045, 0.355, 1), background .2s cubic-bezier(0.645, 0.045, 0.355, 1), box-shadow .2s cubic-bezier(0.645, 0.045, 0.355, 1);\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./assets/index/Picker.less\n **/",".@{prefixClass}-panel {\n z-index: 1070;\n width: 170px;\n position: absolute;\n box-sizing: border-box;\n\n * {\n box-sizing: border-box;\n }\n\n &-inner {\n display: inline-block;\n position: relative;\n outline: none;\n list-style: none;\n font-size: 12px;\n text-align: left;\n background-color: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 5px #ccc;\n background-clip: padding-box;\n border: 1px solid #ccc;\n line-height: 1.5;\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./assets/index/Panel.less\n **/",".@{prefixClass}-panel {\n &-input {\n margin: 0;\n padding: 0;\n width: 100%;\n cursor: auto;\n line-height: 1.5;\n outline: 0;\n border: 1px solid transparent;\n\n &-wrap {\n box-sizing: border-box;\n position: relative;\n padding: 6px;\n border-bottom: 1px solid #e9e9e9;\n }\n\n &-invalid {\n border-color: red;\n }\n }\n\n &-clear-btn {\n position: absolute;\n right: 6px;\n cursor: pointer;\n overflow: hidden;\n width: 20px;\n height: 20px;\n text-align: center;\n line-height: 20px;\n top: 6px;\n margin: 0;\n }\n\n &-clear-btn:after {\n content: \"x\";\n font-size: 12px;\n color: #aaa;\n display: inline-block;\n line-height: 1;\n width: 20px;\n transition: color 0.3s ease;\n }\n\n &-clear-btn:hover:after {\n color: #666;\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./assets/index/Header.less\n **/",".@{prefixClass}-panel-select {\n float: left;\n font-size: 12px;\n border: 1px solid #e9e9e9;\n border-width: 0 1px;\n margin-left: -1px;\n box-sizing: border-box;\n width: 56px;\n overflow: hidden;\n position: relative; // Fix chrome weird render bug\n\n &:hover {\n overflow-y: auto;\n }\n\n &:first-child {\n border-left: 0;\n margin-left: 0;\n }\n\n &:last-child {\n border-right: 0;\n }\n\n ul {\n list-style: none;\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n width: 100%;\n max-height: 144px;\n }\n\n li {\n list-style: none;\n box-sizing: content-box;\n margin: 0;\n padding: 0 0 0 16px;\n width: 100%;\n height: 24px;\n line-height: 24px;\n text-align: left;\n cursor: pointer;\n user-select: none;\n\n &:hover {\n background: #edfaff;\n }\n }\n\n li&-option-selected {\n background: #edfaff;\n color: #2db7f5;\n }\n\n li&-option-disabled {\n color: #bfbfbf;\n &:hover {\n background: transparent;\n cursor: not-allowed;\n }\n }\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./assets/index/Select.less\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./assets/index.less","webpack:///index.less","webpack:///./assets/index/Picker.less","webpack:///./assets/index/Panel.less","webpack:///./assets/index/Header.less","webpack:///./assets/index/Select.less"],"names":[],"mappings":"AAEA;EACE;EACA;CCDD;ADDD;EAII;CCAH;ACLC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAAA;CDOH;AEtBD;EACE;EACA;EACA;EACA;CFwBD;AE5BD;EAOI;CFwBH;AErBC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CFuBH;AG5CC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;CH8CH;AG5CG;EACE;EACA;EACA;EACA;CH8CL;AG3CG;EACE;CH6CL;AGzCC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CH2CH;AGxCC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EAAA;CH0CH;AGvCC;EACE;CHyCH;AIvFD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CJyFD;AIvFC;EACE;CJyFH;AItFC;EACE;EACA;CJwFH;AIrFC;EACE;CJuFH;AI5GD;EAyBI;EACA;EACA;EACA;EACA;EACA;CJsFH;AIpHD;EAkCI;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;KAAA;MAAA;UAAA;CJqFH;AInFG;EACE;CJqFL;AIjFC;EACE;EACA;CJmFH;AIhFC;EACE;CJkFH;AIjFG;EACE;EACA;CJmFL","file":"common.css","sourcesContent":["@prefixClass: rc-time-picker;\n\n.@{prefixClass} {\n display: inline-block;\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n}\n\n@import \"./index/Picker\";\n@import \"./index/Panel\";\n@import \"./index/Header\";\n@import \"./index/Select\";\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index.less",".rc-time-picker {\n display: inline-block;\n box-sizing: border-box;\n}\n.rc-time-picker * {\n box-sizing: border-box;\n}\n.rc-time-picker-input {\n width: 100%;\n position: relative;\n display: inline-block;\n padding: 4px 7px;\n height: 28px;\n cursor: text;\n font-size: 12px;\n line-height: 1.5;\n color: #666;\n background-color: #fff;\n background-image: none;\n border: 1px solid #d9d9d9;\n border-radius: 6px;\n transition: border 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), background 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), box-shadow 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n.rc-time-picker-panel {\n z-index: 1070;\n width: 170px;\n position: absolute;\n box-sizing: border-box;\n}\n.rc-time-picker-panel * {\n box-sizing: border-box;\n}\n.rc-time-picker-panel-inner {\n display: inline-block;\n position: relative;\n outline: none;\n list-style: none;\n font-size: 12px;\n text-align: left;\n background-color: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 5px #ccc;\n background-clip: padding-box;\n border: 1px solid #ccc;\n line-height: 1.5;\n}\n.rc-time-picker-panel-input {\n margin: 0;\n padding: 0;\n width: 100%;\n cursor: auto;\n line-height: 1.5;\n outline: 0;\n border: 1px solid transparent;\n}\n.rc-time-picker-panel-input-wrap {\n box-sizing: border-box;\n position: relative;\n padding: 6px;\n border-bottom: 1px solid #e9e9e9;\n}\n.rc-time-picker-panel-input-invalid {\n border-color: red;\n}\n.rc-time-picker-panel-clear-btn {\n position: absolute;\n right: 6px;\n cursor: pointer;\n overflow: hidden;\n width: 20px;\n height: 20px;\n text-align: center;\n line-height: 20px;\n top: 6px;\n margin: 0;\n}\n.rc-time-picker-panel-clear-btn:after {\n content: \"x\";\n font-size: 12px;\n color: #aaa;\n display: inline-block;\n line-height: 1;\n width: 20px;\n transition: color 0.3s ease;\n}\n.rc-time-picker-panel-clear-btn:hover:after {\n color: #666;\n}\n.rc-time-picker-panel-select {\n float: left;\n font-size: 12px;\n border: 1px solid #e9e9e9;\n border-width: 0 1px;\n margin-left: -1px;\n box-sizing: border-box;\n width: 56px;\n overflow: hidden;\n position: relative;\n}\n.rc-time-picker-panel-select:hover {\n overflow-y: auto;\n}\n.rc-time-picker-panel-select:first-child {\n border-left: 0;\n margin-left: 0;\n}\n.rc-time-picker-panel-select:last-child {\n border-right: 0;\n}\n.rc-time-picker-panel-select ul {\n list-style: none;\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n width: 100%;\n max-height: 144px;\n}\n.rc-time-picker-panel-select li {\n list-style: none;\n box-sizing: content-box;\n margin: 0;\n padding: 0 0 0 16px;\n width: 100%;\n height: 24px;\n line-height: 24px;\n text-align: left;\n cursor: pointer;\n user-select: none;\n}\n.rc-time-picker-panel-select li:hover {\n background: #edfaff;\n}\nli.rc-time-picker-panel-select-option-selected {\n background: #edfaff;\n color: #2db7f5;\n}\nli.rc-time-picker-panel-select-option-disabled {\n color: #bfbfbf;\n}\nli.rc-time-picker-panel-select-option-disabled:hover {\n background: transparent;\n cursor: not-allowed;\n}\n\n\n\n// WEBPACK FOOTER //\n// index.less",".@{prefixClass} {\n &-input {\n width: 100%;\n position: relative;\n display: inline-block;\n padding: 4px 7px;\n height: 28px;\n cursor: text;\n font-size: 12px;\n line-height: 1.5;\n color: #666;\n background-color: #fff;\n background-image: none;\n border: 1px solid #d9d9d9;\n border-radius: 6px;\n transition: border .2s cubic-bezier(0.645, 0.045, 0.355, 1), background .2s cubic-bezier(0.645, 0.045, 0.355, 1), box-shadow .2s cubic-bezier(0.645, 0.045, 0.355, 1);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index/Picker.less",".@{prefixClass}-panel {\n z-index: 1070;\n width: 170px;\n position: absolute;\n box-sizing: border-box;\n\n * {\n box-sizing: border-box;\n }\n\n &-inner {\n display: inline-block;\n position: relative;\n outline: none;\n list-style: none;\n font-size: 12px;\n text-align: left;\n background-color: #fff;\n border-radius: 3px;\n box-shadow: 0 1px 5px #ccc;\n background-clip: padding-box;\n border: 1px solid #ccc;\n line-height: 1.5;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index/Panel.less",".@{prefixClass}-panel {\n &-input {\n margin: 0;\n padding: 0;\n width: 100%;\n cursor: auto;\n line-height: 1.5;\n outline: 0;\n border: 1px solid transparent;\n\n &-wrap {\n box-sizing: border-box;\n position: relative;\n padding: 6px;\n border-bottom: 1px solid #e9e9e9;\n }\n\n &-invalid {\n border-color: red;\n }\n }\n\n &-clear-btn {\n position: absolute;\n right: 6px;\n cursor: pointer;\n overflow: hidden;\n width: 20px;\n height: 20px;\n text-align: center;\n line-height: 20px;\n top: 6px;\n margin: 0;\n }\n\n &-clear-btn:after {\n content: \"x\";\n font-size: 12px;\n color: #aaa;\n display: inline-block;\n line-height: 1;\n width: 20px;\n transition: color 0.3s ease;\n }\n\n &-clear-btn:hover:after {\n color: #666;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index/Header.less",".@{prefixClass}-panel-select {\n float: left;\n font-size: 12px;\n border: 1px solid #e9e9e9;\n border-width: 0 1px;\n margin-left: -1px;\n box-sizing: border-box;\n width: 56px;\n overflow: hidden;\n position: relative; // Fix chrome weird render bug\n\n &:hover {\n overflow-y: auto;\n }\n\n &:first-child {\n border-left: 0;\n margin-left: 0;\n }\n\n &:last-child {\n border-right: 0;\n }\n\n ul {\n list-style: none;\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n width: 100%;\n max-height: 144px;\n }\n\n li {\n list-style: none;\n box-sizing: content-box;\n margin: 0;\n padding: 0 0 0 16px;\n width: 100%;\n height: 24px;\n line-height: 24px;\n text-align: left;\n cursor: pointer;\n user-select: none;\n\n &:hover {\n background: #edfaff;\n }\n }\n\n li&-option-selected {\n background: #edfaff;\n color: #2db7f5;\n }\n\n li&-option-disabled {\n color: #bfbfbf;\n &:hover {\n background: transparent;\n cursor: not-allowed;\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index/Select.less"],"sourceRoot":""} \ No newline at end of file diff --git a/examples/common.js b/examples/common.js index 20a0b7d..3471ad5 100644 --- a/examples/common.js +++ b/examples/common.js @@ -30,7 +30,7 @@ /******/ // "0" means "already loaded" /******/ // Array means "loading", array contains callbacks /******/ var installedChunks = { -/******/ 4:0 +/******/ 5:0 /******/ }; /******/ /******/ // The require function @@ -76,7 +76,7 @@ /******/ script.charset = 'utf-8'; /******/ script.async = true; /******/ -/******/ script.src = __webpack_require__.p + "" + chunkId + "." + ({"0":"disabled","1":"hidden","2":"pick-time","3":"value-and-defaultValue"}[chunkId]||chunkId) + ".js"; +/******/ script.src = __webpack_require__.p + "" + chunkId + "." + ({"0":"disabled","1":"format","2":"hidden","3":"pick-time","4":"value-and-defaultValue"}[chunkId]||chunkId) + ".js"; /******/ head.appendChild(script); /******/ } /******/ }; @@ -133,10 +133,10 @@ var ReactClass = __webpack_require__(23); var ReactDOMFactories = __webpack_require__(28); var ReactElement = __webpack_require__(11); - var ReactPropTypes = __webpack_require__(34); - var ReactVersion = __webpack_require__(35); + var ReactPropTypes = __webpack_require__(33); + var ReactVersion = __webpack_require__(34); - var onlyChild = __webpack_require__(36); + var onlyChild = __webpack_require__(35); var warning = __webpack_require__(13); var createElement = ReactElement.createElement; @@ -144,7 +144,7 @@ var cloneElement = ReactElement.cloneElement; if (process.env.NODE_ENV !== 'production') { - var ReactElementValidator = __webpack_require__(30); + var ReactElementValidator = __webpack_require__(29); createElement = ReactElementValidator.createElement; createFactory = ReactElementValidator.createFactory; cloneElement = ReactElementValidator.cloneElement; @@ -218,35 +218,83 @@ 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) { if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations return setTimeout(fun, 0); - } else { - return cachedSetTimeout.call(null, 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); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { - clearTimeout(marker); - } else { - cachedClearTimeout.call(null, marker); + //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); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } } + + + } var queue = []; var draining = false; @@ -914,6 +962,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 @@ -1020,14 +1096,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; } @@ -1068,39 +1136,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); + } } } } @@ -1152,14 +1196,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; @@ -1282,20 +1318,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++]; @@ -1309,8 +1337,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; @@ -2876,20 +2922,15 @@ var ReactElement = __webpack_require__(11); - var mapObject = __webpack_require__(29); - /** * 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__(30); - return ReactElementValidator.createFactory(tag); - } - return ReactElement.createFactory(tag); + var createDOMFactory = ReactElement.createFactory; + if (process.env.NODE_ENV !== 'production') { + var ReactElementValidator = __webpack_require__(29); + createDOMFactory = ReactElementValidator.createFactory; } /** @@ -2898,204 +2939,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__(5))) /***/ }, /* 29 */ -/***/ 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; - -/***/ }, -/* 30 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3119,11 +3104,11 @@ 'use strict'; var ReactCurrentOwner = __webpack_require__(12); - var ReactComponentTreeDevtool = __webpack_require__(31); + var ReactComponentTreeHook = __webpack_require__(30); var ReactElement = __webpack_require__(11); var ReactPropTypeLocations = __webpack_require__(24); - var checkReactTypeSpec = __webpack_require__(32); + var checkReactTypeSpec = __webpack_require__(31); var canDefineProperty = __webpack_require__(15); var getIteratorFn = __webpack_require__(17); @@ -3192,7 +3177,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; } /** @@ -3263,7 +3248,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); @@ -3327,7 +3314,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 31 */ +/* 30 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3338,7 +3325,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'; @@ -3350,32 +3337,138 @@ var invariant = __webpack_require__(10); var warning = __webpack_require__(13); - 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; + } + } - 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 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); + + 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); } } @@ -3384,102 +3477,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) { @@ -3494,64 +3594,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__(5))) /***/ }, -/* 32 */ +/* 31 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3570,12 +3681,12 @@ var _prodInvariant = __webpack_require__(9); var ReactPropTypeLocationNames = __webpack_require__(26); - var ReactPropTypesSecret = __webpack_require__(33); + var ReactPropTypesSecret = __webpack_require__(32); var invariant = __webpack_require__(10); var warning = __webpack_require__(13); - var ReactComponentTreeDevtool; + var ReactComponentTreeHook; if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') { // Temporary hack. @@ -3583,7 +3694,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__(31); + ReactComponentTreeHook = __webpack_require__(30); } var loggedTypeFailures = {}; @@ -3624,13 +3735,13 @@ var componentStackInfo = ''; if (process.env.NODE_ENV !== 'production') { - if (!ReactComponentTreeDevtool) { - ReactComponentTreeDevtool = __webpack_require__(31); + if (!ReactComponentTreeHook) { + ReactComponentTreeHook = __webpack_require__(30); } if (debugID !== null) { - componentStackInfo = ReactComponentTreeDevtool.getStackAddendumByID(debugID); + componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID); } else if (element !== null) { - componentStackInfo = ReactComponentTreeDevtool.getCurrentStackAddendum(element); + componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element); } } @@ -3644,7 +3755,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 33 */ +/* 32 */ /***/ function(module, exports) { /** @@ -3665,7 +3776,7 @@ module.exports = ReactPropTypesSecret; /***/ }, -/* 34 */ +/* 33 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3683,7 +3794,7 @@ var ReactElement = __webpack_require__(11); var ReactPropTypeLocationNames = __webpack_require__(26); - var ReactPropTypesSecret = __webpack_require__(33); + var ReactPropTypesSecret = __webpack_require__(32); var emptyFunction = __webpack_require__(14); var getIteratorFn = __webpack_require__(17); @@ -3776,6 +3887,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 = {}; @@ -3795,7 +3920,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 { @@ -3820,7 +3945,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; } @@ -3834,13 +3959,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); @@ -3859,7 +3984,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; } @@ -3872,7 +3997,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; } @@ -3895,7 +4020,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); } @@ -3903,13 +4028,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)) { @@ -3939,7 +4064,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); } @@ -3948,7 +4073,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; } @@ -3961,7 +4086,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]; @@ -4088,7 +4213,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 35 */ +/* 34 */ /***/ function(module, exports) { /** @@ -4104,10 +4229,10 @@ 'use strict'; - module.exports = '15.3.0'; + module.exports = '15.3.2'; /***/ }, -/* 36 */ +/* 35 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -4143,7 +4268,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; } @@ -4151,16 +4276,16 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 37 */ +/* 36 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - module.exports = __webpack_require__(38); + module.exports = __webpack_require__(37); /***/ }, -/* 38 */ +/* 37 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -4178,16 +4303,16 @@ 'use strict'; - var ReactDOMComponentTree = __webpack_require__(39); - var ReactDefaultInjection = __webpack_require__(42); - var ReactMount = __webpack_require__(169); - var ReactReconciler = __webpack_require__(62); - var ReactUpdates = __webpack_require__(59); - var ReactVersion = __webpack_require__(35); + var ReactDOMComponentTree = __webpack_require__(38); + var ReactDefaultInjection = __webpack_require__(41); + var ReactMount = __webpack_require__(164); + var ReactReconciler = __webpack_require__(61); + var ReactUpdates = __webpack_require__(58); + var ReactVersion = __webpack_require__(34); - var findDOMNode = __webpack_require__(174); - var getHostComponentFromComposite = __webpack_require__(175); - var renderSubtreeIntoContainer = __webpack_require__(176); + var findDOMNode = __webpack_require__(169); + var getHostComponentFromComposite = __webpack_require__(170); + var renderSubtreeIntoContainer = __webpack_require__(171); var warning = __webpack_require__(13); ReactDefaultInjection.inject(); @@ -4228,7 +4353,7 @@ } if (process.env.NODE_ENV !== 'production') { - var ExecutionEnvironment = __webpack_require__(52); + var ExecutionEnvironment = __webpack_require__(51); if (ExecutionEnvironment.canUseDOM && window.top === window.self) { // First check if devtools is not installed @@ -4263,11 +4388,20 @@ } } + if (process.env.NODE_ENV !== 'production') { + var ReactInstrumentation = __webpack_require__(64); + var ReactDOMUnknownPropertyHook = __webpack_require__(172); + var ReactDOMNullInputValuePropHook = __webpack_require__(173); + + ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook); + ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook); + } + module.exports = ReactDOM; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 39 */ +/* 38 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -4285,8 +4419,8 @@ var _prodInvariant = __webpack_require__(9); - var DOMProperty = __webpack_require__(40); - var ReactDOMComponentFlags = __webpack_require__(41); + var DOMProperty = __webpack_require__(39); + var ReactDOMComponentFlags = __webpack_require__(40); var invariant = __webpack_require__(10); @@ -4354,7 +4488,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; } @@ -4461,7 +4595,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 40 */ +/* 39 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -4673,7 +4807,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 41 */ +/* 40 */ /***/ function(module, exports) { /** @@ -4696,7 +4830,7 @@ module.exports = ReactDOMComponentFlags; /***/ }, -/* 42 */ +/* 41 */ /***/ function(module, exports, __webpack_require__) { /** @@ -4712,24 +4846,24 @@ 'use strict'; - var BeforeInputEventPlugin = __webpack_require__(43); - var ChangeEventPlugin = __webpack_require__(58); - var DefaultEventPluginOrder = __webpack_require__(76); - var EnterLeaveEventPlugin = __webpack_require__(77); - var HTMLDOMPropertyConfig = __webpack_require__(82); - var ReactComponentBrowserEnvironment = __webpack_require__(83); - var ReactDOMComponent = __webpack_require__(97); - var ReactDOMComponentTree = __webpack_require__(39); - var ReactDOMEmptyComponent = __webpack_require__(140); - var ReactDOMTreeTraversal = __webpack_require__(141); - var ReactDOMTextComponent = __webpack_require__(142); - var ReactDefaultBatchingStrategy = __webpack_require__(143); - var ReactEventListener = __webpack_require__(144); - var ReactInjection = __webpack_require__(147); - var ReactReconcileTransaction = __webpack_require__(148); - var SVGDOMPropertyConfig = __webpack_require__(156); - var SelectEventPlugin = __webpack_require__(157); - var SimpleEventPlugin = __webpack_require__(158); + var BeforeInputEventPlugin = __webpack_require__(42); + var ChangeEventPlugin = __webpack_require__(57); + var DefaultEventPluginOrder = __webpack_require__(75); + var EnterLeaveEventPlugin = __webpack_require__(76); + var HTMLDOMPropertyConfig = __webpack_require__(81); + var ReactComponentBrowserEnvironment = __webpack_require__(82); + var ReactDOMComponent = __webpack_require__(96); + var ReactDOMComponentTree = __webpack_require__(38); + var ReactDOMEmptyComponent = __webpack_require__(135); + var ReactDOMTreeTraversal = __webpack_require__(136); + var ReactDOMTextComponent = __webpack_require__(137); + var ReactDefaultBatchingStrategy = __webpack_require__(138); + var ReactEventListener = __webpack_require__(139); + var ReactInjection = __webpack_require__(142); + var ReactReconcileTransaction = __webpack_require__(143); + var SVGDOMPropertyConfig = __webpack_require__(151); + var SelectEventPlugin = __webpack_require__(152); + var SimpleEventPlugin = __webpack_require__(153); var alreadyInjected = false; @@ -4785,7 +4919,7 @@ }; /***/ }, -/* 43 */ +/* 42 */ /***/ function(module, exports, __webpack_require__) { /** @@ -4801,12 +4935,12 @@ 'use strict'; - var EventConstants = __webpack_require__(44); - var EventPropagators = __webpack_require__(45); - var ExecutionEnvironment = __webpack_require__(52); - var FallbackCompositionState = __webpack_require__(53); - var SyntheticCompositionEvent = __webpack_require__(55); - var SyntheticInputEvent = __webpack_require__(57); + var EventConstants = __webpack_require__(43); + var EventPropagators = __webpack_require__(44); + var ExecutionEnvironment = __webpack_require__(51); + var FallbackCompositionState = __webpack_require__(52); + var SyntheticCompositionEvent = __webpack_require__(54); + var SyntheticInputEvent = __webpack_require__(56); var keyOf = __webpack_require__(27); @@ -5077,8 +5211,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; @@ -5178,7 +5314,7 @@ module.exports = BeforeInputEventPlugin; /***/ }, -/* 44 */ +/* 43 */ /***/ function(module, exports, __webpack_require__) { /** @@ -5280,7 +5416,7 @@ module.exports = EventConstants; /***/ }, -/* 45 */ +/* 44 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -5296,12 +5432,12 @@ 'use strict'; - var EventConstants = __webpack_require__(44); - var EventPluginHub = __webpack_require__(46); - var EventPluginUtils = __webpack_require__(48); + var EventConstants = __webpack_require__(43); + var EventPluginHub = __webpack_require__(45); + var EventPluginUtils = __webpack_require__(47); - var accumulateInto = __webpack_require__(50); - var forEachAccumulated = __webpack_require__(51); + var accumulateInto = __webpack_require__(49); + var forEachAccumulated = __webpack_require__(50); var warning = __webpack_require__(13); var PropagationPhases = EventConstants.PropagationPhases; @@ -5423,7 +5559,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 46 */ +/* 45 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -5441,12 +5577,12 @@ var _prodInvariant = __webpack_require__(9); - var EventPluginRegistry = __webpack_require__(47); - var EventPluginUtils = __webpack_require__(48); - var ReactErrorUtils = __webpack_require__(49); + var EventPluginRegistry = __webpack_require__(46); + var EventPluginUtils = __webpack_require__(47); + var ReactErrorUtils = __webpack_require__(48); - var accumulateInto = __webpack_require__(50); - var forEachAccumulated = __webpack_require__(51); + var accumulateInto = __webpack_require__(49); + var forEachAccumulated = __webpack_require__(50); var invariant = __webpack_require__(10); /** @@ -5484,6 +5620,8 @@ }; var getDictionaryKey = function (inst) { + // Prevents V8 performance issue: + // https://github.com/facebook/react/pull/7232 return '.' + inst._rootNodeID; }; @@ -5678,7 +5816,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 47 */ +/* 46 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -5931,7 +6069,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 48 */ +/* 47 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -5949,8 +6087,8 @@ var _prodInvariant = __webpack_require__(9); - var EventConstants = __webpack_require__(44); - var ReactErrorUtils = __webpack_require__(49); + var EventConstants = __webpack_require__(43); + var ReactErrorUtils = __webpack_require__(48); var invariant = __webpack_require__(10); var warning = __webpack_require__(13); @@ -6166,7 +6304,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 49 */ +/* 48 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -6248,7 +6386,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 50 */ +/* 49 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -6312,7 +6450,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 51 */ +/* 50 */ /***/ function(module, exports) { /** @@ -6348,7 +6486,7 @@ module.exports = forEachAccumulated; /***/ }, -/* 52 */ +/* 51 */ /***/ function(module, exports) { /** @@ -6388,7 +6526,7 @@ module.exports = ExecutionEnvironment; /***/ }, -/* 53 */ +/* 52 */ /***/ function(module, exports, __webpack_require__) { /** @@ -6408,7 +6546,7 @@ var PooledClass = __webpack_require__(8); - var getTextContentAccessor = __webpack_require__(54); + var getTextContentAccessor = __webpack_require__(53); /** * This helper class stores information about text content of a target node, @@ -6488,7 +6626,7 @@ module.exports = FallbackCompositionState; /***/ }, -/* 54 */ +/* 53 */ /***/ function(module, exports, __webpack_require__) { /** @@ -6504,7 +6642,7 @@ 'use strict'; - var ExecutionEnvironment = __webpack_require__(52); + var ExecutionEnvironment = __webpack_require__(51); var contentKey = null; @@ -6526,7 +6664,7 @@ module.exports = getTextContentAccessor; /***/ }, -/* 55 */ +/* 54 */ /***/ function(module, exports, __webpack_require__) { /** @@ -6542,7 +6680,7 @@ 'use strict'; - var SyntheticEvent = __webpack_require__(56); + var SyntheticEvent = __webpack_require__(55); /** * @interface Event @@ -6567,7 +6705,7 @@ module.exports = SyntheticCompositionEvent; /***/ }, -/* 56 */ +/* 55 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -6685,7 +6823,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; @@ -6699,9 +6838,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; }, @@ -6833,7 +6979,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 57 */ +/* 56 */ /***/ function(module, exports, __webpack_require__) { /** @@ -6849,7 +6995,7 @@ 'use strict'; - var SyntheticEvent = __webpack_require__(56); + var SyntheticEvent = __webpack_require__(55); /** * @interface Event @@ -6875,7 +7021,7 @@ module.exports = SyntheticInputEvent; /***/ }, -/* 58 */ +/* 57 */ /***/ function(module, exports, __webpack_require__) { /** @@ -6891,17 +7037,17 @@ 'use strict'; - var EventConstants = __webpack_require__(44); - var EventPluginHub = __webpack_require__(46); - var EventPropagators = __webpack_require__(45); - var ExecutionEnvironment = __webpack_require__(52); - var ReactDOMComponentTree = __webpack_require__(39); - var ReactUpdates = __webpack_require__(59); - var SyntheticEvent = __webpack_require__(56); - - var getEventTarget = __webpack_require__(73); - var isEventSupported = __webpack_require__(74); - var isTextInputElement = __webpack_require__(75); + var EventConstants = __webpack_require__(43); + var EventPluginHub = __webpack_require__(45); + var EventPropagators = __webpack_require__(44); + var ExecutionEnvironment = __webpack_require__(51); + var ReactDOMComponentTree = __webpack_require__(38); + var ReactUpdates = __webpack_require__(58); + var SyntheticEvent = __webpack_require__(55); + + var getEventTarget = __webpack_require__(72); + var isEventSupported = __webpack_require__(73); + var isTextInputElement = __webpack_require__(74); var keyOf = __webpack_require__(27); var topLevelTypes = EventConstants.topLevelTypes; @@ -6935,7 +7081,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) { @@ -7001,7 +7147,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); } /** @@ -7205,7 +7351,7 @@ module.exports = ChangeEventPlugin; /***/ }, -/* 59 */ +/* 58 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -7224,11 +7370,11 @@ var _prodInvariant = __webpack_require__(9), _assign = __webpack_require__(6); - var CallbackQueue = __webpack_require__(60); + var CallbackQueue = __webpack_require__(59); var PooledClass = __webpack_require__(8); - var ReactFeatureFlags = __webpack_require__(61); - var ReactReconciler = __webpack_require__(62); - var Transaction = __webpack_require__(72); + var ReactFeatureFlags = __webpack_require__(60); + var ReactReconciler = __webpack_require__(61); + var Transaction = __webpack_require__(71); var invariant = __webpack_require__(10); @@ -7462,7 +7608,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 60 */ +/* 59 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -7574,7 +7720,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 61 */ +/* 60 */ /***/ function(module, exports) { /** @@ -7601,7 +7747,7 @@ module.exports = ReactFeatureFlags; /***/ }, -/* 62 */ +/* 61 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -7617,8 +7763,8 @@ 'use strict'; - var ReactRef = __webpack_require__(63); - var ReactInstrumentation = __webpack_require__(65); + var ReactRef = __webpack_require__(62); + var ReactInstrumentation = __webpack_require__(64); var warning = __webpack_require__(13); @@ -7643,20 +7789,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); } } @@ -7680,14 +7825,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); } } @@ -7722,7 +7866,6 @@ if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement); - ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'receiveComponent'); } } @@ -7740,7 +7883,6 @@ if (process.env.NODE_ENV !== 'production') { if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'receiveComponent'); ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); } } @@ -7762,14 +7904,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); } } @@ -7781,7 +7921,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 63 */ +/* 62 */ /***/ function(module, exports, __webpack_require__) { /** @@ -7797,7 +7937,7 @@ 'use strict'; - var ReactOwner = __webpack_require__(64); + var ReactOwner = __webpack_require__(63); var ReactRef = {}; @@ -7845,7 +7985,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 @@ -7866,7 +8006,7 @@ module.exports = ReactRef; /***/ }, -/* 64 */ +/* 63 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -7966,7 +8106,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 65 */ +/* 64 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -7985,7 +8125,7 @@ var debugTool = null; if (process.env.NODE_ENV !== 'production') { - var ReactDebugTool = __webpack_require__(66); + var ReactDebugTool = __webpack_require__(65); debugTool = ReactDebugTool; } @@ -7993,7 +8133,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 66 */ +/* 65 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -8009,29 +8149,35 @@ 'use strict'; - var ReactInvalidSetStateWarningDevTool = __webpack_require__(67); - var ReactHostOperationHistoryDevtool = __webpack_require__(68); - var ReactComponentTreeDevtool = __webpack_require__(31); - var ReactChildrenMutationWarningDevtool = __webpack_require__(69); - var ExecutionEnvironment = __webpack_require__(52); + var ReactInvalidSetStateWarningHook = __webpack_require__(66); + var ReactHostOperationHistoryHook = __webpack_require__(67); + var ReactComponentTreeHook = __webpack_require__(30); + var ReactChildrenMutationWarningHook = __webpack_require__(68); + var ExecutionEnvironment = __webpack_require__(51); - var performanceNow = __webpack_require__(70); + var performanceNow = __webpack_require__(69); var warning = __webpack_require__(13); - 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; @@ -8048,21 +8194,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; @@ -8072,7 +8218,7 @@ function resetMeasurements() { var previousStartTime = currentFlushStartTime; var previousMeasurements = currentFlushMeasurements || []; - var previousOperations = ReactHostOperationHistoryDevtool.getHistory(); + var previousOperations = ReactHostOperationHistoryHook.getHistory(); if (currentFlushNesting === 0) { currentFlushStartTime = null; @@ -8082,7 +8228,7 @@ } if (previousMeasurements.length || previousOperations.length) { - var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs(); + var registeredIDs = ReactComponentTreeHook.getRegisteredIDs(); flushHistory.push({ duration: performanceNow() - previousStartTime, measurements: previousMeasurements || [], @@ -8097,7 +8243,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) { @@ -8165,13 +8318,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--; } } @@ -8187,7 +8340,7 @@ isProfiling = true; flushHistory.length = 0; resetMeasurements(); - ReactDebugTool.addDevtool(ReactHostOperationHistoryDevtool); + ReactDebugTool.addHook(ReactHostOperationHistoryHook); }, endProfiling: function () { if (!isProfiling) { @@ -8196,7 +8349,7 @@ isProfiling = false; resetMeasurements(); - ReactDebugTool.removeDevtool(ReactHostOperationHistoryDevtool); + ReactDebugTool.removeHook(ReactHostOperationHistoryHook); }, getFlushHistory: function () { return flushHistory; @@ -8223,20 +8376,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'); }, @@ -8247,45 +8386,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); @@ -8299,6 +8411,10 @@ checkDebugID(debugID); emitEvent('onUpdateComponent', debugID); }, + onBeforeUnmountComponent: function (debugID) { + checkDebugID(debugID); + emitEvent('onBeforeUnmountComponent', debugID); + }, onUnmountComponent: function (debugID) { checkDebugID(debugID); emitEvent('onUnmountComponent', debugID); @@ -8308,9 +8424,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(); @@ -8320,7 +8440,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 67 */ +/* 66 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -8331,7 +8451,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'; @@ -8346,7 +8466,7 @@ }; } - var ReactInvalidSetStateWarningDevTool = { + var ReactInvalidSetStateWarningHook = { onBeginProcessingChildContext: function () { processingChildContext = true; }, @@ -8358,11 +8478,11 @@ } }; - module.exports = ReactInvalidSetStateWarningDevTool; + module.exports = ReactInvalidSetStateWarningHook; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 68 */ +/* 67 */ /***/ function(module, exports) { /** @@ -8373,14 +8493,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, @@ -8389,7 +8509,7 @@ }); }, clearHistory: function () { - if (ReactHostOperationHistoryDevtool._preventClearing) { + if (ReactHostOperationHistoryHook._preventClearing) { // Should only be used for tests. return; } @@ -8401,10 +8521,10 @@ } }; - module.exports = ReactHostOperationHistoryDevtool; + module.exports = ReactHostOperationHistoryHook; /***/ }, -/* 69 */ +/* 68 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -8415,17 +8535,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__(31); + var ReactComponentTreeHook = __webpack_require__(30); var warning = __webpack_require__(13); - var elements = {}; - function handleElement(debugID, element) { if (element == null) { return; @@ -8448,31 +8566,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__(5))) /***/ }, -/* 70 */ +/* 69 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -8488,7 +8600,7 @@ * @typechecks */ - var performance = __webpack_require__(71); + var performance = __webpack_require__(70); var performanceNow; @@ -8510,7 +8622,7 @@ module.exports = performanceNow; /***/ }, -/* 71 */ +/* 70 */ /***/ function(module, exports, __webpack_require__) { /** @@ -8526,7 +8638,7 @@ 'use strict'; - var ExecutionEnvironment = __webpack_require__(52); + var ExecutionEnvironment = __webpack_require__(51); var performance; @@ -8537,7 +8649,7 @@ module.exports = performance || {}; /***/ }, -/* 72 */ +/* 71 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -8776,7 +8888,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 73 */ +/* 72 */ /***/ function(module, exports) { /** @@ -8816,7 +8928,7 @@ module.exports = getEventTarget; /***/ }, -/* 74 */ +/* 73 */ /***/ function(module, exports, __webpack_require__) { /** @@ -8832,7 +8944,7 @@ 'use strict'; - var ExecutionEnvironment = __webpack_require__(52); + var ExecutionEnvironment = __webpack_require__(51); var useHasFeature; if (ExecutionEnvironment.canUseDOM) { @@ -8881,7 +8993,7 @@ module.exports = isEventSupported; /***/ }, -/* 75 */ +/* 74 */ /***/ function(module, exports) { /** @@ -8937,7 +9049,7 @@ module.exports = isTextInputElement; /***/ }, -/* 76 */ +/* 75 */ /***/ function(module, exports, __webpack_require__) { /** @@ -8969,7 +9081,7 @@ module.exports = DefaultEventPluginOrder; /***/ }, -/* 77 */ +/* 76 */ /***/ function(module, exports, __webpack_require__) { /** @@ -8985,10 +9097,10 @@ 'use strict'; - var EventConstants = __webpack_require__(44); - var EventPropagators = __webpack_require__(45); - var ReactDOMComponentTree = __webpack_require__(39); - var SyntheticMouseEvent = __webpack_require__(78); + var EventConstants = __webpack_require__(43); + var EventPropagators = __webpack_require__(44); + var ReactDOMComponentTree = __webpack_require__(38); + var SyntheticMouseEvent = __webpack_require__(77); var keyOf = __webpack_require__(27); @@ -9079,7 +9191,7 @@ module.exports = EnterLeaveEventPlugin; /***/ }, -/* 78 */ +/* 77 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9095,10 +9207,10 @@ 'use strict'; - var SyntheticUIEvent = __webpack_require__(79); - var ViewportMetrics = __webpack_require__(80); + var SyntheticUIEvent = __webpack_require__(78); + var ViewportMetrics = __webpack_require__(79); - var getEventModifierState = __webpack_require__(81); + var getEventModifierState = __webpack_require__(80); /** * @interface MouseEvent @@ -9156,7 +9268,7 @@ module.exports = SyntheticMouseEvent; /***/ }, -/* 79 */ +/* 78 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9172,9 +9284,9 @@ 'use strict'; - var SyntheticEvent = __webpack_require__(56); + var SyntheticEvent = __webpack_require__(55); - var getEventTarget = __webpack_require__(73); + var getEventTarget = __webpack_require__(72); /** * @interface UIEvent @@ -9220,7 +9332,7 @@ module.exports = SyntheticUIEvent; /***/ }, -/* 80 */ +/* 79 */ /***/ function(module, exports) { /** @@ -9252,7 +9364,7 @@ module.exports = ViewportMetrics; /***/ }, -/* 81 */ +/* 80 */ /***/ function(module, exports) { /** @@ -9300,7 +9412,7 @@ module.exports = getEventModifierState; /***/ }, -/* 82 */ +/* 81 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9316,7 +9428,7 @@ 'use strict'; - var DOMProperty = __webpack_require__(40); + var DOMProperty = __webpack_require__(39); var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY; var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE; @@ -9337,6 +9449,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 @@ -9417,6 +9531,7 @@ optimum: 0, pattern: 0, placeholder: 0, + playsInline: HAS_BOOLEAN_VALUE, poster: 0, preload: 0, profile: 0, @@ -9514,7 +9629,7 @@ module.exports = HTMLDOMPropertyConfig; /***/ }, -/* 83 */ +/* 82 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9530,8 +9645,8 @@ 'use strict'; - var DOMChildrenOperations = __webpack_require__(84); - var ReactDOMIDOperations = __webpack_require__(96); + var DOMChildrenOperations = __webpack_require__(83); + var ReactDOMIDOperations = __webpack_require__(95); /** * Abstracts away all functionality of the reconciler that requires knowledge of @@ -9542,23 +9657,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; /***/ }, -/* 84 */ +/* 83 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -9574,15 +9680,15 @@ 'use strict'; - var DOMLazyTree = __webpack_require__(85); - var Danger = __webpack_require__(91); - var ReactMultiChildUpdateTypes = __webpack_require__(95); - var ReactDOMComponentTree = __webpack_require__(39); - var ReactInstrumentation = __webpack_require__(65); + var DOMLazyTree = __webpack_require__(84); + var Danger = __webpack_require__(90); + var ReactMultiChildUpdateTypes = __webpack_require__(94); + var ReactDOMComponentTree = __webpack_require__(38); + var ReactInstrumentation = __webpack_require__(64); - var createMicrosoftUnsafeLocalFunction = __webpack_require__(88); - var setInnerHTML = __webpack_require__(87); - var setTextContent = __webpack_require__(89); + var createMicrosoftUnsafeLocalFunction = __webpack_require__(87); + var setInnerHTML = __webpack_require__(86); + var setTextContent = __webpack_require__(88); function getNodeAfter(parentNode, node) { // Special case for text components, which return [open, close] comments @@ -9758,7 +9864,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 85 */ +/* 84 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9774,11 +9880,11 @@ 'use strict'; - var DOMNamespaces = __webpack_require__(86); - var setInnerHTML = __webpack_require__(87); + var DOMNamespaces = __webpack_require__(85); + var setInnerHTML = __webpack_require__(86); - var createMicrosoftUnsafeLocalFunction = __webpack_require__(88); - var setTextContent = __webpack_require__(89); + var createMicrosoftUnsafeLocalFunction = __webpack_require__(87); + var setTextContent = __webpack_require__(88); var ELEMENT_NODE_TYPE = 1; var DOCUMENT_FRAGMENT_NODE_TYPE = 11; @@ -9881,7 +9987,7 @@ module.exports = DOMLazyTree; /***/ }, -/* 86 */ +/* 85 */ /***/ function(module, exports) { /** @@ -9906,7 +10012,7 @@ module.exports = DOMNamespaces; /***/ }, -/* 87 */ +/* 86 */ /***/ function(module, exports, __webpack_require__) { /** @@ -9922,13 +10028,13 @@ 'use strict'; - var ExecutionEnvironment = __webpack_require__(52); - var DOMNamespaces = __webpack_require__(86); + var ExecutionEnvironment = __webpack_require__(51); + var DOMNamespaces = __webpack_require__(85); var WHITESPACE_TEST = /^[ \r\n\t\f]/; var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/; - var createMicrosoftUnsafeLocalFunction = __webpack_require__(88); + var createMicrosoftUnsafeLocalFunction = __webpack_require__(87); // SVG temp container for IE lacking innerHTML var reusableSVGContainer; @@ -9948,9 +10054,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; @@ -10009,7 +10115,7 @@ module.exports = setInnerHTML; /***/ }, -/* 88 */ +/* 87 */ /***/ function(module, exports) { /** @@ -10046,7 +10152,7 @@ module.exports = createMicrosoftUnsafeLocalFunction; /***/ }, -/* 89 */ +/* 88 */ /***/ function(module, exports, __webpack_require__) { /** @@ -10062,9 +10168,9 @@ 'use strict'; - var ExecutionEnvironment = __webpack_require__(52); - var escapeTextContentForBrowser = __webpack_require__(90); - var setInnerHTML = __webpack_require__(87); + var ExecutionEnvironment = __webpack_require__(51); + var escapeTextContentForBrowser = __webpack_require__(89); + var setInnerHTML = __webpack_require__(86); /** * Set the textContent property of a node, ensuring that whitespace is preserved @@ -10099,7 +10205,7 @@ module.exports = setTextContent; /***/ }, -/* 90 */ +/* 89 */ /***/ function(module, exports) { /** @@ -10207,6 +10313,7 @@ } // end code copied and modified from escape-html + /** * Escapes text to prevent scripting attacks. * @@ -10226,7 +10333,7 @@ module.exports = escapeTextContentForBrowser; /***/ }, -/* 91 */ +/* 90 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -10244,10 +10351,10 @@ var _prodInvariant = __webpack_require__(9); - var DOMLazyTree = __webpack_require__(85); - var ExecutionEnvironment = __webpack_require__(52); + var DOMLazyTree = __webpack_require__(84); + var ExecutionEnvironment = __webpack_require__(51); - var createNodesFromMarkup = __webpack_require__(92); + var createNodesFromMarkup = __webpack_require__(91); var emptyFunction = __webpack_require__(14); var invariant = __webpack_require__(10); @@ -10280,7 +10387,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 92 */ +/* 91 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {'use strict'; @@ -10298,10 +10405,10 @@ /*eslint-disable fb-www/unsafe-html*/ - var ExecutionEnvironment = __webpack_require__(52); + var ExecutionEnvironment = __webpack_require__(51); - var createArrayFromMixed = __webpack_require__(93); - var getMarkupWrap = __webpack_require__(94); + var createArrayFromMixed = __webpack_require__(92); + var getMarkupWrap = __webpack_require__(93); var invariant = __webpack_require__(10); /** @@ -10369,7 +10476,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 93 */ +/* 92 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {'use strict'; @@ -10445,7 +10552,7 @@ * @return {boolean} */ function hasArrayNature(obj) { - return( + return ( // not null/false !!obj && ( // arrays are objects, NodeLists are functions in Safari @@ -10501,7 +10608,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 94 */ +/* 93 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {'use strict'; @@ -10518,7 +10625,7 @@ /*eslint-disable fb-www/unsafe-html */ - var ExecutionEnvironment = __webpack_require__(52); + var ExecutionEnvironment = __webpack_require__(51); var invariant = __webpack_require__(10); @@ -10601,7 +10708,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) /***/ }, -/* 95 */ +/* 94 */ /***/ function(module, exports, __webpack_require__) { /** @@ -10638,7 +10745,7 @@ module.exports = ReactMultiChildUpdateTypes; /***/ }, -/* 96 */ +/* 95 */ /***/ function(module, exports, __webpack_require__) { /** @@ -10654,8 +10761,8 @@ 'use strict'; - var DOMChildrenOperations = __webpack_require__(84); - var ReactDOMComponentTree = __webpack_require__(39); + var DOMChildrenOperations = __webpack_require__(83); + var ReactDOMComponentTree = __webpack_require__(38); /** * Operations used to process updates to DOM nodes. @@ -10677,7 +10784,7 @@ module.exports = ReactDOMIDOperations; /***/ }, -/* 97 */ +/* 96 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -10698,35 +10805,34 @@ var _prodInvariant = __webpack_require__(9), _assign = __webpack_require__(6); - var AutoFocusUtils = __webpack_require__(98); - var CSSPropertyOperations = __webpack_require__(100); - var DOMLazyTree = __webpack_require__(85); - var DOMNamespaces = __webpack_require__(86); - var DOMProperty = __webpack_require__(40); - var DOMPropertyOperations = __webpack_require__(108); - var EventConstants = __webpack_require__(44); - var EventPluginHub = __webpack_require__(46); - var EventPluginRegistry = __webpack_require__(47); - var ReactBrowserEventEmitter = __webpack_require__(114); - var ReactComponentBrowserEnvironment = __webpack_require__(83); - var ReactDOMButton = __webpack_require__(117); - var ReactDOMComponentFlags = __webpack_require__(41); - var ReactDOMComponentTree = __webpack_require__(39); - var ReactDOMInput = __webpack_require__(119); - var ReactDOMOption = __webpack_require__(121); - var ReactDOMSelect = __webpack_require__(122); - var ReactDOMTextarea = __webpack_require__(123); - var ReactInstrumentation = __webpack_require__(65); - var ReactMultiChild = __webpack_require__(124); - var ReactServerRenderingTransaction = __webpack_require__(136); + var AutoFocusUtils = __webpack_require__(97); + var CSSPropertyOperations = __webpack_require__(99); + var DOMLazyTree = __webpack_require__(84); + var DOMNamespaces = __webpack_require__(85); + var DOMProperty = __webpack_require__(39); + var DOMPropertyOperations = __webpack_require__(107); + var EventConstants = __webpack_require__(43); + var EventPluginHub = __webpack_require__(45); + var EventPluginRegistry = __webpack_require__(46); + var ReactBrowserEventEmitter = __webpack_require__(109); + var ReactDOMButton = __webpack_require__(112); + var ReactDOMComponentFlags = __webpack_require__(40); + var ReactDOMComponentTree = __webpack_require__(38); + var ReactDOMInput = __webpack_require__(114); + var ReactDOMOption = __webpack_require__(116); + var ReactDOMSelect = __webpack_require__(117); + var ReactDOMTextarea = __webpack_require__(118); + var ReactInstrumentation = __webpack_require__(64); + var ReactMultiChild = __webpack_require__(119); + var ReactServerRenderingTransaction = __webpack_require__(131); var emptyFunction = __webpack_require__(14); - var escapeTextContentForBrowser = __webpack_require__(90); + var escapeTextContentForBrowser = __webpack_require__(89); var invariant = __webpack_require__(10); - var isEventSupported = __webpack_require__(74); + var isEventSupported = __webpack_require__(73); var keyOf = __webpack_require__(27); - var shallowEqual = __webpack_require__(131); - var validateDOMNesting = __webpack_require__(139); + var shallowEqual = __webpack_require__(126); + var validateDOMNesting = __webpack_require__(134); var warning = __webpack_require__(13); var Flags = ReactDOMComponentFlags; @@ -10878,12 +10984,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) { @@ -10893,18 +11000,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]); } @@ -11065,15 +11167,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); } } @@ -11087,14 +11189,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; @@ -11175,7 +11275,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); } @@ -11250,15 +11350,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; }, @@ -11353,7 +11444,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); @@ -11390,7 +11481,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) { @@ -11427,8 +11518,6 @@ * @overridable */ updateComponent: function (transaction, prevElement, nextElement, context) { - var _this2 = this; - var lastProps = prevElement.props; var nextProps = this._currentElement.props; @@ -11438,7 +11527,6 @@ nextProps = ReactDOMButton.getHostProps(this, nextProps); break; case 'input': - ReactDOMInput.updateWrapper(this); lastProps = ReactDOMInput.getHostProps(this, lastProps); nextProps = ReactDOMInput.getHostProps(this, nextProps); break; @@ -11451,7 +11539,6 @@ nextProps = ReactDOMSelect.getHostProps(this, nextProps); break; case 'textarea': - ReactDOMTextarea.updateWrapper(this); lastProps = ReactDOMTextarea.getHostProps(this, lastProps); nextProps = ReactDOMTextarea.getHostProps(this, nextProps); break; @@ -11461,19 +11548,21 @@ this._updateDOMProperties(lastProps, nextProps, transaction); this._updateDOMChildren(lastProps, nextProps, transaction, context); - if (this._tag === 'select') { - // value update needs to occur after