@@ -3855,6 +3855,34 @@ __DEV__ &&
3855
3855
next: null
3856
3856
});
3857
3857
}
3858
+ function pushResourceEffect(
3859
+ identityTag,
3860
+ updateTag,
3861
+ inst,
3862
+ create,
3863
+ createDeps,
3864
+ update,
3865
+ updateDeps
3866
+ ) {
3867
+ identityTag = {
3868
+ resourceKind: ResourceEffectIdentityKind,
3869
+ tag: identityTag,
3870
+ create: create,
3871
+ deps: createDeps,
3872
+ inst: inst,
3873
+ next: null
3874
+ };
3875
+ pushEffectImpl(identityTag);
3876
+ return pushEffectImpl({
3877
+ resourceKind: ResourceEffectUpdateKind,
3878
+ tag: updateTag,
3879
+ update: update,
3880
+ deps: updateDeps,
3881
+ inst: inst,
3882
+ identity: identityTag,
3883
+ next: null
3884
+ });
3885
+ }
3858
3886
function pushEffectImpl(effect) {
3859
3887
var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
3860
3888
null === componentUpdateQueue &&
@@ -3919,56 +3947,39 @@ __DEV__ &&
3919
3947
updateDeps,
3920
3948
destroy
3921
3949
) {
3922
- 0 !== (currentlyRenderingFiber$1.mode & 16) &&
3923
- 0 === (currentlyRenderingFiber$1.mode & 64)
3924
- ? mountResourceEffectImpl(
3925
- 142608384,
3926
- Passive,
3927
- create,
3928
- createDeps,
3929
- update,
3930
- updateDeps,
3931
- destroy
3932
- )
3933
- : mountResourceEffectImpl(
3934
- 8390656,
3935
- Passive,
3950
+ if (
3951
+ 0 !== (currentlyRenderingFiber$1.mode & 16) &&
3952
+ 0 === (currentlyRenderingFiber$1.mode & 64)
3953
+ ) {
3954
+ var hookFlags = Passive,
3955
+ hook = mountWorkInProgressHook();
3956
+ currentlyRenderingFiber$1.flags |= 142608384;
3957
+ var inst = createEffectInstance();
3958
+ inst.destroy = destroy;
3959
+ hook.memoizedState = pushResourceEffect(
3960
+ HasEffect | hookFlags,
3961
+ hookFlags,
3962
+ inst,
3963
+ create,
3964
+ createDeps,
3965
+ update,
3966
+ updateDeps
3967
+ );
3968
+ } else
3969
+ (hookFlags = Passive),
3970
+ (hook = mountWorkInProgressHook()),
3971
+ (currentlyRenderingFiber$1.flags |= 8390656),
3972
+ (inst = createEffectInstance()),
3973
+ (inst.destroy = destroy),
3974
+ (hook.memoizedState = pushResourceEffect(
3975
+ HasEffect | hookFlags,
3976
+ hookFlags,
3977
+ inst,
3936
3978
create,
3937
3979
createDeps,
3938
3980
update,
3939
- updateDeps,
3940
- destroy
3941
- );
3942
- }
3943
- function mountResourceEffectImpl(
3944
- fiberFlags,
3945
- hookFlags,
3946
- create,
3947
- createDeps,
3948
- update,
3949
- updateDeps,
3950
- destroy
3951
- ) {
3952
- var hook = mountWorkInProgressHook();
3953
- currentlyRenderingFiber$1.flags |= fiberFlags;
3954
- fiberFlags = createEffectInstance();
3955
- fiberFlags.destroy = destroy;
3956
- hook.memoizedState = pushEffectImpl({
3957
- resourceKind: ResourceEffectIdentityKind,
3958
- tag: HasEffect | hookFlags,
3959
- create: create,
3960
- deps: createDeps,
3961
- inst: fiberFlags,
3962
- next: null
3963
- });
3964
- hook.memoizedState = pushEffectImpl({
3965
- resourceKind: ResourceEffectUpdateKind,
3966
- tag: hookFlags,
3967
- update: update,
3968
- deps: updateDeps,
3969
- inst: fiberFlags,
3970
- next: null
3971
- });
3981
+ updateDeps
3982
+ ));
3972
3983
}
3973
3984
function updateResourceEffectImpl(
3974
3985
fiberFlags,
@@ -3984,45 +3995,45 @@ __DEV__ &&
3984
3995
inst.destroy = destroy;
3985
3996
createDeps = void 0 === createDeps ? null : createDeps;
3986
3997
updateDeps = void 0 === updateDeps ? null : updateDeps;
3987
- var isUpdateDepsSame;
3988
3998
if (null !== currentHook) {
3989
3999
destroy = currentHook.memoizedState;
3990
4000
if (null !== createDeps) {
3991
- if (destroy.resourceKind === ResourceEffectUpdateKind)
4001
+ if (
4002
+ null != destroy.resourceKind &&
4003
+ destroy.resourceKind === ResourceEffectUpdateKind
4004
+ )
3992
4005
var isCreateDepsSame =
3993
- null != destroy.next .deps ? destroy.next .deps : null;
4006
+ null != destroy.identity .deps ? destroy.identity .deps : null;
3994
4007
else
3995
- error$jscomp$0(
3996
- "Expected a ResourceEffectUpdateKind to be pushed together with ResourceEffectIdentityKind, got %s. This is a bug in React.",
3997
- destroy.resourceKind
3998
- ),
3999
- (isCreateDepsSame = null != destroy.deps ? destroy.deps : null);
4008
+ throw Error(
4009
+ "Expected a ResourceEffectUpdate to be pushed together with ResourceEffectIdentity. This is a bug in React."
4010
+ );
4000
4011
isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame);
4001
4012
}
4002
- null !== updateDeps &&
4003
- (isUpdateDepsSame = areHookInputsEqual(
4004
- updateDeps,
4005
- null != destroy.deps ? destroy.deps : null
4006
- ));
4013
+ if (null !== updateDeps) {
4014
+ if (
4015
+ null != destroy.resourceKind &&
4016
+ destroy.resourceKind === ResourceEffectUpdateKind
4017
+ )
4018
+ var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null;
4019
+ else
4020
+ throw Error(
4021
+ "Expected a ResourceEffectUpdate to be pushed together with ResourceEffectIdentity. This is a bug in React."
4022
+ );
4023
+ isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame);
4024
+ }
4007
4025
}
4008
4026
(isCreateDepsSame && isUpdateDepsSame) ||
4009
4027
(currentlyRenderingFiber$1.flags |= fiberFlags);
4010
- hook.memoizedState = pushEffectImpl({
4011
- resourceKind: ResourceEffectIdentityKind,
4012
- tag: isCreateDepsSame ? hookFlags : HasEffect | hookFlags,
4013
- create: create,
4014
- deps: createDeps,
4015
- inst: inst,
4016
- next: null
4017
- });
4018
- hook.memoizedState = pushEffectImpl({
4019
- resourceKind: ResourceEffectUpdateKind,
4020
- tag: isUpdateDepsSame ? hookFlags : HasEffect | hookFlags,
4021
- update: update,
4022
- deps: updateDeps,
4023
- inst: inst,
4024
- next: null
4025
- });
4028
+ hook.memoizedState = pushResourceEffect(
4029
+ isCreateDepsSame ? hookFlags : HasEffect | hookFlags,
4030
+ isUpdateDepsSame ? hookFlags : HasEffect | hookFlags,
4031
+ inst,
4032
+ create,
4033
+ createDeps,
4034
+ update,
4035
+ updateDeps
4036
+ );
4026
4037
}
4027
4038
function useEffectEventImpl(payload) {
4028
4039
currentlyRenderingFiber$1.flags |= 4;
@@ -17114,11 +17125,11 @@ __DEV__ &&
17114
17125
(function () {
17115
17126
var internals = {
17116
17127
bundleType: 1,
17117
- version: "19.0.0-www-classic-7558ffe8-20241119 ",
17128
+ version: "19.0.0-www-classic-c11c9510-20241120 ",
17118
17129
rendererPackageName: "react-art",
17119
17130
currentDispatcherRef: ReactSharedInternals,
17120
17131
findFiberByHostInstance: getInstanceFromNode,
17121
- reconcilerVersion: "19.0.0-www-classic-7558ffe8-20241119 "
17132
+ reconcilerVersion: "19.0.0-www-classic-c11c9510-20241120 "
17122
17133
};
17123
17134
internals.overrideHookState = overrideHookState;
17124
17135
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -17152,7 +17163,7 @@ __DEV__ &&
17152
17163
exports.Shape = Shape;
17153
17164
exports.Surface = Surface;
17154
17165
exports.Text = Text;
17155
- exports.version = "19.0.0-www-classic-7558ffe8-20241119 ";
17166
+ exports.version = "19.0.0-www-classic-c11c9510-20241120 ";
17156
17167
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
17157
17168
"function" ===
17158
17169
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
0 commit comments