react-test-renderer 0.0.0-experimental-fd0da3eef-20240404 → 0.0.0-experimental-e3ebcd54b-20240405

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.
@@ -4840,74 +4840,6 @@ var ReactStrictModeWarnings = {
4840
4840
  };
4841
4841
  }
4842
4842
 
4843
- /*
4844
- * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
4845
- * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
4846
- *
4847
- * The functions in this module will throw an easier-to-understand,
4848
- * easier-to-debug exception with a clear errors message message explaining the
4849
- * problem. (Instead of a confusing exception thrown inside the implementation
4850
- * of the `value` object).
4851
- */
4852
- // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
4853
- function typeName(value) {
4854
- {
4855
- // toStringTag is needed for namespaced types like Temporal.Instant
4856
- var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
4857
- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; // $FlowFixMe[incompatible-return]
4858
-
4859
- return type;
4860
- }
4861
- } // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
4862
-
4863
-
4864
- function willCoercionThrow(value) {
4865
- {
4866
- try {
4867
- testStringCoercion(value);
4868
- return false;
4869
- } catch (e) {
4870
- return true;
4871
- }
4872
- }
4873
- }
4874
-
4875
- function testStringCoercion(value) {
4876
- // If you ended up here by following an exception call stack, here's what's
4877
- // happened: you supplied an object or symbol value to React (as a prop, key,
4878
- // DOM attribute, CSS property, string ref, etc.) and when React tried to
4879
- // coerce it to a string using `'' + value`, an exception was thrown.
4880
- //
4881
- // The most common types that will cause this exception are `Symbol` instances
4882
- // and Temporal objects like `Temporal.Instant`. But any object that has a
4883
- // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
4884
- // exception. (Library authors do this to prevent users from using built-in
4885
- // numeric operators like `+` or comparison operators like `>=` because custom
4886
- // methods are needed to perform accurate arithmetic or comparison.)
4887
- //
4888
- // To fix the problem, coerce this object or symbol value to a string before
4889
- // passing it to React. The most reliable way is usually `String(value)`.
4890
- //
4891
- // To find which value is throwing, check the browser or debugger console.
4892
- // Before this exception was thrown, there should be `console.error` output
4893
- // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
4894
- // problem and how that type was used: key, atrribute, input value prop, etc.
4895
- // In most cases, this console output also shows the component and its
4896
- // ancestor components where the exception happened.
4897
- //
4898
- // eslint-disable-next-line react-internal/safe-string-coercion
4899
- return '' + value;
4900
- }
4901
- function checkPropStringCoercion(value, propName) {
4902
- {
4903
- if (willCoercionThrow(value)) {
4904
- error('The provided `%s` prop is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', propName, typeName(value));
4905
-
4906
- return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
4907
- }
4908
- }
4909
- }
4910
-
4911
4843
  var ReactCurrentActQueue$3 = ReactSharedInternals.ReactCurrentActQueue;
4912
4844
 
