diff --git a/docs/displaying-data-it-IT.html b/docs/displaying-data-it-IT.html index 63352e3ece..2b27578156 100644 --- a/docs/displaying-data-it-IT.html +++ b/docs/displaying-data-it-IT.html @@ -439,8 +439,8 @@ <head> <meta charset="UTF-8" /> <title>Hello React</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> </head> <body> diff --git a/docs/displaying-data-ja-JP.html b/docs/displaying-data-ja-JP.html index 338656c33d..7d39c2d9a6 100644 --- a/docs/displaying-data-ja-JP.html +++ b/docs/displaying-data-ja-JP.html @@ -439,8 +439,8 @@ <head> <meta charset="UTF-8" /> <title>Hello React</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> </head> <body> diff --git a/docs/displaying-data-ko-KR.html b/docs/displaying-data-ko-KR.html index 937585fea7..0734aedac9 100644 --- a/docs/displaying-data-ko-KR.html +++ b/docs/displaying-data-ko-KR.html @@ -439,8 +439,8 @@ <head> <meta charset="UTF-8" /> <title>Hello React</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> </head> <body> diff --git a/docs/displaying-data-ru-RU.html b/docs/displaying-data-ru-RU.html index a497a5a2fd..411c01f52f 100644 --- a/docs/displaying-data-ru-RU.html +++ b/docs/displaying-data-ru-RU.html @@ -439,8 +439,8 @@ <head> <meta charset="UTF-8" /> <title>Hello React</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> </head> <body> diff --git a/docs/displaying-data-zh-CN.html b/docs/displaying-data-zh-CN.html index d11beb4965..7d5e5278aa 100644 --- a/docs/displaying-data-zh-CN.html +++ b/docs/displaying-data-zh-CN.html @@ -439,8 +439,8 @@ <head> <meta charset="UTF-8" /> <title>Hello React</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> </head> <body> diff --git a/docs/displaying-data-zh-TW.html b/docs/displaying-data-zh-TW.html index e498e96e3d..0186c546ec 100644 --- a/docs/displaying-data-zh-TW.html +++ b/docs/displaying-data-zh-TW.html @@ -439,8 +439,8 @@ <head> <meta charset="UTF-8" /> <title>Hello React</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> </head> <body> diff --git a/docs/displaying-data.html b/docs/displaying-data.html index 35a8115bcd..8f1c3d4d6b 100644 --- a/docs/displaying-data.html +++ b/docs/displaying-data.html @@ -439,8 +439,8 @@ <head> <meta charset="UTF-8" /> <title>Hello React</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> </head> <body> diff --git a/docs/getting-started-it-IT.html b/docs/getting-started-it-IT.html index 11430e7538..098314cd48 100644 --- a/docs/getting-started-it-IT.html +++ b/docs/getting-started-it-IT.html @@ -442,8 +442,8 @@

Scarica lo starter kit per cominciare.

- - Scarica lo Starter Kit 15.3.1 + + Scarica lo Starter Kit 15.3.2
diff --git a/docs/getting-started-ja-JP.html b/docs/getting-started-ja-JP.html index f66a526ac8..8e423a7d17 100644 --- a/docs/getting-started-ja-JP.html +++ b/docs/getting-started-ja-JP.html @@ -442,8 +442,8 @@

始めるためにスターターキットをダウンロードしましょう。

- - Download Starter Kit 15.3.1 + + Download Starter Kit 15.3.2
diff --git a/docs/getting-started-ko-KR.html b/docs/getting-started-ko-KR.html index 1047038489..2f9c67ddcc 100644 --- a/docs/getting-started-ko-KR.html +++ b/docs/getting-started-ko-KR.html @@ -462,8 +462,8 @@

만약 당신이 npm을 사용할 준비가 아직 안되었다면, 미리빌드된 React와 React DOM 파일이 포함된 초심자용 키트를 다운로드 받을 수 있습니다.

- - 초심자용 키트 내려받기 15.3.1 + + 초심자용 키트 내려받기 15.3.2
diff --git a/docs/getting-started-zh-CN.html b/docs/getting-started-zh-CN.html index ae98136ff9..9eb9fa2dd3 100644 --- a/docs/getting-started-zh-CN.html +++ b/docs/getting-started-zh-CN.html @@ -473,8 +473,8 @@

如果你现在还没准备要使用npm,你可以下载这个已经包含了预构建的 React 和 React DOM 拷贝的入门套件.

