react-art 18.2.0 → 18.3.0-next-522f47345-20220614

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.
@@ -61,7 +61,7 @@ function _assertThisInitialized(self) {
61
61
  return self;
62
62
  }
63
63
 
64
- var ReactVersion = '18.2.0';
64
+ var ReactVersion = '18.3.0-next-522f47345-20220614';
65
65
 
66
66
  var LegacyRoot = 0;
67
67
  var ConcurrentRoot = 1;
@@ -4124,7 +4124,13 @@ function enqueueConcurrentRenderForLane(fiber, lane) {
4124
4124
  var unsafe_markUpdateLaneFromFiberToRoot = markUpdateLaneFromFiberToRoot;
4125
4125
 
4126
4126
  function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
4127
- // Update the source fiber's lanes
4127
+ // TODO: We will detect and infinite update loop and throw even if this fiber
4128
+ // has already unmounted. This isn't really necessary but it happens to be the
4129
+ // current behavior we've used for several release cycles. Consider not
4130
+ // performing this check if the updated fiber already unmounted, since it's
4131
+ // not possible for that to cause an infinite update loop.
4132
+ throwIfInfiniteUpdateLoopDetected(); // Update the source fiber's lanes
4133
+
4128
4134
  sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);
4129
4135
  var alternate = sourceFiber.alternate;
4130
4136
 
@@ -5243,11 +5249,7 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
5243
5249
  }
5244
5250
 