4913
4845
  function getThenablesFromState(state) {
@@ -5223,25 +5155,19 @@ function unwrapThenable(thenable) {
5223
5155
  }
5224
5156
 
5225
5157
  function coerceRef(returnFiber, current, workInProgress, element) {
5226
- var mixedRef;
5158
+ var ref;
5227
5159
 
5228
5160
  {
5229
5161
  // TODO: This is a temporary, intermediate step. When enableRefAsProp is on,
5230
5162
  // we should resolve the `ref` prop during the begin phase of the component
5231
5163
  // it's attached to (HostComponent, ClassComponent, etc).
5232
5164
  var refProp = element.props.ref;
5233
- mixedRef = refProp !== undefined ? refProp : null;
5234
- }
5235
-
5236
- var coercedRef;
5237
-
5238
- {
5239
- coercedRef = mixedRef;
5165
+ ref = refProp !== undefined ? refProp : null;
5240
5166
  } // TODO: If enableRefAsProp is on, we shouldn't use the `ref` field. We
5241
5167
  // should always read the ref from the prop.
5242
5168
 
5243
5169
 
5244
- workInProgress.ref = coercedRef;
5170
+ workInProgress.ref = ref;
5245
5171
  }
5246
5172
 
5247
5173
  function throwOnInvalidObjectType(returnFiber, newChild) {
@@ -22122,7 +22048,75 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
22122
22048
  return root;
22123
22049
  }
22124
22050
 
22125
- var ReactVersion = '19.0.0-experimental-fd0da3eef-20240404';
22051
+ var ReactVersion = '19.0.0-experimental-e3ebcd54b-20240405';
22052
+
22053
+ /*
22054
+ * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
22055
+ * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
22056
+ *
22057
+ * The functions in this module will throw an easier-to-understand,
22058
+ * easier-to-debug exception with a clear errors message message explaining the
22059
+ * problem. (Instead of a confusing exception thrown inside the implementation
22060
+ * of the `value` object).
22061
+ */
22062
+ // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
22063
+ function typeName(value) {
22064
+ {
22065
+ // toStringTag is needed for namespaced types like Temporal.Instant
22066
+ var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
22067
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; // $FlowFixMe[incompatible-return]
22068
+
22069
+ return type;
22070
+ }
22071
+ } // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
22072
+
22073
+
22074
+ function willCoercionThrow(value) {
22075
+ {
22076
+ try {
22077
+ testStringCoercion(value);
22078
+ return false;
22079
+ } catch (e) {
22080
+ return true;
22081
+ }
22082
+ }
22083
+ }
22084
+
22085
+ function testStringCoercion(value) {
22086
+ // If you ended up here by following an exception call stack, here's what's
22087
+ // happened: you supplied an object or symbol value to React (as a prop, key,
22088
+ // DOM attribute, CSS property, string ref, etc.) and when React tried to
22089
+ // coerce it to a string using `'' + value`, an exception was thrown.
22090
+ //
22091
+ // The most common types that will cause this exception are `Symbol` instances
22092
+ // and Temporal objects like `Temporal.Instant`. But any object that has a
22093
+ // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
22094
+ // exception. (Library authors do this to prevent users from using built-in
22095
+ // numeric operators like `+` or comparison operators like `>=` because custom
22096
+ // methods are needed to perform accurate arithmetic or comparison.)
22097
+ //
22098
+ // To fix the problem, coerce this object or symbol value to a string before
22099
+ // passing it to React. The most reliable way is usually `String(value)`.
22100
+ //
22101
+ // To find which value is throwing, check the browser or debugger console.
22102
+ // Before this exception was thrown, there should be `console.error` output
22103
+ // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
22104
+ // problem and how that type was used: key, atrribute, input value prop, etc.
22105
+ // In most cases, this console output also shows the component and its
22106
+ // ancestor components where the exception happened.
22107
+ //
22108
+ // eslint-disable-next-line react-internal/safe-string-coercion
22109
+ return '' + value;
22110
+ }
22111
+ function checkPropStringCoercion(value, propName) {
22112
+ {
22113
+ if (willCoercionThrow(value)) {
22114
+ error('The provided `%s` prop is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', propName, typeName(value));
22115
+
22116
+ return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
22117
+ }
22118
+ }
22119
+ }
22126
22120
 
22127
22121
  // Might add PROFILE later.
22128
22122
 
@@ -3741,25 +3741,19 @@ function unwrapThenable(thenable) {
3741
3741
  }
3742
3742
 
3743
3743
  function coerceRef(returnFiber, current, workInProgress, element) {
3744
- let mixedRef;
3744
+ let ref;
3745
3745
 
3746
3746
  {
3747
3747
  // TODO: This is a temporary, intermediate step. When enableRefAsProp is on,
3748
3748
  // we should resolve the `ref` prop during the begin phase of the component
3749
3749
  // it's attached to (HostComponent, ClassComponent, etc).
3750
3750
  const refProp = element.props.ref;
3751
- mixedRef = refProp !== undefined ? refProp : null;
3752
- }
3753
-
3754
- let coercedRef;
3755
-
3756
- {
3757
- coercedRef = mixedRef;
3751
+ ref = refProp !== undefined ? refProp : null;
3758
3752
  } // TODO: If enableRefAsProp is on, we shouldn't use the `ref` field. We
3759
3753
  // should always read the ref from the prop.
3760
3754
 
3761
3755
 
3762
- workInProgress.ref = coercedRef;
3756
+ workInProgress.ref = ref;
3763
3757
  }
3764
3758
 
3765
3759
  function throwOnInvalidObjectType(returnFiber, newChild) {
@@ -16296,7 +16290,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
16296
16290
  return root;
16297
16291
  }
16298
16292
 
16299
- var ReactVersion = '19.0.0-experimental-fd0da3eef-20240404';
16293
+ var ReactVersion = '19.0.0-experimental-e3ebcd54b-20240405';
16300
16294
 
16301
16295
  function getContextForSubtree(parentComponent) {
16302
16296
  if (!parentComponent) {
@@ -244,9 +244,9 @@ var ui=function(){function a(c){this._fiber=void 0;if(!pi.has(c.tag))throw Error
244
244
  c.toString())};b.findByType=function(c){return si(this.findAllByType(c,{deep:!1}),'with node type: "'+(Ba(c)||"Unknown")+'"')};b.findByProps=function(c){return si(this.findAllByProps(c,{deep:!1}),"with props: "+JSON.stringify(c))};b.findAll=function(c){return ti(this,c,1<arguments.length&&void 0!==arguments[1]?arguments[1]:null)};b.findAllByType=function(c){return ti(this,function(d){return d.type===c},1<arguments.length&&void 0!==arguments[1]?arguments[1]:null)};b.findAllByProps=function(c){return ti(this,
245
245
  function(d){var e;if(e=d.props)a:{for(var f in c)if(d.props[f]!==c[f]){e=!1;break a}e=!0}return e},1<arguments.length&&void 0!==arguments[1]?arguments[1]:null)};ea(a,[{key:"instance",get:function(){var c=this._fiber.tag;return 5===c||26===c||27===c?pb(this._fiber.stateNode):this._fiber.stateNode}},{key:"type",get:function(){return this._fiber.type}},{key:"props",get:function(){return this._currentFiber().memoizedProps}},{key:"parent",get:function(){for(var c=this._fiber.return;null!==c;){if(pi.has(c.tag)){if(3===
246
246
  c.tag&&2>qi(c).length)break;return ri(c)}c=c.return}return null}},{key:"children",get:function(){return qi(this._currentFiber())}}]);return a}();function ti(a,b,c){var d=c?c.deep:!0,e=[];if(b(a)&&(e.push(a),!d))return e;a.children.forEach(function(f){"string"!==typeof f&&e.push.apply(e,ti(f,b,c))});return e}function si(a,b){if(1===a.length)return a[0];throw Error((0===a.length?"No instances found ":"Expected 1 but found "+a.length+" instances ")+b);}var vi=new WeakMap;
247
- function ri(a){var b=vi.get(a);void 0===b&&null!==a.alternate&&(b=vi.get(a.alternate));void 0===b&&(b=new ui(a),vi.set(a,b));return b}var wi={findFiberByHostInstance:function(){throw Error("TestRenderer does not support findFiberByHostInstance()");},bundleType:0,version:"19.0.0-experimental-fd0da3eef-20240404",rendererPackageName:"react-test-renderer"};
247
+ function ri(a){var b=vi.get(a);void 0===b&&null!==a.alternate&&(b=vi.get(a.alternate));void 0===b&&(b=new ui(a),vi.set(a,b));return b}var wi={findFiberByHostInstance:function(){throw Error("TestRenderer does not support findFiberByHostInstance()");},bundleType:0,version:"19.0.0-experimental-e3ebcd54b-20240405",rendererPackageName:"react-test-renderer"};
248
248
  var xi={bundleType:wi.bundleType,version:wi.version,rendererPackageName:wi.rendererPackageName,rendererConfig:wi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ia.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=Ea(a);a=null!==a?Fa(a):null;return null===a?null:a.stateNode},
249
- findFiberByHostInstance:wi.findFiberByHostInstance||hi,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"19.0.0-experimental-fd0da3eef-20240404"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var yi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yi.isDisabled&&yi.supportsFiber)try{Ra=yi.inject(xi),Sa=yi}catch(a){}}exports._Scheduler=ba;exports.act=ii;
249
+ findFiberByHostInstance:wi.findFiberByHostInstance||hi,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"19.0.0-experimental-e3ebcd54b-20240405"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var yi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yi.isDisabled&&yi.supportsFiber)try{Ra=yi.inject(xi),Sa=yi}catch(a){}}exports._Scheduler=ba;exports.act=ii;
250
250
  exports.create=function(a,b){var c=ji.createNodeMock,d=!0!==global.IS_REACT_NATIVE_TEST_ENVIRONMENT,e=d,f=!1;"object"===typeof b&&null!==b&&("function"===typeof b.createNodeMock&&(c=b.createNodeMock),!1===d&&(e=b.unstable_isConcurrent),!0===b.unstable_strictMode&&(f=!0));var g={children:[],createNodeMock:c,tag:"CONTAINER"},h=fi(g,e?1:0,null,f,null,"",Ze,$e,af,null);if(null==h)throw Error("something went wrong");gi(a,h,null,null);a={_Scheduler:ba,root:void 0,toJSON:function(){if(null==h||null==h.current||
251
251
  null==g||0===g.children.length)return null;if(1===g.children.length)return ki(g.children[0]);if(2===g.children.length&&!0===g.children[0].isHidden&&!1===g.children[1].isHidden)return ki(g.children[1]);var n=null;if(g.children&&g.children.length)for(var p=0;p<g.children.length;p++){var t=ki(g.children[p]);null!==t&&(null===n?n=[t]:n.push(t))}return n},toTree:function(){return null==h||null==h.current?null:ni(h.current)},update:function(n){null!=h&&null!=h.current&&gi(n,h,null,null)},unmount:function(){null!=
252
252
  h&&null!=h.current&&(gi(null,h,null,null),h=g=null)},getInstance:function(){if(null==h||null==h.current)return null;a:{var n=h.current;if(n.child)switch(n.child.tag){case 27:case 5:n=pb(n.child.stateNode);break a;default:n=n.child.stateNode}else n=null}return n},unstable_flushSync:Mh};Object.defineProperty(a,"root",{configurable:!0,enumerable:!0,get:function(){if(null===h)throw Error("Can't access .root on unmounted test renderer");var n=qi(h.current);if(0===n.length)throw Error("Can't access .root on unmounted test renderer");