react-test-renderer 0.0.0-experimental-790b5246f-20220118 → 0.0.0-experimental-e28a0db22-20220124

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.
@@ -913,10 +913,17 @@ function injectInternals(internals) {
913
913
  }
914
914
 
915
915
  try {
916
- rendererID = hook.inject(_assign({}, internals, {
917
- getLaneLabelMap: getLaneLabelMap,
918
- injectProfilingHooks: injectProfilingHooks
919
- })); // We have successfully injected, so now it is safe to set up hooks.
916
+ if (enableSchedulingProfiler) {
917
+ // Conditionally inject these hooks only if Timeline profiler is supported by this build.
918
+ // This gives DevTools a way to feature detect that isn't tied to version number
919
+ // (since profiling and timeline are controlled by different feature flags).
920
+ internals = _assign({}, internals, {
921
+ getLaneLabelMap: getLaneLabelMap,
922
+ injectProfilingHooks: injectProfilingHooks
923
+ });
924
+ }
925
+
926
+ rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks.
920
927
 
921
928
  injectedHook = hook;
922
929
  } catch (err) {
@@ -1029,16 +1036,9 @@ function injectProfilingHooks(profilingHooks) {
1029
1036
  }
1030
1037
 
1031
1038
  function getLaneLabelMap() {
1032
- var map = new Map();
1033
- var lane = 1;
1034
-
1035
- for (var index = 0; index < TotalLanes; index++) {
1036
- var label = getLabelForLane();
1037
- map.set(lane, label);
1038
- lane *= 2;
1039
+ {
1040
+ return null;
1039
1041
  }
1040
-
1041
- return map;
1042
1042
  }
1043
1043
  function markComponentRenderStopped() {
1044
1044
  }
@@ -1194,10 +1194,6 @@ var IdleLane =
1194
1194
  var OffscreenLane =
1195
1195
  /* */
1196
1196
  1073741824; // This function is used for the experimental timeline (react-devtools-timeline)
1197
- // It should be kept in sync with the Lanes values above.
1198
-
1199
- function getLabelForLane(lane) {
1200
- }
1201
1197
  var NoTimestamp = -1;
1202
1198
  var nextTransitionLane = TransitionLane1;
1203
1199
  var nextRetryLane = RetryLane1;
@@ -3097,7 +3093,7 @@ function popProvider(context, providerFiber) {
3097
3093
  context._currentValue2 = currentValue;
3098
3094
  }
3099
3095
  }
3100
- function scheduleWorkOnParentPath(parent, renderLanes) {
3096
+ function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) {
3101
3097
  // Update the child lanes of all the ancestors, including the alternates.
3102
3098
  var node = parent;
3103
3099
 
@@ -3112,14 +3108,20 @@ function scheduleWorkOnParentPath(parent, renderLanes) {
3112
3108
  }
3113
3109
  } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes)) {
3114
3110
  alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes);
3115
- } else {
3116
- // Neither alternate was updated, which means the rest of the
3117
- // ancestor path already has sufficient priority.
3111
+ }
3112
+
3113
+ if (node === propagationRoot) {
3118
3114
  break;
3119
3115
  }
3120
3116
 
3121
3117
  node = node.return;
3122
3118
  }
3119
+
3120
+ {
3121
+ if (node !== propagationRoot) {
3122
+ error('Expected to find the propagation root when scheduling context work. ' + 'This error is likely caused by a bug in React. Please file an issue.');
3123
+ }
3124
+ }
3123
3125
  }
