diff --git a/_config.yml b/_config.yml index 007258f9..53fa1d01 100644 --- a/_config.yml +++ b/_config.yml @@ -53,13 +53,13 @@ sass: gems: - jekyll-redirect-from - jekyll-paginate -react_version: 15.3.1 +react_version: 15.3.2 react_hashes: - dev: gS+zau+tpUQYisQ0pOWmfNOfcczNoZQjeQ6+5jOgVqV1WBYqkIbdqpay3VuCHQjt - prod: GjSRThJn3fjCmKim4Jou04Ax7vvKfk76xSCKUo7/V70VNIlidvZd3ZnT9rtJk0KM - addons_dev: 37FL10I5CNyIhpG9UrOeUrUKONP5CUt3PYHxWz9Eo4kYWS7weaFzDRP7BxRfhB75 - addons_prod: hSlojvw2moZ49rKg6U9wW83sJi7QnWC6nB53jlsGy5hmltJC6ET/cRRKzMifYEg5 - dom_dev: yMyOXveaWIIfHWhBZNUrKSPQCw+BWRGucJIdsQeltkvBNDrWXKo+jKVKyx6hH/5r - dom_prod: 3AR/0xGUlR37VpbeHbKQhvizC4T8sNTU8t5GS9JC/4odeRePZuPYl5Pyv/zTeSd8 - dom_server_dev: sPg6+OzdWmnH1aArppe66vtLc7tZ2gxh5KxXoZFHAxZoquTi4J71PHASGmv7meE1 - dom_server_prod: L4CScwloTXP7xdPmmp3KRAKqASCN8hQpjM6DsrAyCl4K8RXi8Ig+9i0X6k8AyfM9 + dev: bQIyvl+8Ufi5KiKZPG9VItNWmhcAXA1pa5nHIEoBGob+rdbjJnpNV3s288Mz2yZu + prod: drG4TSBgFQ0Hb/A3ynRyFDT22irpJDL+duuxvYD5mkC9adCYDqEwnX13371waqiH + addons_dev: gCLxBq3yes/qREmjcw3Tdk5dUh3iB54huWqgxq1lAJZTYzLahJqEik5ZiVnq9Zt4 + addons_prod: pmUKSclxJREtkrfcUJvBYTEoJCvO6Vj5ob8IgPSiIX0G3c4w2dKBJMoGEhlv9Gev + dom_dev: ZzFfcTbsRst34N23lWs6TtlfonXwDgpeALh+ObwYXav5BSo0j7KsaAtcdn+xrnS1 + dom_prod: MTxlP+/p3lyvc2+LZc2B5xy5reGwrA80whnflxNc6zPgLUmMvbwUoKy7qorBH+P4 + dom_server_dev: jHjmbawtj2AhVuJlmE/O1HXAIbQMzHvoXRZEVdhTSrfJXACRVpZm/BpuAi4K89xn + dom_server_prod: LCYUMPll/9t/UsNa/Q1zfti2awxxiiczBUZcQBdeGACH0sU6BEAllZuGxo5b6/kf diff --git a/downloads/react-15.3.2.zip b/downloads/react-15.3.2.zip new file mode 100644 index 00000000..bde0e327 Binary files /dev/null and b/downloads/react-15.3.2.zip differ diff --git a/js/react-dom.js b/js/react-dom.js index 0fb70451..9c8699b6 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 04c18504..3affcaa7 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'); - } + return measureLifeCyclePerf(function () { + return new Component(publicProps, publicContext, updateQueue); + }, this._debugID, 'ctor'); + } else { + return new Component(publicProps, publicContext, updateQueue); } + } + + // 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 { - // 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 Component(publicProps, publicContext, updateQueue); } - return instanceOrElement; }, 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; }