react-test-renderer 16.11.0 → 16.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-info.json +4 -4
- package/cjs/react-test-renderer-shallow.development.js +6 -6
- package/cjs/react-test-renderer-shallow.production.min.js +9 -9
- package/cjs/react-test-renderer.development.js +75 -52
- package/cjs/react-test-renderer.production.min.js +11 -11
- package/package.json +2 -2
- package/umd/react-test-renderer-shallow.development.js +8 -8
- package/umd/react-test-renderer-shallow.production.min.js +7 -7
- package/umd/react-test-renderer.development.js +75 -52
- package/umd/react-test-renderer.production.min.js +110 -110
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.12.0
|
|
2
2
|
* react-test-renderer-shallow.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
'use strict';(function(m,l){"object"===typeof exports&&"undefined"!==typeof module?module.exports=l(require("react")):"function"===typeof define&&define.amd?define(["react"],l):m.ReactShallowRenderer=l(m.React)})(this,function(m){function l(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,b=1;b<arguments.length;b++)c+="&args[]="+encodeURIComponent(arguments[b]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
|
|
10
|
-
function p(a){if("object"===typeof a&&null!==a){var c=a.$$typeof;switch(c){case K:switch(a=a.type,a){case L:case M:case z:case A:case B:case C:return a;default:switch(a=a&&a.$$typeof,a){case D:case q:case E:return a;default:return c}}case
|
|
11
|
-
case C:return"Suspense";case N:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case D:return"Context.Consumer";case
|
|
10
|
+
function p(a){if("object"===typeof a&&null!==a){var c=a.$$typeof;switch(c){case K:switch(a=a.type,a){case L:case M:case z:case A:case B:case C:return a;default:switch(a=a&&a.$$typeof,a){case D:case q:case E:case n:case F:return a;default:return c}}case G:return c}}}function u(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case z:return"Fragment";case G:return"Portal";case A:return"Profiler";case B:return"StrictMode";
|
|
11
|
+
case C:return"Suspense";case N:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case D:return"Context.Consumer";case F:return"Context.Provider";case q:var c=a.render;c=c.displayName||c.name||"";return a.displayName||(""!==c?"ForwardRef("+c+")":"ForwardRef");case n:return u(a.type);case E:if(a=1===a._status?a._result:null)return u(a)}return null}function O(a,c){return a===c&&(0!==a||1/a===1/c)||a!==a&&c!==c}function v(a,c){if(w(a,c))return!0;if("object"!==typeof a||null===a||"object"!==
|
|
12
12
|
typeof c||null===c)return!1;var b=Object.keys(a),d=Object.keys(c);if(b.length!==d.length)return!1;for(d=0;d<b.length;d++)if(!P.call(c,b[d])||!w(a[b[d]],c[b[d]]))return!1;return!0}function H(){return{memoizedState:null,queue:null,next:null}}function I(a,c){return"function"===typeof c?c(a):c}var x=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,e="function"===typeof Symbol&&Symbol.for,K=e?Symbol.for("react.element"):60103,G=e?Symbol.for("react.portal"):60106,z=e?Symbol.for("react.fragment"):
|
|
13
|
-
60107,B=e?Symbol.for("react.strict_mode"):60108,A=e?Symbol.for("react.profiler"):60114,
|
|
13
|
+
60107,B=e?Symbol.for("react.strict_mode"):60108,A=e?Symbol.for("react.profiler"):60114,F=e?Symbol.for("react.provider"):60109,D=e?Symbol.for("react.context"):60110,L=e?Symbol.for("react.async_mode"):60111,M=e?Symbol.for("react.concurrent_mode"):60111,q=e?Symbol.for("react.forward_ref"):60112,C=e?Symbol.for("react.suspense"):60113,N=e?Symbol.for("react.suspense_list"):60120,n=e?Symbol.for("react.memo"):60115,E=e?Symbol.for("react.lazy"):60116,Q=q;e=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
14
14
|
e.hasOwnProperty("ReactCurrentDispatcher")||(e.ReactCurrentDispatcher={current:null});e.hasOwnProperty("ReactCurrentBatchConfig")||(e.ReactCurrentBatchConfig={suspense:null});var w="function"===typeof Object.is?Object.is:O,P=Object.prototype.hasOwnProperty,y=e.ReactCurrentDispatcher,r={},R=function(){function a(b){this._renderer=b;this._callbacks=[]}var c=a.prototype;c._enqueueCallback=function(b,d){"function"===typeof b&&d&&this._callbacks.push({callback:b,publicInstance:d})};c._invokeCallbacks=
|
|
15
15
|
function(){var b=this._callbacks;this._callbacks=[];b.forEach(function(b){b.callback.call(b.publicInstance)})};c.isMounted=function(b){return!!this._renderer._element};c.enqueueForceUpdate=function(b,d,a){this._enqueueCallback(d,b);this._renderer._forcedUpdate=!0;this._renderer.render(this._renderer._element,this._renderer._context)};c.enqueueReplaceState=function(b,d,a,c){this._enqueueCallback(a,b);this._renderer._newState=d;this._renderer.render(this._renderer._element,this._renderer._context)};
|
|
16
16
|
c.enqueueSetState=function(b,d,a,c){this._enqueueCallback(a,b);a=this._renderer._newState||b.state;"function"===typeof d&&(d=d.call(b,a,b.props));null!==d&&void 0!==d&&(this._renderer._newState=x({},a,{},d),this._renderer.render(this._renderer._element,this._renderer._context))};return a}(),t=function(){function a(){this._reset()}var c=a.prototype;c._reset=function(){this._rendered=this._newState=this._instance=this._element=this._context=null;this._forcedUpdate=this._rendering=!1;this._updater=new R(this);
|
|
@@ -21,9 +21,9 @@ b._workInProgressHook&&null!==b._workInProgressHook.memoizedState){var c=b._work
|
|
|
21
21
|
a):d},useState:function(b){return a(I,b)},useResponder:function(b,a){return{props:a,responder:b}},useTransition:function(a){b._validateCurrentlyRenderingComponent();return[function(b){b()},!1]},useDeferredValue:function(a,d){b._validateCurrentlyRenderingComponent();return a}}};c._dispatchAction=function(b,a){if(!(25>this._numberOfReRenders))throw Error(l(301));if(this._rendering){this._didScheduleRenderPhaseUpdate=!0;a={action:a,next:null};var d=this._renderPhaseUpdates;null===d&&(this._renderPhaseUpdates=
|
|
22
22
|
d=new Map);var c=d.get(b);if(void 0===c)d.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}}else{a={action:a,next:null};d=b.first;if(null===d)b.first=a;else{for(;null!==d.next;)d=d.next;d.next=a}this.render(this._element,this._context)}};c._createWorkInProgressHook=function(){null===this._workInProgressHook?null===this._firstWorkInProgressHook?(this._isReRender=!1,this._firstWorkInProgressHook=this._workInProgressHook=H()):(this._isReRender=!0,this._workInProgressHook=this._firstWorkInProgressHook):
|
|
23
23
|
null===this._workInProgressHook.next?(this._isReRender=!1,this._workInProgressHook=this._workInProgressHook.next=H()):(this._isReRender=!0,this._workInProgressHook=this._workInProgressHook.next);return this._workInProgressHook};c._finishHooks=function(b,a){this._didScheduleRenderPhaseUpdate?(this._didScheduleRenderPhaseUpdate=!1,this._numberOfReRenders+=1,this._workInProgressHook=null,this._rendering=!1,this.render(b,a)):(this._renderPhaseUpdates=this._workInProgressHook=null,this._numberOfReRenders=
|
|
24
|
-
0)};c.getMountedInstance=function(){return this._instance};c.getRenderOutput=function(){return this._rendered};c.render=function(b){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:r;if(!m.isValidElement(b))throw Error(l(12,"function"===typeof b?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":""));if("string"===typeof b.type)throw Error(l(13,b.type));if(p(b)!==q&&"function"!==typeof b.type&&p(b
|
|
25
|
-
"array":null===b.type?"null":typeof b.type));if(!this._rendering){null!=this._element&&this._element.type!==b.type&&this._reset();var c=p(b
|
|
26
|
-
|
|
24
|
+
0)};c.getMountedInstance=function(){return this._instance};c.getRenderOutput=function(){return this._rendered};c.render=function(b){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:r;if(!m.isValidElement(b))throw Error(l(12,"function"===typeof b?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":""));if("string"===typeof b.type)throw Error(l(13,b.type));if(p(b)!==q&&"function"!==typeof b.type&&p(b)!==n)throw Error(l(249,Array.isArray(b.type)?
|
|
25
|
+
"array":null===b.type?"null":typeof b.type));if(!this._rendering){null!=this._element&&this._element.type!==b.type&&this._reset();var c=p(b)===n?b.type.type:b.type,e=this._element;this._rendering=!0;this._element=b;var h;if((h=c.contextTypes)&&a){var J={},k;for(k in h)J[k]=a[k];h=J}else h=r;this._context=h;p(b)===n&&c.propTypes&&u(c);if(this._instance)this._updateClassComponent(c,b,this._context);else if(c.prototype&&c.prototype.isReactComponent)this._instance=new c(b.props,this._context,this._updater),
|
|
26
|
+
"function"===typeof c.getDerivedStateFromProps&&(a=c.getDerivedStateFromProps.call(null,b.props,this._instance.state),null!=a&&(this._instance.state=x({},this._instance.state,a))),this._mountClassComponent(c,b,this._context);else if(h=!0,p(b)===n&&null!==e&&(b.type.compare||v)(e.props,b.props)&&(h=!1),h){e=y.current;y.current=this._dispatcher;try{if(c.$$typeof===Q){if("function"!==typeof c.render)throw Error(l(322,typeof c.render));this._rendered=c.render.call(void 0,b.props,b.ref)}else this._rendered=
|
|
27
27
|
c(b.props,this._context)}finally{y.current=e}this._finishHooks(b,a)}this._rendering=!1;this._updater._invokeCallbacks();return this.getRenderOutput()}};c.unmount=function(){this._instance&&"function"===typeof this._instance.componentWillUnmount&&this._instance.componentWillUnmount();this._reset()};c._mountClassComponent=function(b,a,c){this._instance.context=c;this._instance.props=a.props;this._instance.state=this._instance.state||null;this._instance.updater=this._updater;if("function"===typeof this._instance.UNSAFE_componentWillMount||
|
|
28
28
|
"function"===typeof this._instance.componentWillMount)a=this._newState,"function"!==typeof b.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillMount&&this._instance.componentWillMount(),"function"===typeof this._instance.UNSAFE_componentWillMount&&this._instance.UNSAFE_componentWillMount()),a!==this._newState&&(this._instance.state=this._newState||r);this._rendered=this._instance.render()};c._updateClassComponent=
|
|
29
29
|
function(a,c,e){c=c.props;var b=this._instance.state||r,d=this._instance.props;d!==c&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillReceiveProps&&this._instance.componentWillReceiveProps(c,e),"function"===typeof this._instance.UNSAFE_componentWillReceiveProps&&this._instance.UNSAFE_componentWillReceiveProps(c,e));var f=this._newState||b;if("function"===typeof a.getDerivedStateFromProps){var k=
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.12.0
|
|
2
2
|
* react-test-renderer.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -418,7 +418,6 @@ var ShouldCapture =
|
|
|
418
418
|
/* */
|
|
419
419
|
4096;
|
|
420
420
|
|
|
421
|
-
var debugRenderPhaseSideEffects = false;
|
|
422
421
|
var debugRenderPhaseSideEffectsForStrictMode = false;
|
|
423
422
|
var enableUserTimingAPI = true;
|
|
424
423
|
var warnAboutDeprecatedLifecycles = true;
|
|
@@ -443,6 +442,7 @@ var warnAboutDefaultPropsOnFunctionComponents = false;
|
|
|
443
442
|
var warnAboutStringRefs = false;
|
|
444
443
|
var disableLegacyContext = false;
|
|
445
444
|
var disableSchedulerTimeoutBasedOnReactExpirationTime = false;
|
|
445
|
+
|
|
446
446
|
// Only used in www builds.
|
|
447
447
|
|
|
448
448
|
// Flow magic to verify the exports of this file match the original version.
|
|
@@ -2009,7 +2009,7 @@ function findCurrentUnmaskedContext(fiber) {
|
|
|
2009
2009
|
}
|
|
2010
2010
|
|
|
2011
2011
|
var LegacyRoot = 0;
|
|
2012
|
-
var
|
|
2012
|
+
var BlockingRoot = 1;
|
|
2013
2013
|
var ConcurrentRoot = 2;
|
|
2014
2014
|
|
|
2015
2015
|
var ReactInternals$1 = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
@@ -2205,10 +2205,10 @@ function flushSyncCallbackQueueImpl() {
|
|
|
2205
2205
|
}
|
|
2206
2206
|
|
|
2207
2207
|
var NoMode = 0;
|
|
2208
|
-
var StrictMode = 1; // TODO: Remove
|
|
2208
|
+
var StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root
|
|
2209
2209
|
// tag instead
|
|
2210
2210
|
|
|
2211
|
-
var
|
|
2211
|
+
var BlockingMode = 2;
|
|
2212
2212
|
var ConcurrentMode = 4;
|
|
2213
2213
|
var ProfileMode = 8;
|
|
2214
2214
|
|
|
@@ -3625,7 +3625,7 @@ function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps,
|
|
|
3625
3625
|
{
|
|
3626
3626
|
enterDisallowedContextReadInDEV();
|
|
3627
3627
|
|
|
3628
|
-
if (
|
|
3628
|
+
if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
|
|
3629
3629
|
payload.call(instance, prevState, nextProps);
|
|
3630
3630
|
}
|
|
3631
3631
|
}
|
|
@@ -3659,7 +3659,7 @@ function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps,
|
|
|
3659
3659
|
{
|
|
3660
3660
|
enterDisallowedContextReadInDEV();
|
|
3661
3661
|
|
|
3662
|
-
if (
|
|
3662
|
+
if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
|
|
3663
3663
|
_payload.call(instance, prevState, nextProps);
|
|
3664
3664
|
}
|
|
3665
3665
|
}
|
|
@@ -3972,7 +3972,7 @@ function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromPro
|
|
|
3972
3972
|
var prevState = workInProgress.memoizedState;
|
|
3973
3973
|
|
|
3974
3974
|
{
|
|
3975
|
-
if (
|
|
3975
|
+
if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
|
|
3976
3976
|
// Invoke the function an extra time to help detect side-effects.
|
|
3977
3977
|
getDerivedStateFromProps(nextProps, prevState);
|
|
3978
3978
|
}
|
|
@@ -4219,7 +4219,7 @@ function constructClassInstance(workInProgress, ctor, props, renderExpirationTim
|
|
|
4219
4219
|
|
|
4220
4220
|
|
|
4221
4221
|
{
|
|
4222
|
-
if (
|
|
4222
|
+
if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
|
|
4223
4223
|
new ctor(props, context); // eslint-disable-line no-new
|
|
4224
4224
|
}
|
|
4225
4225
|
}
|
|
@@ -8162,7 +8162,7 @@ function updateForwardRef(current$$1, workInProgress, Component, nextProps, rend
|
|
|
8162
8162
|
setCurrentPhase('render');
|
|
8163
8163
|
nextChildren = renderWithHooks(current$$1, workInProgress, render, nextProps, ref, renderExpirationTime);
|
|
8164
8164
|
|
|
8165
|
-
if (
|
|
8165
|
+
if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
|
|
8166
8166
|
// Only double-render components with Hooks
|
|
8167
8167
|
if (workInProgress.memoizedState !== null) {
|
|
8168
8168
|
nextChildren = renderWithHooks(current$$1, workInProgress, render, nextProps, ref, renderExpirationTime);
|
|
@@ -8366,7 +8366,7 @@ function updateFunctionComponent(current$$1, workInProgress, Component, nextProp
|
|
|
8366
8366
|
setCurrentPhase('render');
|
|
8367
8367
|
nextChildren = renderWithHooks(current$$1, workInProgress, Component, nextProps, context, renderExpirationTime);
|
|
8368
8368
|
|
|
8369
|
-
if (
|
|
8369
|
+
if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
|
|
8370
8370
|
// Only double-render components with Hooks
|
|
8371
8371
|
if (workInProgress.memoizedState !== null) {
|
|
8372
8372
|
nextChildren = renderWithHooks(current$$1, workInProgress, Component, nextProps, context, renderExpirationTime);
|
|
@@ -8489,7 +8489,7 @@ function finishClassComponent(current$$1, workInProgress, Component, shouldUpdat
|
|
|
8489
8489
|
setCurrentPhase('render');
|
|
8490
8490
|
nextChildren = instance.render();
|
|
8491
8491
|
|
|
8492
|
-
if (
|
|
8492
|
+
if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
|
|
8493
8493
|
instance.render();
|
|
8494
8494
|
}
|
|
8495
8495
|
|
|
@@ -8862,7 +8862,7 @@ function mountIndeterminateComponent(_current, workInProgress, Component, render
|
|
|
8862
8862
|
warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with React.useContext() instead.', getComponentName(Component) || 'Unknown');
|
|
8863
8863
|
}
|
|
8864
8864
|
|
|
8865
|
-
if (
|
|
8865
|
+
if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
|
|
8866
8866
|
// Only double-render components with Hooks
|
|
8867
8867
|
if (workInProgress.memoizedState !== null) {
|
|
8868
8868
|
value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
|
|
@@ -9038,8 +9038,8 @@ function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTim
|
|
|
9038
9038
|
var primaryChildFragment = createFiberFromFragment(null, mode, NoWork, null);
|
|
9039
9039
|
primaryChildFragment.return = workInProgress;
|
|
9040
9040
|
|
|
9041
|
-
if ((workInProgress.mode &
|
|
9042
|
-
// Outside of
|
|
9041
|
+
if ((workInProgress.mode & BlockingMode) === NoMode) {
|
|
9042
|
+
// Outside of blocking mode, we commit the effects from the
|
|
9043
9043
|
// partially completed, timed-out tree, too.
|
|
9044
9044
|
var progressedState = workInProgress.memoizedState;
|
|
9045
9045
|
var progressedPrimaryChild = progressedState !== null ? workInProgress.child.child : workInProgress.child;
|
|
@@ -9102,8 +9102,8 @@ function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTim
|
|
|
9102
9102
|
|
|
9103
9103
|
_primaryChildFragment.child = null;
|
|
9104
9104
|
|
|
9105
|
-
if ((workInProgress.mode &
|
|
9106
|
-
// Outside of
|
|
9105
|
+
if ((workInProgress.mode & BlockingMode) === NoMode) {
|
|
9106
|
+
// Outside of blocking mode, we commit the effects from the
|
|
9107
9107
|
// partially completed, timed-out tree, too.
|
|
9108
9108
|
var _progressedChild = _primaryChildFragment.child = workInProgress.child;
|
|
9109
9109
|
|
|
@@ -9162,8 +9162,8 @@ function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTim
|
|
|
9162
9162
|
|
|
9163
9163
|
_primaryChildFragment2.return = workInProgress;
|
|
9164
9164
|
|
|
9165
|
-
if ((workInProgress.mode &
|
|
9166
|
-
// Outside of
|
|
9165
|
+
if ((workInProgress.mode & BlockingMode) === NoMode) {
|
|
9166
|
+
// Outside of blocking mode, we commit the effects from the
|
|
9167
9167
|
// partially completed, timed-out tree, too.
|
|
9168
9168
|
var _progressedState = workInProgress.memoizedState;
|
|
9169
9169
|
|
|
@@ -9247,8 +9247,8 @@ function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTim
|
|
|
9247
9247
|
// primaryChildFragment.effectTag |= Placement;
|
|
9248
9248
|
|
|
9249
9249
|
|
|
9250
|
-
if ((workInProgress.mode &
|
|
9251
|
-
// Outside of
|
|
9250
|
+
if ((workInProgress.mode & BlockingMode) === NoMode) {
|
|
9251
|
+
// Outside of blocking mode, we commit the effects from the
|
|
9252
9252
|
// partially completed, timed-out tree, too.
|
|
9253
9253
|
var _progressedState2 = workInProgress.memoizedState;
|
|
9254
9254
|
|
|
@@ -9317,9 +9317,9 @@ function retrySuspenseComponentWithoutHydrating(current$$1, workInProgress, rend
|
|
|
9317
9317
|
function mountDehydratedSuspenseComponent(workInProgress, suspenseInstance, renderExpirationTime) {
|
|
9318
9318
|
// During the first pass, we'll bail out and not drill into the children.
|
|
9319
9319
|
// Instead, we'll leave the content in place and try to hydrate it later.
|
|
9320
|
-
if ((workInProgress.mode &
|
|
9320
|
+
if ((workInProgress.mode & BlockingMode) === NoMode) {
|
|
9321
9321
|
{
|
|
9322
|
-
warning$1(false, 'Cannot hydrate Suspense in legacy mode. Switch from ' + 'ReactDOM.hydrate(element, container) to ' + 'ReactDOM.
|
|
9322
|
+
warning$1(false, 'Cannot hydrate Suspense in legacy mode. Switch from ' + 'ReactDOM.hydrate(element, container) to ' + 'ReactDOM.createBlockingRoot(container, { hydrate: true })' + '.render(element) or remove the Suspense components from ' + 'the server rendered components.');
|
|
9323
9323
|
}
|
|
9324
9324
|
|
|
9325
9325
|
workInProgress.expirationTime = Sync;
|
|
@@ -9361,7 +9361,7 @@ function updateDehydratedSuspenseComponent(current$$1, workInProgress, suspenseI
|
|
|
9361
9361
|
// but after we've already committed once.
|
|
9362
9362
|
warnIfHydrating();
|
|
9363
9363
|
|
|
9364
|
-
if ((workInProgress.mode &
|
|
9364
|
+
if ((workInProgress.mode & BlockingMode) === NoMode) {
|
|
9365
9365
|
return retrySuspenseComponentWithoutHydrating(current$$1, workInProgress, renderExpirationTime);
|
|
9366
9366
|
}
|
|
9367
9367
|
|
|
@@ -9683,8 +9683,8 @@ function updateSuspenseListComponent(current$$1, workInProgress, renderExpiratio
|
|
|
9683
9683
|
|
|
9684
9684
|
pushSuspenseContext(workInProgress, suspenseContext);
|
|
9685
9685
|
|
|
9686
|
-
if ((workInProgress.mode &
|
|
9687
|
-
// Outside of
|
|
9686
|
+
if ((workInProgress.mode & BlockingMode) === NoMode) {
|
|
9687
|
+
// Outside of blocking mode, SuspenseList doesn't work so we just
|
|
9688
9688
|
// use make it a noop by treating it as the default revealOrder.
|
|
9689
9689
|
workInProgress.memoizedState = null;
|
|
9690
9690
|
} else {
|
|
@@ -10056,7 +10056,12 @@ function beginWork$1(current$$1, workInProgress, renderExpirationTime) {
|
|
|
10056
10056
|
|
|
10057
10057
|
case Profiler:
|
|
10058
10058
|
if (enableProfilerTimer) {
|
|
10059
|
-
|
|
10059
|
+
// Profiler should only call onRender when one of its descendants actually rendered.
|
|
10060
|
+
var hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;
|
|
10061
|
+
|
|
10062
|
+
if (hasChildWork) {
|
|
10063
|
+
workInProgress.effectTag |= Update;
|
|
10064
|
+
}
|
|
10060
10065
|
}
|
|
10061
10066
|
|
|
10062
10067
|
break;
|
|
@@ -10112,10 +10117,11 @@ function beginWork$1(current$$1, workInProgress, renderExpirationTime) {
|
|
|
10112
10117
|
case SuspenseListComponent:
|
|
10113
10118
|
{
|
|
10114
10119
|
var didSuspendBefore = (current$$1.effectTag & DidCapture) !== NoEffect;
|
|
10115
|
-
|
|
10120
|
+
|
|
10121
|
+
var _hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;
|
|
10116
10122
|
|
|
10117
10123
|
if (didSuspendBefore) {
|
|
10118
|
-
if (
|
|
10124
|
+
if (_hasChildWork) {
|
|
10119
10125
|
// If something was in fallback state last time, and we have all the
|
|
10120
10126
|
// same children then we're still in progressive loading state.
|
|
10121
10127
|
// Something might get unblocked by state updates or retries in the
|
|
@@ -10144,7 +10150,7 @@ function beginWork$1(current$$1, workInProgress, renderExpirationTime) {
|
|
|
10144
10150
|
|
|
10145
10151
|
pushSuspenseContext(workInProgress, suspenseStackCursor.current);
|
|
10146
10152
|
|
|
10147
|
-
if (
|
|
10153
|
+
if (_hasChildWork) {
|
|
10148
10154
|
break;
|
|
10149
10155
|
} else {
|
|
10150
10156
|
// If none of the children had any work, that means that none of
|
|
@@ -10327,14 +10333,19 @@ function getSuspenseFallbackChild(fiber) {
|
|
|
10327
10333
|
return fiber.child.sibling.child;
|
|
10328
10334
|
}
|
|
10329
10335
|
|
|
10336
|
+
var emptyObject$1 = {};
|
|
10337
|
+
|
|
10330
10338
|
function collectScopedNodes(node, fn, scopedNodes) {
|
|
10331
10339
|
if (enableScopeAPI) {
|
|
10332
10340
|
if (node.tag === HostComponent) {
|
|
10333
10341
|
var _type = node.type,
|
|
10334
|
-
memoizedProps = node.memoizedProps
|
|
10342
|
+
memoizedProps = node.memoizedProps,
|
|
10343
|
+
stateNode = node.stateNode;
|
|
10344
|
+
|
|
10345
|
+
var _instance = getPublicInstance(stateNode);
|
|
10335
10346
|
|
|
10336
|
-
if (fn(_type, memoizedProps) === true) {
|
|
10337
|
-
scopedNodes.push(
|
|
10347
|
+
if (_instance !== null && fn(_type, memoizedProps || emptyObject$1, _instance) === true) {
|
|
10348
|
+
scopedNodes.push(_instance);
|
|
10338
10349
|
}
|
|
10339
10350
|
}
|
|
10340
10351
|
|
|
@@ -10354,10 +10365,13 @@ function collectFirstScopedNode(node, fn) {
|
|
|
10354
10365
|
if (enableScopeAPI) {
|
|
10355
10366
|
if (node.tag === HostComponent) {
|
|
10356
10367
|
var _type2 = node.type,
|
|
10357
|
-
memoizedProps = node.memoizedProps
|
|
10368
|
+
memoizedProps = node.memoizedProps,
|
|
10369
|
+
stateNode = node.stateNode;
|
|
10358
10370
|
|
|
10359
|
-
|
|
10360
|
-
|
|
10371
|
+
var _instance2 = getPublicInstance(stateNode);
|
|
10372
|
+
|
|
10373
|
+
if (_instance2 !== null && fn(_type2, memoizedProps, _instance2) === true) {
|
|
10374
|
+
return _instance2;
|
|
10361
10375
|
}
|
|
10362
10376
|
}
|
|
10363
10377
|
|
|
@@ -11241,12 +11255,12 @@ function completeWork(current, workInProgress, renderExpirationTime) {
|
|
|
11241
11255
|
}
|
|
11242
11256
|
|
|
11243
11257
|
if (nextDidTimeout && !prevDidTimeout) {
|
|
11244
|
-
// If this subtreee is running in
|
|
11258
|
+
// If this subtreee is running in blocking mode we can suspend,
|
|
11245
11259
|
// otherwise we won't suspend.
|
|
11246
11260
|
// TODO: This will still suspend a synchronous tree if anything
|
|
11247
11261
|
// in the concurrent tree already suspended during this render.
|
|
11248
11262
|
// This is a known bug.
|
|
11249
|
-
if ((workInProgress.mode &
|
|
11263
|
+
if ((workInProgress.mode & BlockingMode) !== NoMode) {
|
|
11250
11264
|
// TODO: Move this back to throwException because this is too late
|
|
11251
11265
|
// if this is a large tree which is common for initial loads. We
|
|
11252
11266
|
// don't know if we should restart a render or not until we get
|
|
@@ -11435,9 +11449,9 @@ function completeWork(current, workInProgress, renderExpirationTime) {
|
|
|
11435
11449
|
|
|
11436
11450
|
cutOffTailIfNeeded(renderState, true); // This might have been modified.
|
|
11437
11451
|
|
|
11438
|
-
if (renderState.tail === null && renderState.tailMode === 'hidden') {
|
|
11452
|
+
if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate) {
|
|
11439
11453
|
// We need to delete the row we just rendered.
|
|
11440
|
-
// Reset the effect list to what it
|
|
11454
|
+
// Reset the effect list to what it was before we rendered this
|
|
11441
11455
|
// child. The nested children have already appended themselves.
|
|
11442
11456
|
var lastEffect = workInProgress.lastEffect = renderState.lastEffect; // Remove any effects that were appended after this point.
|
|
11443
11457
|
|
|
@@ -13570,17 +13584,17 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT
|
|
|
13570
13584
|
_workInProgress.updateQueue = updateQueue;
|
|
13571
13585
|
} else {
|
|
13572
13586
|
thenables.add(thenable);
|
|
13573
|
-
} // If the boundary is outside of
|
|
13587
|
+
} // If the boundary is outside of blocking mode, we should *not*
|
|
13574
13588
|
// suspend the commit. Pretend as if the suspended component rendered
|
|
13575
13589
|
// null and keep rendering. In the commit phase, we'll schedule a
|
|
13576
13590
|
// subsequent synchronous update to re-render the Suspense.
|
|
13577
13591
|
//
|
|
13578
13592
|
// Note: It doesn't matter whether the component that suspended was
|
|
13579
|
-
// inside a
|
|
13593
|
+
// inside a blocking mode tree. If the Suspense is outside of it, we
|
|
13580
13594
|
// should *not* suspend the commit.
|
|
13581
13595
|
|
|
13582
13596
|
|
|
13583
|
-
if ((_workInProgress.mode &
|
|
13597
|
+
if ((_workInProgress.mode & BlockingMode) === NoMode) {
|
|
13584
13598
|
_workInProgress.effectTag |= DidCapture; // We're going to commit this fiber even though it didn't complete.
|
|
13585
13599
|
// But we shouldn't call any lifecycle methods or callbacks. Remove
|
|
13586
13600
|
// all lifecycle effect tags.
|
|
@@ -13824,7 +13838,7 @@ function getCurrentTime() {
|
|
|
13824
13838
|
function computeExpirationForFiber(currentTime, fiber, suspenseConfig) {
|
|
13825
13839
|
var mode = fiber.mode;
|
|
13826
13840
|
|
|
13827
|
-
if ((mode &
|
|
13841
|
+
if ((mode & BlockingMode) === NoMode) {
|
|
13828
13842
|
return Sync;
|
|
13829
13843
|
}
|
|
13830
13844
|
|
|
@@ -13925,7 +13939,7 @@ function scheduleUpdateOnFiber(fiber, expirationTime) {
|
|
|
13925
13939
|
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of
|
|
13926
13940
|
// scheduleCallbackForFiber to preserve the ability to schedule a callback
|
|
13927
13941
|
// without immediately flushing it. We only do this for user-initiated
|
|
13928
|
-
// updates, to preserve historical behavior of
|
|
13942
|
+
// updates, to preserve historical behavior of legacy mode.
|
|
13929
13943
|
flushSyncCallbackQueue();
|
|
13930
13944
|
}
|
|
13931
13945
|
}
|
|
@@ -15044,7 +15058,16 @@ function commitRoot(root) {
|
|
|
15044
15058
|
}
|
|
15045
15059
|
|
|
15046
15060
|
function commitRootImpl(root, renderPriorityLevel) {
|
|
15047
|
-
|
|
15061
|
+
do {
|
|
15062
|
+
// `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which
|
|
15063
|
+
// means `flushPassiveEffects` will sometimes result in additional
|
|
15064
|
+
// passive effects. So we need to keep flushing in a loop until there are
|
|
15065
|
+
// no more pending effects.
|
|
15066
|
+
// TODO: Might be better if `flushPassiveEffects` did not automatically
|
|
15067
|
+
// flush synchronous work at the end, to avoid factoring hazards like this.
|
|
15068
|
+
flushPassiveEffects();
|
|
15069
|
+
} while (rootWithPendingPassiveEffects !== null);
|
|
15070
|
+
|
|
15048
15071
|
flushRenderPhaseStrictModeWarningsInDEV();
|
|
15049
15072
|
|
|
15050
15073
|
if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
|
|
@@ -15971,7 +15994,7 @@ var didWarnAboutUnmockedScheduler = false; // TODO Before we release concurrent
|
|
|
15971
15994
|
function warnIfUnmockedScheduler(fiber) {
|
|
15972
15995
|
{
|
|
15973
15996
|
if (didWarnAboutUnmockedScheduler === false && Scheduler$1.unstable_flushAllWithoutAsserting === undefined) {
|
|
15974
|
-
if (fiber.mode &
|
|
15997
|
+
if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {
|
|
15975
15998
|
didWarnAboutUnmockedScheduler = true;
|
|
15976
15999
|
warningWithoutStack$1(false, 'In Concurrent or Sync modes, the "scheduler" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \n' + "jest.mock('scheduler', () => require('scheduler/unstable_mock'));\n\n" + 'For more info, visit https://fb.me/react-mock-scheduler');
|
|
15977
16000
|
} else if (warnAboutUnmockedScheduler === true) {
|
|
@@ -16614,9 +16637,9 @@ function createHostRootFiber(tag) {
|
|
|
16614
16637
|
var mode;
|
|
16615
16638
|
|
|
16616
16639
|
if (tag === ConcurrentRoot) {
|
|
16617
|
-
mode = ConcurrentMode |
|
|
16618
|
-
} else if (tag ===
|
|
16619
|
-
mode =
|
|
16640
|
+
mode = ConcurrentMode | BlockingMode | StrictMode;
|
|
16641
|
+
} else if (tag === BlockingRoot) {
|
|
16642
|
+
mode = BlockingMode | StrictMode;
|
|
16620
16643
|
} else {
|
|
16621
16644
|
mode = NoMode;
|
|
16622
16645
|
}
|
|
@@ -16658,7 +16681,7 @@ key, pendingProps, owner, mode, expirationTime) {
|
|
|
16658
16681
|
|
|
16659
16682
|
case REACT_CONCURRENT_MODE_TYPE:
|
|
16660
16683
|
fiberTag = Mode;
|
|
16661
|
-
mode |= ConcurrentMode |
|
|
16684
|
+
mode |= ConcurrentMode | BlockingMode | StrictMode;
|
|
16662
16685
|
break;
|
|
16663
16686
|
|
|
16664
16687
|
case REACT_STRICT_MODE_TYPE:
|
|
@@ -17277,7 +17300,7 @@ function injectIntoDevTools(devToolsConfig) {
|
|
|
17277
17300
|
|
|
17278
17301
|
// TODO: this is special because it gets imported during build.
|
|
17279
17302
|
|
|
17280
|
-
var ReactVersion = '16.
|
|
17303
|
+
var ReactVersion = '16.12.0';
|
|
17281
17304
|
|
|
17282
17305
|
var didWarnAboutMessageChannel = false;
|
|
17283
17306
|
var enqueueTask;
|