- - 下载入门套件 15.3.1 + + 下载入门套件 15.3.2
diff --git a/docs/getting-started.html b/docs/getting-started.html index 096fe9af91..a69c620a05 100644 --- a/docs/getting-started.html +++ b/docs/getting-started.html @@ -446,8 +446,8 @@

If you're just getting started, you can download the starter kit. The starter kit includes prebuilt copies of React and React DOM for the browser, as well as a collection of usage examples to help you get started.

- - Download Starter Kit 15.3.1 + + Download Starter Kit 15.3.2
diff --git a/docs/tutorial-it-IT.html b/docs/tutorial-it-IT.html index b994b49365..bdf1ac75a2 100644 --- a/docs/tutorial-it-IT.html +++ b/docs/tutorial-it-IT.html @@ -462,8 +462,8 @@ <head> <meta charset="utf-8" /> <title>React Tutorial</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> <script src="https://unpkg.com/jquery@3.1.0/dist/jquery.min.js"></script> <script src="https://unpkg.com/remarkable@1.6.2/dist/remarkable.min.js"></script> @@ -613,8 +613,8 @@ <head> <meta charset="utf-8" /> <title>React Tutorial</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> <script src="https://unpkg.com/jquery@3.1.0/dist/jquery.min.js"></script> <script src="https://unpkg.com/remarkable@1.6.2/dist/remarkable.min.js"></script> diff --git a/docs/tutorial-ja-JP.html b/docs/tutorial-ja-JP.html index e1fb4ed8c6..32ff1af360 100644 --- a/docs/tutorial-ja-JP.html +++ b/docs/tutorial-ja-JP.html @@ -462,8 +462,8 @@ <head> <meta charset="UTF-8" /> <title>React Tutorial</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> <script src="https://unpkg.com/jquery@3.1.0/dist/jquery.min.js"></script> <script src="https://unpkg.com/remarkable@1.6.2/dist/remarkable.min.js"></script> @@ -610,8 +610,8 @@ <head> <meta charset="UTF-8" /> <title>Hello React</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> <script src="https://unpkg.com/jquery@3.1.0/dist/jquery.min.js"></script> <script src="https://unpkg.com/remarkable@1.6.2/dist/remarkable.min.js"></script> diff --git a/docs/tutorial-ko-KR.html b/docs/tutorial-ko-KR.html index 6887421347..7092459a9d 100644 --- a/docs/tutorial-ko-KR.html +++ b/docs/tutorial-ko-KR.html @@ -462,8 +462,8 @@ <head> <meta charset="utf-8" /> <title>React Tutorial</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> <script src="https://unpkg.com/jquery@3.1.0/dist/jquery.min.js"></script> <script src="https://unpkg.com/remarkable@1.6.2/dist/remarkable.min.js"></script> @@ -615,8 +615,8 @@ <head> <meta charset="utf-8" /> <title>React Tutorial</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> <script src="https://unpkg.com/jquery@3.1.0/dist/jquery.min.js"></script> <script src="https://unpkg.com/remarkable@1.6.2/dist/remarkable.min.js"></script> diff --git a/docs/tutorial-zh-CN.html b/docs/tutorial-zh-CN.html index ca2d33a932..919457205f 100644 --- a/docs/tutorial-zh-CN.html +++ b/docs/tutorial-zh-CN.html @@ -462,8 +462,8 @@ <head> <meta charset="utf-8" /> <title>React Tutorial</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> <script src="https://unpkg.com/jquery@3.1.0/dist/jquery.min.js"></script> <script src="https://unpkg.com/remarkable@1.6.2/dist/remarkable.min.js"></script> diff --git a/docs/tutorial.html b/docs/tutorial.html index c2b56b21bb..fb68ef2c3b 100644 --- a/docs/tutorial.html +++ b/docs/tutorial.html @@ -462,8 +462,8 @@ <head> <meta charset="utf-8" /> <title>React Tutorial</title> - <script src="https://unpkg.com/react@15.3.1/dist/react.js"></script> - <script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script> + <script src="https://unpkg.com/react@15.3.2/dist/react.js"></script> + <script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script> <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script> <script src="https://unpkg.com/jquery@3.1.0/dist/jquery.min.js"></script> <script src="https://unpkg.com/remarkable@1.6.2/dist/remarkable.min.js"></script> diff --git a/downloads.html b/downloads.html index 8ac007c3ad..61d14695bb 100644 --- a/downloads.html +++ b/downloads.html @@ -76,30 +76,30 @@ get started with React. The starter kit includes React and some simple example apps.

