@@ -9786,9 +9786,7 @@ __DEV__ &&
9786
9786
markComponentLayoutEffectUnmountStarted(finishedWork)),
9787
9787
(flags & Insertion) !== NoFlags &&
9788
9788
(isRunningInsertionEffect = !0),
9789
- runWithFiberInDEV(
9790
- finishedWork,
9791
- callDestroyInDEV,
9789
+ safelyCallDestroy(
9792
9790
finishedWork,
9793
9791
nearestMountedAncestor,
9794
9792
destroy
@@ -10028,6 +10026,15 @@ __DEV__ &&
10028
10026
}
10029
10027
else ref.current = null;
10030
10028
}
10029
+ function safelyCallDestroy(current, nearestMountedAncestor, destroy) {
10030
+ runWithFiberInDEV(
10031
+ current,
10032
+ callDestroyInDEV,
10033
+ current,
10034
+ nearestMountedAncestor,
10035
+ destroy
10036
+ );
10037
+ }
10031
10038
function commitProfiler(finishedWork, current, commitTime, effectDuration) {
10032
10039
var _finishedWork$memoize = finishedWork.memoizedProps,
10033
10040
onCommit = _finishedWork$memoize.onCommit;
@@ -10816,54 +10823,95 @@ __DEV__ &&
10816
10823
case 11:
10817
10824
case 14:
10818
10825
case 15:
10819
- if (
10826
+ if (enableHiddenSubtreeInsertionEffectCleanup) {
10827
+ if (
10828
+ ((_prevHostParent = deletedFiber.updateQueue),
10829
+ null !== _prevHostParent &&
10830
+ ((_prevHostParent = _prevHostParent.lastEffect),
10831
+ null !== _prevHostParent))
10832
+ ) {
10833
+ _prevHostParentIsContainer = _prevHostParent =
10834
+ _prevHostParent.next;
10835
+ do {
10836
+ var tag = _prevHostParentIsContainer.tag,
10837
+ inst = _prevHostParentIsContainer.inst,
10838
+ destroy = inst.destroy;
10839
+ void 0 !== destroy &&
10840
+ ((tag & Insertion) !== NoFlags
10841
+ ? ((isRunningInsertionEffect = !0),
10842
+ (inst.destroy = void 0),
10843
+ safelyCallDestroy(
10844
+ deletedFiber,
10845
+ nearestMountedAncestor,
10846
+ destroy
10847
+ ),
10848
+ (isRunningInsertionEffect = !1))
10849
+ : offscreenSubtreeWasHidden ||
10850
+ (tag & Layout) === NoFlags ||
10851
+ (enableSchedulingProfiler &&
10852
+ markComponentLayoutEffectUnmountStarted(deletedFiber),
10853
+ shouldProfile(deletedFiber)
10854
+ ? (startLayoutEffectTimer(),
10855
+ (inst.destroy = void 0),
10856
+ safelyCallDestroy(
10857
+ deletedFiber,
10858
+ nearestMountedAncestor,
10859
+ destroy
10860
+ ),
10861
+ recordLayoutEffectDuration(deletedFiber))
10862
+ : ((inst.destroy = void 0),
10863
+ safelyCallDestroy(
10864
+ deletedFiber,
10865
+ nearestMountedAncestor,
10866
+ destroy
10867
+ )),
10868
+ enableSchedulingProfiler &&
10869
+ markComponentLayoutEffectUnmountStopped()));
10870
+ _prevHostParentIsContainer = _prevHostParentIsContainer.next;
10871
+ } while (_prevHostParentIsContainer !== _prevHostParent);
10872
+ }
10873
+ } else if (
10820
10874
!offscreenSubtreeWasHidden &&
10821
10875
((_prevHostParent = deletedFiber.updateQueue),
10822
10876
null !== _prevHostParent &&
10823
10877
((_prevHostParent = _prevHostParent.lastEffect),
10824
10878
null !== _prevHostParent))
10825
10879
) {
10826
10880
_prevHostParentIsContainer = _prevHostParent = _prevHostParent.next;
10827
- do {
10828
- var tag = _prevHostParentIsContainer.tag,
10829
- inst = _prevHostParentIsContainer.inst,
10830
- destroy = inst.destroy;
10831
- void 0 !== destroy &&
10832
- ((tag & Insertion) !== NoFlags
10833
- ? ((inst.destroy = void 0),
10834
- runWithFiberInDEV(
10835
- deletedFiber,
10836
- callDestroyInDEV,
10837
- deletedFiber,
10838
- nearestMountedAncestor,
10839
- destroy
10840
- ))
10841
- : (tag & Layout) !== NoFlags &&
10842
- (enableSchedulingProfiler &&
10843
- markComponentLayoutEffectUnmountStarted(deletedFiber),
10844
- shouldProfile(deletedFiber)
10845
- ? (startLayoutEffectTimer(),
10846
- (inst.destroy = void 0),
10847
- runWithFiberInDEV(
10848
- deletedFiber,
10849
- callDestroyInDEV,
10850
- deletedFiber,
10851
- nearestMountedAncestor,
10852
- destroy
10853
- ),
10854
- recordLayoutEffectDuration(deletedFiber))
10855
- : ((inst.destroy = void 0),
10856
- runWithFiberInDEV(
10857
- deletedFiber,
10858
- callDestroyInDEV,
10859
- deletedFiber,
10860
- nearestMountedAncestor,
10861
- destroy
10862
- )),
10863
- enableSchedulingProfiler &&
10864
- markComponentLayoutEffectUnmountStopped()));
10865
- _prevHostParentIsContainer = _prevHostParentIsContainer.next;
10866
- } while (_prevHostParentIsContainer !== _prevHostParent);
10881
+ do
10882
+ (tag = _prevHostParentIsContainer.tag),
10883
+ (inst = _prevHostParentIsContainer.inst),
10884
+ (destroy = inst.destroy),
10885
+ void 0 !== destroy &&
10886
+ ((tag & Insertion) !== NoFlags
10887
+ ? ((inst.destroy = void 0),
10888
+ safelyCallDestroy(
10889
+ deletedFiber,
10890
+ nearestMountedAncestor,
10891
+ destroy
10892
+ ))
10893
+ : (tag & Layout) !== NoFlags &&
10894
+ (enableSchedulingProfiler &&
10895
+ markComponentLayoutEffectUnmountStarted(deletedFiber),
10896
+ shouldProfile(deletedFiber)
10897
+ ? (startLayoutEffectTimer(),
10898
+ (inst.destroy = void 0),
10899
+ safelyCallDestroy(
10900
+ deletedFiber,
10901
+ nearestMountedAncestor,
10902
+ destroy
10903
+ ),
10904
+ recordLayoutEffectDuration(deletedFiber))
10905
+ : ((inst.destroy = void 0),
10906
+ safelyCallDestroy(
10907
+ deletedFiber,
10908
+ nearestMountedAncestor,
10909
+ destroy
10910
+ )),
10911
+ enableSchedulingProfiler &&
10912
+ markComponentLayoutEffectUnmountStopped())),
10913
+ (_prevHostParentIsContainer = _prevHostParentIsContainer.next);
10914
+ while (_prevHostParentIsContainer !== _prevHostParent);
10867
10915
}
10868
10916
recursivelyTraverseDeletionEffects(
10869
10917
finishedRoot,
@@ -14863,6 +14911,8 @@ __DEV__ &&
14863
14911
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
14864
14912
enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration,
14865
14913
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
14914
+ enableHiddenSubtreeInsertionEffectCleanup =
14915
+ dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup,
14866
14916
renameElementSymbol = dynamicFeatureFlags.renameElementSymbol,
14867
14917
retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs,
14868
14918
syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs,
@@ -17062,11 +17112,11 @@ __DEV__ &&
17062
17112
(function () {
17063
17113
var internals = {
17064
17114
bundleType: 1,
17065
- version: "19.0.0-www-classic-94e4acaa -20240913",
17115
+ version: "19.0.0-www-classic-d3d4d3a4 -20240913",
17066
17116
rendererPackageName: "react-art",
17067
17117
currentDispatcherRef: ReactSharedInternals,
17068
17118
findFiberByHostInstance: getInstanceFromNode,
17069
- reconcilerVersion: "19.0.0-www-classic-94e4acaa -20240913"
17119
+ reconcilerVersion: "19.0.0-www-classic-d3d4d3a4 -20240913"
17070
17120
};
17071
17121
internals.overrideHookState = overrideHookState;
17072
17122
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -17100,7 +17150,7 @@ __DEV__ &&
17100
17150
exports.Shape = Shape;
17101
17151
exports.Surface = Surface;
17102
17152
exports.Text = Text;
17103
- exports.version = "19.0.0-www-classic-94e4acaa -20240913";
17153
+ exports.version = "19.0.0-www-classic-d3d4d3a4 -20240913";
17104
17154
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
17105
17155
"function" ===
17106
17156
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
0 commit comments