5245
5251
  if (typeof instance.componentDidMount === 'function') {
5246
- var fiberFlags = Update;
5247
-
5248
- {
5249
- fiberFlags |= LayoutStatic;
5250
- }
5252
+ var fiberFlags = Update | LayoutStatic;
5251
5253
 
5252
5254
  if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) {
5253
5255
  fiberFlags |= MountLayoutDev;
@@ -5295,11 +5297,7 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) {
5295
5297
  // If an update was already in progress, we should schedule an Update
5296
5298
  // effect even though we're bailing out, so that cWU/cDU are called.
5297
5299
  if (typeof instance.componentDidMount === 'function') {
5298
- var fiberFlags = Update;
5299
-
5300
- {
5301
- fiberFlags |= LayoutStatic;
5302
- }
5300
+ var fiberFlags = Update | LayoutStatic;
5303
5301
 
5304
5302
  if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) {
5305
5303
  fiberFlags |= MountLayoutDev;
@@ -5332,11 +5330,7 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) {
5332
5330
  }
5333
5331
 
5334
5332
  if (typeof instance.componentDidMount === 'function') {
5335
- var _fiberFlags = Update;
5336
-
5337
- {
5338
- _fiberFlags |= LayoutStatic;
5339
- }
5333
+ var _fiberFlags = Update | LayoutStatic;
5340
5334
 
5341
5335
  if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) {
5342
5336
  _fiberFlags |= MountLayoutDev;
@@ -5348,11 +5342,7 @@ function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) {
5348
5342
  // If an update was already in progress, we should schedule an Update
5349
5343
  // effect even though we're bailing out, so that cWU/cDU are called.
5350
5344
  if (typeof instance.componentDidMount === 'function') {
5351
- var _fiberFlags2 = Update;
5352
-
5353
- {
5354
- _fiberFlags2 |= LayoutStatic;
5355
- }
5345
+ var _fiberFlags2 = Update | LayoutStatic;
5356
5346
 
5357
5347
  if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) {
5358
5348
  _fiberFlags2 |= MountLayoutDev;
@@ -7786,11 +7776,7 @@ function updateInsertionEffect(create, deps) {
7786
7776
  }
7787
7777
 
7788
7778
  function mountLayoutEffect(create, deps) {
7789
- var fiberFlags = Update;
7790
-
7791
- {
7792
- fiberFlags |= LayoutStatic;
7793
- }
7779
+ var fiberFlags = Update | LayoutStatic;
7794
7780
 
7795
7781
  if ( (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
7796
7782
  fiberFlags |= MountLayoutDev;
@@ -7840,11 +7826,7 @@ function mountImperativeHandle(ref, create, deps) {
7840
7826
 
7841
7827
 
7842
7828
  var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
7843
- var fiberFlags = Update;
7844
-
7845
- {
7846
- fiberFlags |= LayoutStatic;
7847
- }
7829
+ var fiberFlags = Update | LayoutStatic;
7848
7830
 
7849
7831
  if ( (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
7850
7832
  fiberFlags |= MountLayoutDev;
@@ -10176,10 +10158,7 @@ function markRef(current, workInProgress) {
10176
10158
  if (current === null && ref !== null || current !== null && current.ref !== ref) {
10177
10159
  // Schedule a Ref effect
10178
10160
  workInProgress.flags |= Ref;
10179
-
10180
- {
10181
- workInProgress.flags |= RefStatic;
10182
- }
10161
+ workInProgress.flags |= RefStatic;
10183
10162
  }
10184
10163
  }
10185
10164
 
@@ -12247,11 +12226,7 @@ function markUpdate(workInProgress) {
12247
12226
  }
12248
12227
 
12249
12228
  function markRef$1(workInProgress) {
12250
- workInProgress.flags |= Ref;
12251
-
12252
- {
12253
- workInProgress.flags |= RefStatic;
12254
- }
12229
+ workInProgress.flags |= Ref | RefStatic;
12255
12230
  }
12256
12231
 
12257
12232
  var appendAllChildren;
@@ -13259,6 +13234,10 @@ function unwindWork(current, workInProgress, renderLanes) {
13259
13234
 
13260
13235
  return null;
13261
13236
 
13237
+ case TracingMarkerComponent:
13238
+
13239
+ return null;
13240
+
13262
13241
  default:
13263
13242
  return null;
13264
13243
  }
@@ -13539,7 +13518,6 @@ var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
13539
13518
  didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
13540
13519
  } // Used during the commit phase to track the state of the Offscreen component stack.
13541
13520
  // Allows us to avoid traversing the return path to find the nearest Offscreen ancestor.
13542
- // Only used when enableSuspenseLayoutEffectSemantics is enabled.
13543
13521
 
13544
13522
 
13545
13523
  var offscreenSubtreeIsHidden = false;
@@ -13978,7 +13956,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork, committe
13978
13956
  case ForwardRef:
13979
13957
  case SimpleMemoComponent:
13980
13958
  {
13981
- if ( !offscreenSubtreeWasHidden) {
13959
+ if (!offscreenSubtreeWasHidden) {
13982
13960
  // At this point layout effects have already been destroyed (during mutation phase).
13983
13961
  // This is done to prevent sibling component effects from interfering with each other,
13984
13962
  // e.g. a destroy function in one component should never override a ref set
@@ -14216,7 +14194,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork, committe
14216
14194
  }
14217
14195
  }
14218
14196
 
14219
- if ( !offscreenSubtreeWasHidden) {
14197
+ if (!offscreenSubtreeWasHidden) {
14220
14198
  {
14221
14199
  if (finishedWork.flags & Ref) {
14222
14200
  commitAttachRef(finishedWork);
@@ -14856,8 +14834,7 @@ function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, dele
14856
14834
 
14857
14835
  case OffscreenComponent:
14858
14836
  {
14859
- if ( // TODO: Remove this dead flag
14860
- deletedFiber.mode & ConcurrentMode) {
14837
+ if (deletedFiber.mode & ConcurrentMode) {
14861
14838
  // If this offscreen component is hidden, we already unmounted it. Before
14862
14839
  // deleting the children, track that it's already unmounted so that we
14863
14840
  // don't attempt to unmount the effects again.
@@ -15176,8 +15153,7 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
15176
15153
  {
15177
15154
  var _wasHidden = current !== null && current.memoizedState !== null;
15178
15155
 
15179
- if ( // TODO: Remove this dead flag
15180
- finishedWork.mode & ConcurrentMode) {
15156
+ if (finishedWork.mode & ConcurrentMode) {
15181
15157
  // Before committing the children, track on the stack whether this
15182
15158
  // offscreen subtree was already hidden, so that we don't unmount the
15183
15159
  // effects again.
@@ -15202,18 +15178,16 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
15202
15178
 
15203
15179
  _offscreenInstance.isHidden = _isHidden;
15204
15180
 
15205
- {
15206
- if (_isHidden) {
15207
- if (!_wasHidden) {
15208
- if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
15209
- nextEffect = offscreenBoundary;
15210
- var offscreenChild = offscreenBoundary.child;
15211
-
15212
- while (offscreenChild !== null) {
15213
- nextEffect = offscreenChild;
15214
- disappearLayoutEffects_begin(offscreenChild);
15215
- offscreenChild = offscreenChild.sibling;
15216
- }
15181
+ if (_isHidden) {
15182
+ if (!_wasHidden) {
15183
+ if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
15184
+ nextEffect = offscreenBoundary;
15185
+ var offscreenChild = offscreenBoundary.child;
15186
+
15187
+ while (offscreenChild !== null) {
15188
+ nextEffect = offscreenChild;
15189
+ disappearLayoutEffects_begin(offscreenChild);
15190
+ offscreenChild = offscreenChild.sibling;
15217
15191
  }
15218
15192
  }
15219
15193
  }
@@ -15298,7 +15272,7 @@ function commitLayoutEffects_begin(subtreeRoot, root, committedLanes) {
15298
15272
  var fiber = nextEffect;
15299
15273
  var firstChild = fiber.child;
15300
15274
 
15301
- if ( fiber.tag === OffscreenComponent && isModernRoot) {
15275
+ if (fiber.tag === OffscreenComponent && isModernRoot) {
15302
15276
  // Keep track of the current Offscreen stack's state.
15303
15277
  var isHidden = fiber.memoizedState !== null;
15304
15278
  var newOffscreenSubtreeIsHidden = isHidden || offscreenSubtreeIsHidden;
@@ -16138,8 +16112,6 @@ function requestRetryLane(fiber) {
16138
16112
  }
16139
16113
 
16140
16114
  function scheduleUpdateOnFiber(root, fiber, lane, eventTime) {
16141
- checkForNestedUpdates();
16142
-
16143
16115
  {
16144
16116
  if (isRunningInsertionEffect) {
16145
16117
  error('useInsertionEffect must not schedule updates.');
@@ -17864,7 +17836,7 @@ function jnd(timeElapsed) {
17864
17836
  return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
17865
17837
  }
17866
17838
 
17867
- function checkForNestedUpdates() {
17839
+ function throwIfInfiniteUpdateLoopDetected() {
17868
17840
  if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
17869
17841
  nestedUpdateCount = 0;
17870
17842
  rootWithNestedUpdates = null;