Development vs. Production Builds #

We provide two versions of React: an uncompressed version for development and a minified version for production. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages.

If you're just starting out, make sure to use the development version.

-

Individual Downloads #

React 15.3.1 (development) #

-

The uncompressed, development version of react.js and react-dom.js with inline documentation (you need both files).

-
<script src="https://unpkg.com/react@15.3.1/dist/react.js"></script>
-<script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script>
-

React 15.3.1 (production) #

-

The compressed, production version of react.js and react-dom.js (you need both).

-
<script src="https://unpkg.com/react@15.3.1/dist/react.min.js"></script>
-<script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.min.js"></script>
-

React with Add-Ons 15.3.1 (development) #

+

Individual Downloads #

React 15.3.2 (development) #

+

The uncompressed, development version of react.js and react-dom.js with inline documentation (you need both files).

+
<script src="https://unpkg.com/react@15.3.2/dist/react.js"></script>
+<script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script>
+

React 15.3.2 (production) #

+

The compressed, production version of react.js and react-dom.js (you need both).

+
<script src="https://unpkg.com/react@15.3.2/dist/react.min.js"></script>
+<script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.min.js"></script>
+

React with Add-Ons 15.3.2 (development) #

The uncompressed, development version of React with optional add-ons.

-
<script src="https://unpkg.com/react@15.3.1/dist/react-with-addons.js"></script>
-<script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.js"></script>
-

React with Add-Ons 15.3.1 (production) #

+
<script src="https://unpkg.com/react@15.3.2/dist/react-with-addons.js"></script>
+<script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.js"></script>
+

React with Add-Ons 15.3.2 (production) #

The compressed, production version of React with optional add-ons.

-
<script src="https://unpkg.com/react@15.3.1/dist/react-with-addons.min.js"></script>
-<script src="https://unpkg.com/react-dom@15.3.1/dist/react-dom.min.js"></script>
+
<script src="https://unpkg.com/react@15.3.2/dist/react-with-addons.min.js"></script>
+<script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.min.js"></script>
 

Note:

diff --git a/downloads/react-15.3.2.zip b/downloads/react-15.3.2.zip new file mode 100644 index 0000000000..bde0e3276a Binary files /dev/null and b/downloads/react-15.3.2.zip differ diff --git a/index.html b/index.html index 0c02f67c85..c6723c9c88 100644 --- a/index.html +++ b/index.html @@ -76,7 +76,7 @@
@@ -162,7 +162,7 @@