3124
3126
  function propagateContextChange(workInProgress, context, renderLanes) {
3125
3127
  {
@@ -3184,7 +3186,7 @@ function propagateContextChange_eager(workInProgress, context, renderLanes) {
3184
3186
  alternate.lanes = mergeLanes(alternate.lanes, renderLanes);
3185
3187
  }
3186
3188
 
3187
- scheduleWorkOnParentPath(fiber.return, renderLanes); // Mark the updated lanes on the list, too.
3189
+ scheduleContextWorkOnParentPath(fiber.return, renderLanes, workInProgress); // Mark the updated lanes on the list, too.
3188
3190
 
3189
3191
  list.lanes = mergeLanes(list.lanes, renderLanes); // Since we already found a match, we can stop traversing the
3190
3192
  // dependency list.
@@ -11450,7 +11452,7 @@ function updateSuspenseFallbackChildren(current, workInProgress, primaryChildren
11450
11452
  return fallbackChildFragment;
11451
11453
  }
11452
11454
 
11453
- function scheduleWorkOnFiber(fiber, renderLanes) {
11455
+ function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {
11454
11456
  fiber.lanes = mergeLanes(fiber.lanes, renderLanes);
11455
11457
  var alternate = fiber.alternate;
11456
11458
 
@@ -11458,7 +11460,7 @@ function scheduleWorkOnFiber(fiber, renderLanes) {
11458
11460
  alternate.lanes = mergeLanes(alternate.lanes, renderLanes);
11459
11461
  }
11460
11462
 
11461
- scheduleWorkOnParentPath(fiber.return, renderLanes);
11463
+ scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot);
11462
11464
  }
11463
11465
 
11464
11466
  function propagateSuspenseContextChange(workInProgress, firstChild, renderLanes) {
@@ -11472,7 +11474,7 @@ function propagateSuspenseContextChange(workInProgress, firstChild, renderLanes)
11472
11474
  var state = node.memoizedState;
11473
11475
 
11474
11476
  if (state !== null) {
11475
- scheduleWorkOnFiber(node, renderLanes);
11477
+ scheduleSuspenseWorkOnFiber(node, renderLanes, workInProgress);
11476
11478
  }
11477
11479
  } else if (node.tag === SuspenseListComponent) {
11478
11480
  // If the tail is hidden there might not be an Suspense boundaries
@@ -11480,7 +11482,7 @@ function propagateSuspenseContextChange(workInProgress, firstChild, renderLanes)
11480
11482
  // list itself.
11481
11483
  // We don't have to traverse to the children of the list since
11482
11484
  // the list will propagate the change when it rerenders.
11483
- scheduleWorkOnFiber(node, renderLanes);
11485
+ scheduleSuspenseWorkOnFiber(node, renderLanes, workInProgress);
11484
11486
  } else if (node.child !== null) {
11485
11487
  node.child.return = node;
11486
11488
  node = node.child;
@@ -12853,6 +12855,12 @@ function safelyDetachRef(current, nearestMountedAncestor) {
12853
12855
  reportUncaughtErrorInDEV(error);
12854
12856
  captureCommitPhaseError(current, nearestMountedAncestor, error);
12855
12857
  }
12858
+
12859
+ {
12860
+ if (typeof retVal === 'function') {
12861
+ error('Unexpected return value from a callback ref in %s. ' + 'A callback ref should not return a function.', getComponentNameFromFiber(current));
12862
+ }
12863
+ }
12856
12864
  } else {
12857
12865
  ref.current = null;
12858
12866
  }
@@ -13472,6 +13480,12 @@ function commitAttachRef(finishedWork) {
13472
13480
  } else {
13473
13481
  retVal = ref(instanceToUse);
13474
13482
  }
13483
+
13484
+ {
13485
+ if (typeof retVal === 'function') {
13486
+ error('Unexpected return value from a callback ref in %s. ' + 'A callback ref should not return a function.', getComponentNameFromFiber(finishedWork));
13487
+ }
13488
+ }
13475
13489
  } else {
13476
13490
  {
13477
13491
  if (!ref.hasOwnProperty('current')) {
@@ -17791,7 +17805,7 @@ function createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks, isStri
17791
17805
  return root;
17792
17806
  }
17793
17807
 
17794
- var ReactVersion = '18.0.0-rc.0-experimental-790b5246f-20220118';
17808
+ var ReactVersion = '18.0.0-rc.0-experimental-e28a0db22-20220124';
17795
17809
 
17796
17810
  var didWarnAboutNestedUpdates;
17797
17811