react-test-renderer 16.8.0 → 16.8.4
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 +5 -5
- package/cjs/react-test-renderer-shallow.development.js +10 -1
- package/cjs/react-test-renderer-shallow.production.min.js +19 -19
- package/cjs/react-test-renderer.development.js +602 -181
- package/cjs/react-test-renderer.production.min.js +144 -144
- package/package.json +3 -3
- package/umd/react-test-renderer-shallow.development.js +10 -1
- package/umd/react-test-renderer-shallow.production.min.js +23 -23
- package/umd/react-test-renderer.development.js +620 -181
- package/umd/react-test-renderer.production.min.js +129 -128
package/build-info.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"branch": "
|
|
3
|
-
"buildNumber": "
|
|
4
|
-
"checksum": "
|
|
5
|
-
"commit": "
|
|
2
|
+
"branch": "16.8.4",
|
|
3
|
+
"buildNumber": "13714",
|
|
4
|
+
"checksum": "94d3bf9",
|
|
5
|
+
"commit": "741aa17a3",
|
|
6
6
|
"environment": "ci",
|
|
7
|
-
"reactVersion": "16.
|
|
7
|
+
"reactVersion": "16.8.3-canary-741aa17a3"
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.8.
|
|
1
|
+
/** @license React v16.8.4
|
|
2
2
|
* react-test-renderer-shallow.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -270,6 +270,15 @@ function shallowEqual(objA, objB) {
|
|
|
270
270
|
|
|
271
271
|
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
272
272
|
|
|
273
|
+
// Prevent newer renderers from RTE when used with older react package versions.
|
|
274
|
+
// Current owner and dispatcher used to share the same ref,
|
|
275
|
+
// but PR #14548 split them out to better support the react-debug-tools package.
|
|
276
|
+
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
|
|
277
|
+
ReactSharedInternals.ReactCurrentDispatcher = {
|
|
278
|
+
current: null
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
|
|
273
282
|
/**
|
|
274
283
|
* Similar to invariant but only logs a warning if the condition is not met.
|
|
275
284
|
* This can be used to log issues in development environments in critical
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.8.
|
|
1
|
+
/** @license React v16.8.4
|
|
2
2
|
* react-test-renderer-shallow.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -7,28 +7,28 @@
|
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
'use strict';var g=require("object-assign"),h=require("react"),m=require("react-is"),p=require("prop-types/checkPropTypes");function q(a,b,d,c,e,l,n,k){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[d,c,e,l,n,k],
|
|
10
|
+
'use strict';var g=require("object-assign"),h=require("react"),m=require("react-is"),p=require("prop-types/checkPropTypes");function q(a,b,d,c,e,l,n,k){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[d,c,e,l,n,k],H=0;a=Error(b.replace(/%s/g,function(){return f[H++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}
|
|
11
11
|
function r(a){for(var b=arguments.length-1,d="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;c<b;c++)d+="&args[]="+encodeURIComponent(arguments[c+1]);q(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",d)}
|
|
12
12
|
var t=/^(.*)[\\\/]/,u="function"===typeof Symbol&&Symbol.for,v=u?Symbol.for("react.portal"):60106,w=u?Symbol.for("react.fragment"):60107,x=u?Symbol.for("react.strict_mode"):60108,y=u?Symbol.for("react.profiler"):60114,z=u?Symbol.for("react.provider"):60109,A=u?Symbol.for("react.context"):60110,B=u?Symbol.for("react.concurrent_mode"):60111,C=u?Symbol.for("react.forward_ref"):60112,D=u?Symbol.for("react.suspense"):60113,E=u?Symbol.for("react.memo"):60115,F=u?Symbol.for("react.lazy"):60116;
|
|
13
|
-
function
|
|
14
|
-
case E:return
|
|
15
|
-
function
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var
|
|
13
|
+
function G(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 B:return"ConcurrentMode";case w:return"Fragment";case v:return"Portal";case y:return"Profiler";case x:return"StrictMode";case D:return"Suspense"}if("object"===typeof a)switch(a.$$typeof){case A:return"Context.Consumer";case z:return"Context.Provider";case C:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef");
|
|
14
|
+
case E:return G(a.type);case F:if(a=1===a._status?a._result:null)return G(a)}return null}function I(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var J=Object.prototype.hasOwnProperty;function K(a,b){if(I(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var d=Object.keys(a),c=Object.keys(b);if(d.length!==c.length)return!1;for(c=0;c<d.length;c++)if(!J.call(b,d[c])||!I(a[d[c]],b[d[c]]))return!1;return!0}var L=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
15
|
+
L.hasOwnProperty("ReactCurrentDispatcher")||(L.ReactCurrentDispatcher={current:null});function M(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}
|
|
16
|
+
var N=L.ReactCurrentDispatcher,O={},P=function(){function a(b){M(this,a);this._renderer=b;this._callbacks=[]}a.prototype._enqueueCallback=function(b,a){"function"===typeof b&&a&&this._callbacks.push({callback:b,publicInstance:a})};a.prototype._invokeCallbacks=function(){var b=this._callbacks;this._callbacks=[];b.forEach(function(b){b.callback.call(b.publicInstance)})};a.prototype.isMounted=function(){return!!this._renderer._element};a.prototype.enqueueForceUpdate=function(b,a){this._enqueueCallback(a,
|
|
17
|
+
b);this._renderer._forcedUpdate=!0;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueReplaceState=function(b,a,c){this._enqueueCallback(c,b);this._renderer._newState=a;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueSetState=function(b,a,c){this._enqueueCallback(c,b);c=this._renderer._newState||b.state;"function"===typeof a&&(a=a.call(b,c,b.props));null!==a&&void 0!==a&&(this._renderer._newState=g({},c,a),this._renderer.render(this._renderer._element,
|
|
18
|
+
this._renderer._context))};return a}();function Q(){return{memoizedState:null,queue:null,next:null}}function R(a,b){return"function"===typeof b?b(a):b}
|
|
19
|
+
var U=function(){function a(){M(this,a);this._rendered=this._newState=this._instance=this._element=this._context=null;this._forcedUpdate=this._rendering=!1;this._updater=new P(this);this._dispatcher=this._createDispatcher();this._firstWorkInProgressHook=this._workInProgressHook=null;this._didScheduleRenderPhaseUpdate=this._isReRender=!1;this._currentlyRenderingComponent=this._renderPhaseUpdates=null;this._numberOfReRenders=0;this._previousComponentIdentity=null}a.prototype._validateCurrentlyRenderingComponent=
|
|
20
20
|
function(){null===this._currentlyRenderingComponent?r("307"):void 0};a.prototype._createDispatcher=function(){function b(){c._validateCurrentlyRenderingComponent()}function a(b,a,d){c._validateCurrentlyRenderingComponent();c._createWorkInProgressHook();var e=c._workInProgressHook;if(c._isReRender){var f=e.queue;a=f.dispatch;if(null!==c._renderPhaseUpdates&&(d=c._renderPhaseUpdates.get(f),void 0!==d)){c._renderPhaseUpdates.delete(f);f=e.memoizedState;do f=b(f,d.action),d=d.next;while(null!==d);e.memoizedState=
|
|
21
|
-
f;return[f,a]}return[e.memoizedState,a]}b=b===
|
|
21
|
+
f;return[f,a]}return[e.memoizedState,a]}b=b===R?"function"===typeof a?a():a:void 0!==d?d(a):a;e.memoizedState=b;b=e.queue={last:null,dispatch:null};b=b.dispatch=c._dispatchAction.bind(c,c._currentlyRenderingComponent,b);return[e.memoizedState,b]}var c=this;return{readContext:function(b){return b._currentValue},useCallback:function(b){return b},useContext:function(b){c._validateCurrentlyRenderingComponent();return b._currentValue},useDebugValue:b,useEffect:b,useImperativeHandle:b,useLayoutEffect:b,
|
|
22
22
|
useMemo:function(b,a){c._validateCurrentlyRenderingComponent();c._createWorkInProgressHook();a=void 0!==a?a:null;if(null!==c._workInProgressHook&&null!==c._workInProgressHook.memoizedState){var d=c._workInProgressHook.memoizedState,e=d[1];if(null!==a){a:if(null===e)e=!1;else{for(var f=0;f<e.length&&f<a.length;f++)if(!I(a[f],e[f])){e=!1;break a}e=!0}if(e)return d[0]}}b=b();c._workInProgressHook.memoizedState=[b,a];return b},useReducer:a,useRef:function(b){c._validateCurrentlyRenderingComponent();c._createWorkInProgressHook();
|
|
23
|
-
var a=c._workInProgressHook.memoizedState;return null===a?(b={current:b},c._workInProgressHook.memoizedState=b):a},useState:function(b){return a(
|
|
24
|
-
b}}};a.prototype._createWorkInProgressHook=function(){null===this._workInProgressHook?null===this._firstWorkInProgressHook?(this._isReRender=!1,this._firstWorkInProgressHook=this._workInProgressHook=
|
|
23
|
+
var a=c._workInProgressHook.memoizedState;return null===a?(b={current:b},c._workInProgressHook.memoizedState=b):a},useState:function(b){return a(R,b)}}};a.prototype._dispatchAction=function(b,a,c){25>this._numberOfReRenders?void 0:r("301");if(b===this._currentlyRenderingComponent){this._didScheduleRenderPhaseUpdate=!0;b={action:c,next:null};c=this._renderPhaseUpdates;null===c&&(this._renderPhaseUpdates=c=new Map);var d=c.get(a);if(void 0===d)c.set(a,b);else{for(a=d;null!==a.next;)a=a.next;a.next=
|
|
24
|
+
b}}};a.prototype._createWorkInProgressHook=function(){null===this._workInProgressHook?null===this._firstWorkInProgressHook?(this._isReRender=!1,this._firstWorkInProgressHook=this._workInProgressHook=Q()):(this._isReRender=!0,this._workInProgressHook=this._firstWorkInProgressHook):null===this._workInProgressHook.next?(this._isReRender=!1,this._workInProgressHook=this._workInProgressHook.next=Q()):(this._isReRender=!0,this._workInProgressHook=this._workInProgressHook.next);return this._workInProgressHook};
|
|
25
25
|
a.prototype._prepareToUseHooks=function(b){null!==this._previousComponentIdentity&&this._previousComponentIdentity!==b&&(this._firstWorkInProgressHook=null);this._previousComponentIdentity=this._currentlyRenderingComponent=b};a.prototype._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=this._currentlyRenderingComponent=
|
|
26
|
-
null,this._numberOfReRenders=0)};a.prototype.getMountedInstance=function(){return this._instance};a.prototype.getRenderOutput=function(){return this._rendered};a.prototype.render=function(b){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:
|
|
27
|
-
void 0:r("249",Array.isArray(b.type)?"array":null===b.type?"null":typeof b.type);if(!this._rendering){this._rendering=!0;this._element=b;var c;if((c=b.type.contextTypes)&&a){var e={},l;for(l in c)e[l]=a[l];c=e}else c=
|
|
28
|
-
typeof b.type.getDerivedStateFromProps&&(a=b.type.getDerivedStateFromProps.call(null,b.props,this._instance.state),null!=a&&(this._instance.state=g({},this._instance.state,a))),b.type.hasOwnProperty("contextTypes")&&(
|
|
29
|
-
b.type.call(void 0,b.props,this._context)}finally{
|
|
26
|
+
null,this._numberOfReRenders=0)};a.prototype.getMountedInstance=function(){return this._instance};a.prototype.getRenderOutput=function(){return this._rendered};a.prototype.render=function(b){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:O;h.isValidElement(b)?void 0:r("12","function"===typeof b?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":"");"string"===typeof b.type?r("13",b.type):void 0;m.isForwardRef(b)||"function"===typeof b.type?
|
|
27
|
+
void 0:r("249",Array.isArray(b.type)?"array":null===b.type?"null":typeof b.type);if(!this._rendering){this._rendering=!0;this._element=b;var c;if((c=b.type.contextTypes)&&a){var e={},l;for(l in c)e[l]=a[l];c=e}else c=O;this._context=c;if(this._instance)this._updateClassComponent(b,this._context);else if(m.isForwardRef(b))this._rendered=b.type.render(b.props,b.ref);else if(c=b.type,c.prototype&&c.prototype.isReactComponent)this._instance=new b.type(b.props,this._context,this._updater),"function"===
|
|
28
|
+
typeof b.type.getDerivedStateFromProps&&(a=b.type.getDerivedStateFromProps.call(null,b.props,this._instance.state),null!=a&&(this._instance.state=g({},this._instance.state,a))),b.type.hasOwnProperty("contextTypes")&&(S=b,a=b.type,c=(c=this._instance)&&c.constructor,p(b.type.contextTypes,this._context,"context",a.displayName||c&&c.displayName||a.name||c&&c.name||null,T),S=null),this._mountClassComponent(b,this._context);else{c=N.current;N.current=this._dispatcher;this._prepareToUseHooks(b.type);try{this._rendered=
|
|
29
|
+
b.type.call(void 0,b.props,this._context)}finally{N.current=c}this._finishHooks(b,a)}this._rendering=!1;this._updater._invokeCallbacks();return this.getRenderOutput()}};a.prototype.unmount=function(){this._instance&&"function"===typeof this._instance.componentWillUnmount&&this._instance.componentWillUnmount();this._instance=this._rendered=this._newState=this._element=this._context=this._previousComponentIdentity=this._firstWorkInProgressHook=null};a.prototype._mountClassComponent=function(b,a){this._instance.context=
|
|
30
30
|
a;this._instance.props=b.props;this._instance.state=this._instance.state||null;this._instance.updater=this._updater;if("function"===typeof this._instance.UNSAFE_componentWillMount||"function"===typeof this._instance.componentWillMount)a=this._newState,"function"!==typeof b.type.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillMount&&this._instance.componentWillMount(),"function"===typeof this._instance.UNSAFE_componentWillMount&&
|
|
31
|
-
this._instance.UNSAFE_componentWillMount()),a!==this._newState&&(this._instance.state=this._newState||
|
|
31
|
+
this._instance.UNSAFE_componentWillMount()),a!==this._newState&&(this._instance.state=this._newState||O);this._rendered=this._instance.render()};a.prototype._updateClassComponent=function(a,d){var b=a.props,e=a.type,l=this._instance.state||O,n=this._instance.props;n!==b&&"function"!==typeof a.type.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillReceiveProps&&this._instance.componentWillReceiveProps(b,d),"function"===
|
|
32
32
|
typeof this._instance.UNSAFE_componentWillReceiveProps&&this._instance.UNSAFE_componentWillReceiveProps(b,d));var k=this._newState||l;if("function"===typeof e.getDerivedStateFromProps){var f=e.getDerivedStateFromProps.call(null,b,k);null!=f&&(k=g({},k,f))}f=!0;this._forcedUpdate?(f=!0,this._forcedUpdate=!1):"function"===typeof this._instance.shouldComponentUpdate?f=!!this._instance.shouldComponentUpdate(b,k,d):e.prototype&&e.prototype.isPureReactComponent&&(f=!K(n,b)||!K(l,k));f&&"function"!==typeof a.type.getDerivedStateFromProps&&
|
|
33
|
-
"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillUpdate&&this._instance.componentWillUpdate(b,k,d),"function"===typeof this._instance.UNSAFE_componentWillUpdate&&this._instance.UNSAFE_componentWillUpdate(b,k,d));this._instance.context=d;this._instance.props=b;this._instance.state=k;this._newState=null;f&&(this._rendered=this._instance.render())};return a}();
|
|
34
|
-
function
|
|
33
|
+
"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillUpdate&&this._instance.componentWillUpdate(b,k,d),"function"===typeof this._instance.UNSAFE_componentWillUpdate&&this._instance.UNSAFE_componentWillUpdate(b,k,d));this._instance.context=d;this._instance.props=b;this._instance.state=k;this._newState=null;f&&(this._rendered=this._instance.render())};return a}();U.createRenderer=function(){return new U};var S=null;
|
|
34
|
+
function T(){var a="";if(S){var b=null==S?"#empty":"string"===typeof S||"number"===typeof S?"#text":"string"===typeof S.type?S.type:S.type.displayName||S.type.name||"Unknown",d=S._owner,c=S._source;d=d&&G(d.type);var e="";c?e=" (at "+c.fileName.replace(t,"")+":"+c.lineNumber+")":d&&(e=" (created by "+d+")");a+="\n in "+(b||"Unknown")+e}return a}var V={default:U},W=V&&U||V;module.exports=W.default||W;
|