diff --git a/js/react-dom.js b/js/react-dom.js index 0fb7045159..9c8699b683 100644 --- a/js/react-dom.js +++ b/js/react-dom.js @@ -1,5 +1,5 @@ /** - * ReactDOM v15.3.1 + * ReactDOM v15.3.2 * * Copyright 2013-present, Facebook, Inc. * All rights reserved. diff --git a/js/react.js b/js/react.js index 04c18504ae..3affcaa7d8 100644 --- a/js/react.js +++ b/js/react.js @@ -1,5 +1,5 @@ /** - * React v15.3.1 + * React v15.3.2 */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 8); + doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8); } function manualDispatchChangeEvent(nativeEvent) { @@ -1001,7 +1003,7 @@ if (ExecutionEnvironment.canUseDOM) { // 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); } /** @@ -3298,6 +3300,8 @@ var HTMLDOMPropertyConfig = { 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 @@ -3378,6 +3382,7 @@ var HTMLDOMPropertyConfig = { optimum: 0, pattern: 0, placeholder: 0, + playsInline: HAS_BOOLEAN_VALUE, poster: 0, preload: 0, profile: 0, @@ -4175,6 +4180,19 @@ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle); }, + /** + * Protect against document.createEvent() returning null + * Some popup blocker extensions appear to do this: + * https://github.com/facebook/react/issues/6887 + */ + supportsEventPageXY: function () { + if (!document.createEvent) { + return false; + } + var ev = document.createEvent('MouseEvent'); + return ev != null && 'pageX' in ev; + }, + /** * Listens to window scroll and resize events. We cache scroll values so that * application code can access them without triggering reflows. @@ -4188,7 +4206,7 @@ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { */ ensureScrollValueMonitoring: function () { if (hasEventPageXY === undefined) { - hasEventPageXY = document.createEvent && 'pageX' in document.createEvent('MouseEvent'); + hasEventPageXY = ReactBrowserEventEmitter.supportsEventPageXY(); } if (!hasEventPageXY && !isMonitoringScrollValue) { var refresh = ViewportMetrics.refreshScrollValues; @@ -5931,28 +5949,6 @@ function warnIfInvalidElement(Component, element) { } } -function invokeComponentDidMountWithTimer() { - var publicInstance = this._instance; - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidMount'); - } - publicInstance.componentDidMount(); - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidMount'); - } -} - -function invokeComponentDidUpdateWithTimer(prevProps, prevState, prevContext) { - var publicInstance = this._instance; - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidUpdate'); - } - publicInstance.componentDidUpdate(prevProps, prevState, prevContext); - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidUpdate'); - } -} - function shouldConstruct(Component) { return !!(Component.prototype && Component.prototype.isReactComponent); } @@ -5961,6 +5957,23 @@ function isPureComponent(Component) { return !!(Component.prototype && Component.prototype.isPureReactComponent); } +// Separated into a function to contain deoptimizations caused by try/finally. +function measureLifeCyclePerf(fn, debugID, timerType) { + if (debugID === 0) { + // Top-level wrappers (see ReactMount) and empty components (see + // ReactDOMEmptyComponent) are invisible to hooks and devtools. + // Both are implementation details that should go away in the future. + return fn(); + } + + ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType); + try { + return fn(); + } finally { + ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType); + } +} + /** * ------------------ The Life-Cycle of a Composite Component ------------------ * @@ -6052,6 +6065,8 @@ var ReactCompositeComponentMixin = { * @internal */ mountComponent: function (transaction, hostParent, hostContainerInfo, context) { + var _this = this; + this._context = context; this._mountOrder = nextMountID++; this._hostParent = hostParent; @@ -6141,7 +6156,11 @@ var ReactCompositeComponentMixin = { if (inst.componentDidMount) { if ("development" !== 'production') { - transaction.getReactMountReady().enqueue(invokeComponentDidMountWithTimer, this); + transaction.getReactMountReady().enqueue(function () { + measureLifeCyclePerf(function () { + return inst.componentDidMount(); + }, _this._debugID, 'componentDidMount'); + }); } else { transaction.getReactMountReady().enqueue(inst.componentDidMount, inst); } @@ -6165,35 +6184,26 @@ var ReactCompositeComponentMixin = { _constructComponentWithoutOwner: function (doConstruct, publicProps, publicContext, updateQueue) { var Component = this._currentElement.type; - var instanceOrElement; + if (doConstruct) { if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'ctor'); - } - } - instanceOrElement = new Component(publicProps, publicContext, updateQueue); - if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'ctor'); - } - } - } else { - // This can still be an instance in case of factory components - // but we'll count this as time spent rendering as the more common case. - if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render'); - } - } - instanceOrElement = Component(publicProps, publicContext, updateQueue); - if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render'); - } + return measureLifeCyclePerf(function () { + return new Component(publicProps, publicContext, updateQueue); + }, this._debugID, 'ctor'); + } else { + return new Component(publicProps, publicContext, updateQueue); } } - return instanceOrElement; + + // This can still be an instance in case of factory components + // but we'll count this as time spent rendering as the more common case. + if ("development" !== 'production') { + return measureLifeCyclePerf(function () { + return Component(publicProps, publicContext, updateQueue); + }, this._debugID, 'render'); + } else { + return Component(publicProps, publicContext, updateQueue); + } }, performInitialMountWithErrorHandling: function (renderedElement, hostParent, hostContainerInfo, transaction, context) { @@ -6202,11 +6212,6 @@ var ReactCompositeComponentMixin = { try { markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); } catch (e) { - if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onError(); - } - } // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint transaction.rollback(checkpoint); this._instance.unstable_handleError(e); @@ -6227,17 +6232,19 @@ var ReactCompositeComponentMixin = { performInitialMount: function (renderedElement, hostParent, hostContainerInfo, transaction, context) { var inst = this._instance; + + var debugID = 0; + if ("development" !== 'production') { + debugID = this._debugID; + } + if (inst.componentWillMount) { if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillMount'); - } - } - inst.componentWillMount(); - if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillMount'); - } + measureLifeCyclePerf(function () { + return inst.componentWillMount(); + }, debugID, 'componentWillMount'); + } else { + inst.componentWillMount(); } // When mounting, calls to `setState` by `componentWillMount` will set // `this._pendingStateQueue` without triggering a re-render. @@ -6257,15 +6264,12 @@ var ReactCompositeComponentMixin = { ); this._renderedComponent = child; - var selfDebugID = 0; - if ("development" !== 'production') { - selfDebugID = this._debugID; - } - var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), selfDebugID); + var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID); if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onSetChildren(this._debugID, child._debugID !== 0 ? [child._debugID] : []); + if (debugID !== 0) { + var childDebugIDs = child._debugID !== 0 ? [child._debugID] : []; + ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs); } } @@ -6286,24 +6290,22 @@ var ReactCompositeComponentMixin = { if (!this._renderedComponent) { return; } + var inst = this._instance; if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) { inst._calledComponentWillUnmount = true; - if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUnmount'); - } - } + if (safely) { var name = this.getName() + '.componentWillUnmount()'; ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst)); } else { - inst.componentWillUnmount(); - } - if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUnmount'); + if ("development" !== 'production') { + measureLifeCyclePerf(function () { + return inst.componentWillUnmount(); + }, this._debugID, 'componentWillUnmount'); + } else { + inst.componentWillUnmount(); } } } @@ -6390,13 +6392,21 @@ var ReactCompositeComponentMixin = { _processChildContext: function (currentContext) { var Component = this._currentElement.type; var inst = this._instance; - if ("development" !== 'production') { - ReactInstrumentation.debugTool.onBeginProcessingChildContext(); - } - var childContext = inst.getChildContext && inst.getChildContext(); - if ("development" !== 'production') { - ReactInstrumentation.debugTool.onEndProcessingChildContext(); + var childContext; + + if (inst.getChildContext) { + if ("development" !== 'production') { + ReactInstrumentation.debugTool.onBeginProcessingChildContext(); + try { + childContext = inst.getChildContext(); + } finally { + ReactInstrumentation.debugTool.onEndProcessingChildContext(); + } + } else { + childContext = inst.getChildContext(); + } } + if (childContext) { !(typeof Component.childContextTypes === 'object') ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', this.getName() || 'ReactCompositeComponent') : _prodInvariant('107', this.getName() || 'ReactCompositeComponent') : void 0; if ("development" !== 'production') { @@ -6491,15 +6501,11 @@ var ReactCompositeComponentMixin = { // immediately reconciled instead of waiting for the next batch. if (willReceive && inst.componentWillReceiveProps) { if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillReceiveProps'); - } - } - inst.componentWillReceiveProps(nextProps, nextContext); - if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillReceiveProps'); - } + measureLifeCyclePerf(function () { + return inst.componentWillReceiveProps(nextProps, nextContext); + }, this._debugID, 'componentWillReceiveProps'); + } else { + inst.componentWillReceiveProps(nextProps, nextContext); } } @@ -6509,15 +6515,11 @@ var ReactCompositeComponentMixin = { if (!this._pendingForceUpdate) { if (inst.shouldComponentUpdate) { if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'shouldComponentUpdate'); - } - } - shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext); - if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'shouldComponentUpdate'); - } + shouldUpdate = measureLifeCyclePerf(function () { + return inst.shouldComponentUpdate(nextProps, nextState, nextContext); + }, this._debugID, 'shouldComponentUpdate'); + } else { + shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext); } } else { if (this._compositeType === CompositeTypes.PureClass) { @@ -6583,6 +6585,8 @@ var ReactCompositeComponentMixin = { * @private */ _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) { + var _this2 = this; + var inst = this._instance; var hasComponentDidUpdate = Boolean(inst.componentDidUpdate); @@ -6597,15 +6601,11 @@ var ReactCompositeComponentMixin = { if (inst.componentWillUpdate) { if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUpdate'); - } - } - inst.componentWillUpdate(nextProps, nextState, nextContext); - if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUpdate'); - } + measureLifeCyclePerf(function () { + return inst.componentWillUpdate(nextProps, nextState, nextContext); + }, this._debugID, 'componentWillUpdate'); + } else { + inst.componentWillUpdate(nextProps, nextState, nextContext); } } @@ -6619,7 +6619,9 @@ var ReactCompositeComponentMixin = { if (hasComponentDidUpdate) { if ("development" !== 'production') { - transaction.getReactMountReady().enqueue(invokeComponentDidUpdateWithTimer.bind(this, prevProps, prevState, prevContext), this); + transaction.getReactMountReady().enqueue(function () { + measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), _this2._debugID, 'componentDidUpdate'); + }); } else { transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst); } @@ -6636,6 +6638,12 @@ var ReactCompositeComponentMixin = { var prevComponentInstance = this._renderedComponent; var prevRenderedElement = prevComponentInstance._currentElement; var nextRenderedElement = this._renderValidatedComponent(); + + var debugID = 0; + if ("development" !== 'production') { + debugID = this._debugID; + } + if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) { ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context)); } else { @@ -6648,15 +6656,12 @@ var ReactCompositeComponentMixin = { ); this._renderedComponent = child; - var selfDebugID = 0; - if ("development" !== 'production') { - selfDebugID = this._debugID; - } - var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), selfDebugID); + var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID); if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onSetChildren(this._debugID, child._debugID !== 0 ? [child._debugID] : []); + if (debugID !== 0) { + var childDebugIDs = child._debugID !== 0 ? [child._debugID] : []; + ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs); } } @@ -6678,17 +6683,14 @@ var ReactCompositeComponentMixin = { */ _renderValidatedComponentWithoutOwnerOrContext: function () { var inst = this._instance; + var renderedComponent; if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render'); - } - } - var renderedComponent = inst.render(); - if ("development" !== 'production') { - if (this._debugID !== 0) { - ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render'); - } + renderedComponent = measureLifeCyclePerf(function () { + return inst.render(); + }, this._debugID, 'render'); + } else { + renderedComponent = inst.render(); } if ("development" !== 'production') { @@ -6739,7 +6741,7 @@ var ReactCompositeComponentMixin = { var publicComponentInstance = component.getPublicInstance(); if ("development" !== 'production') { var componentName = component && component.getName ? component.getName() : 'a component'; - "development" !== 'production' ? warning(publicComponentInstance != null, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0; + "development" !== 'production' ? warning(publicComponentInstance != null || component._compositeType !== CompositeTypes.StatelessFunctional, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0; } var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs; refs[ref] = publicComponentInstance; @@ -7163,9 +7165,9 @@ function optionPostMount() { ReactDOMOption.postMountWrapper(inst); } -var setContentChildForInstrumentation = emptyFunction; +var setAndValidateContentChildDev = emptyFunction; if ("development" !== 'production') { - setContentChildForInstrumentation = function (content) { + setAndValidateContentChildDev = function (content) { var hasExistingContent = this._contentDebugID != null; var debugID = this._debugID; // This ID represents the inlined child that has no backing instance: @@ -7179,6 +7181,7 @@ if ("development" !== 'production') { return; } + validateDOMNesting(null, String(content), this, this._ancestorInfo); this._contentDebugID = contentDebugID; if (hasExistingContent) { ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content); @@ -7353,7 +7356,7 @@ function ReactDOMComponent(element) { this._flags = 0; if ("development" !== 'production') { this._ancestorInfo = null; - setContentChildForInstrumentation.call(this, null); + setAndValidateContentChildDev.call(this, null); } } @@ -7453,7 +7456,7 @@ ReactDOMComponent.Mixin = { 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); } @@ -7622,7 +7625,7 @@ ReactDOMComponent.Mixin = { // TODO: Validate that text is allowed as a child of this node ret = escapeTextContentForBrowser(contentToUse); if ("development" !== 'production') { - setContentChildForInstrumentation.call(this, contentToUse); + setAndValidateContentChildDev.call(this, contentToUse); } } else if (childrenToUse != null) { var mountImages = this.mountChildren(childrenToUse, transaction, context); @@ -7659,7 +7662,7 @@ ReactDOMComponent.Mixin = { if (contentToUse != null) { // TODO: Validate that text is allowed as a child of this node if ("development" !== 'production') { - setContentChildForInstrumentation.call(this, contentToUse); + setAndValidateContentChildDev.call(this, contentToUse); } DOMLazyTree.queueText(lazyTree, contentToUse); } else if (childrenToUse != null) { @@ -7891,7 +7894,7 @@ ReactDOMComponent.Mixin = { if (lastContent !== nextContent) { this.updateTextContent('' + nextContent); if ("development" !== 'production') { - setContentChildForInstrumentation.call(this, nextContent); + setAndValidateContentChildDev.call(this, nextContent); } } } else if (nextHtml != null) { @@ -7903,7 +7906,7 @@ ReactDOMComponent.Mixin = { } } else if (nextChildren != null) { if ("development" !== 'production') { - setContentChildForInstrumentation.call(this, null); + setAndValidateContentChildDev.call(this, null); } this.updateChildren(nextChildren, transaction, context); @@ -7958,7 +7961,7 @@ ReactDOMComponent.Mixin = { this._wrapperState = null; if ("development" !== 'production') { - setContentChildForInstrumentation.call(this, null); + setAndValidateContentChildDev.call(this, null); } }, @@ -8541,7 +8544,7 @@ function forceUpdateIfMounted() { function isControlled(props) { var usesChecked = props.type === 'checkbox' || props.type === 'radio'; - return usesChecked ? props.checked !== undefined : props.value !== undefined; + return usesChecked ? props.checked != null : props.value != null; } /** @@ -9455,7 +9458,7 @@ _assign(ReactDOMTextComponent.prototype, { if (parentInfo) { // parentInfo should always be present except for the top-level // component when server rendering - validateDOMNesting('#text', this, parentInfo); + validateDOMNesting(null, this._stringText, this, parentInfo); } } @@ -10191,12 +10194,6 @@ var ReactDebugTool = { endLifeCycleTimer(debugID, timerType); emitEvent('onEndLifeCycleTimer', debugID, timerType); }, - onError: function (debugID) { - if (currentTimerDebugID != null) { - endLifeCycleTimer(currentTimerDebugID, currentTimerType); - } - emitEvent('onError', debugID); - }, onBeginProcessingChildContext: function () { emitEvent('onBeginProcessingChildContext'); }, @@ -10605,14 +10602,6 @@ ReactElement.createElement = function (type, config, children) { var source = null; if (config != null) { - if ("development" !== 'production') { - "development" !== '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; } @@ -10713,14 +10702,6 @@ ReactElement.cloneElement = function (element, config, children) { var owner = element._owner; if (config != null) { - if ("development" !== 'production') { - "development" !== '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; @@ -14854,7 +14835,7 @@ module.exports = ReactUpdates; 'use strict'; -module.exports = '15.3.1'; +module.exports = '15.3.2'; },{}],98:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. @@ -15194,7 +15175,7 @@ var eventTypes = { bubbled: keyOf({ onSelect: null }), captured: keyOf({ onSelectCapture: null }) }, - dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange] + dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange] } }; @@ -16260,7 +16241,8 @@ _assign(SyntheticEvent.prototype, { if (event.preventDefault) { event.preventDefault(); - } else { + } else if (typeof event.returnValue !== 'unknown') { + // eslint-disable-line valid-typeof event.returnValue = false; } this.isDefaultPrevented = emptyFunction.thatReturnsTrue; @@ -18650,9 +18632,9 @@ var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) { 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; @@ -19259,11 +19241,16 @@ if ("development" !== 'production') { var didWarn = {}; - validateDOMNesting = function (childTag, childInstance, ancestorInfo) { + validateDOMNesting = function (childTag, childText, childInstance, ancestorInfo) { ancestorInfo = ancestorInfo || emptyAncestorInfo; var parentInfo = ancestorInfo.current; var parentTag = parentInfo && parentInfo.tag; + if (childText != null) { + "development" !== 'production' ? warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0; + childTag = '#text'; + } + var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo; var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo); var problematic = invalidParent || invalidAncestor; @@ -19311,7 +19298,15 @@ if ("development" !== 'production') { didWarn[warnKey] = true; var tagDisplayName = childTag; - if (childTag !== '#text') { + var whitespaceInfo = ''; + if (childTag === '#text') { + if (/\S/.test(childText)) { + tagDisplayName = 'Text nodes'; + } else { + tagDisplayName = 'Whitespace text nodes'; + whitespaceInfo = ' Make sure you don\'t have any extra whitespace between tags on ' + 'each line of your source code.'; + } + } else { tagDisplayName = '<' + childTag + '>'; } @@ -19320,7 +19315,7 @@ if ("development" !== 'production') { if (ancestorTag === 'table' && childTag === 'tr') { info += ' Add a to your code to match the DOM tree generated by ' + 'the browser.'; } - "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>. ' + 'See %s.%s', tagDisplayName, ancestorTag, ownerInfo, info) : void 0; + "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s ' + 'See %s.%s', tagDisplayName, ancestorTag, whitespaceInfo, ownerInfo, info) : void 0; } else { "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0; }