Skip to content

Commit fc1c5a2

Browse files
committed
[compiler] Don't include useEffectEvent values in autodeps (#33450)
Summary: useEffectEvent values are not meant to be added to the dep array DiffTrain build for [4df098c](4df098c)
1 parent 42b6956 commit fc1c5a2

35 files changed

+117
-87
lines changed

compiled/eslint-plugin-react-hooks/index.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17853,6 +17853,10 @@ function isDispatcherType(id) {
1785317853
function isFireFunctionType(id) {
1785417854
return (id.type.kind === 'Function' && id.type.shapeId === 'BuiltInFireFunction');
1785517855
}
17856+
function isEffectEventFunctionType(id) {
17857+
return (id.type.kind === 'Function' &&
17858+
id.type.shapeId === 'BuiltInEffectEventFunction');
17859+
}
1785617860
function isStableType(id) {
1785717861
return (isSetStateType(id) ||
1785817862
isSetActionStateType(id) ||
@@ -29656,6 +29660,8 @@ const BuiltInUseTransitionId = 'BuiltInUseTransition';
2965629660
const BuiltInStartTransitionId = 'BuiltInStartTransition';
2965729661
const BuiltInFireId = 'BuiltInFire';
2965829662
const BuiltInFireFunctionId = 'BuiltInFireFunction';
29663+
const BuiltInUseEffectEventId = 'BuiltInUseEffectEvent';
29664+
const BuiltinEffectEventId = 'BuiltInEffectEventFunction';
2965929665
const ReanimatedSharedValueId = 'ReanimatedSharedValueId';
2966029666
const BUILTIN_SHAPES = new Map();
2966129667
addObject(BUILTIN_SHAPES, BuiltInPropsId, [
@@ -30208,6 +30214,13 @@ addObject(BUILTIN_SHAPES, BuiltInUseRefId, [
3020830214
addObject(BUILTIN_SHAPES, BuiltInRefValueId, [
3020930215
['*', { kind: 'Object', shapeId: BuiltInRefValueId }],
3021030216
]);
30217+
addFunction(BUILTIN_SHAPES, [], {
30218+
positionalParams: [],
30219+
restParam: Effect.ConditionallyMutate,
30220+
returnType: { kind: 'Poly' },
30221+
calleeEffect: Effect.ConditionallyMutate,
30222+
returnValueKind: ValueKind.Mutable,
30223+
}, BuiltinEffectEventId);
3021130224
addObject(BUILTIN_SHAPES, BuiltInMixedReadonlyId, [
3021230225
[
3021330226
'toString',
@@ -38272,6 +38285,22 @@ const REACT_APIS = [
3827238285
returnValueKind: ValueKind.Frozen,
3827338286
}, BuiltInFireId),
3827438287
],
38288+
[
38289+
'useEffectEvent',
38290+
addHook(DEFAULT_SHAPES, {
38291+
positionalParams: [],
38292+
restParam: Effect.Freeze,
38293+
returnType: {
38294+
kind: 'Function',
38295+
return: { kind: 'Poly' },
38296+
shapeId: BuiltinEffectEventId,
38297+
isConstructor: false,
38298+
},
38299+
calleeEffect: Effect.Read,
38300+
hookKind: 'useEffectEvent',
38301+
returnValueKind: ValueKind.Frozen,
38302+
}, BuiltInUseEffectEventId),
38303+
],
3827538304
];
3827638305
TYPED_GLOBALS.push([
3827738306
'React',
@@ -51176,7 +51205,8 @@ function inferEffectDependencies(fn) {
5117651205
if (((isUseRefType(maybeDep.identifier) ||
5117751206
isSetStateType(maybeDep.identifier)) &&
5117851207
!reactiveIds.has(maybeDep.identifier.id)) ||
51179-
isFireFunctionType(maybeDep.identifier)) {
51208+
isFireFunctionType(maybeDep.identifier) ||
51209+
isEffectEventFunctionType(maybeDep.identifier)) {
5118051210
continue;
5118151211
}
5118251212
const dep = truncateDepAtCurrent(maybeDep);

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b3d5e9078685c000e7e9ee3668a7a4b4f3256b1f
1+
4df098c4c2c51a033592ebc84abc47cc49a6bfb2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b3d5e9078685c000e7e9ee3668a7a4b4f3256b1f
1+
4df098c4c2c51a033592ebc84abc47cc49a6bfb2

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ __DEV__ &&
15371537
exports.useTransition = function () {
15381538
return resolveDispatcher().useTransition();
15391539
};
1540-
exports.version = "19.2.0-www-classic-b3d5e907-20250607";
1540+
exports.version = "19.2.0-www-classic-4df098c4-20250609";
15411541
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15421542
"function" ===
15431543
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ __DEV__ &&
15371537
exports.useTransition = function () {
15381538
return resolveDispatcher().useTransition();
15391539
};
1540-
exports.version = "19.2.0-www-modern-b3d5e907-20250607";
1540+
exports.version = "19.2.0-www-modern-4df098c4-20250609";
15411541
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15421542
"function" ===
15431543
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,4 +635,4 @@ exports.useSyncExternalStore = function (
635635
exports.useTransition = function () {
636636
return ReactSharedInternals.H.useTransition();
637637
};
638-
exports.version = "19.2.0-www-classic-b3d5e907-20250607";
638+
exports.version = "19.2.0-www-classic-4df098c4-20250609";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,4 +635,4 @@ exports.useSyncExternalStore = function (
635635
exports.useTransition = function () {
636636
return ReactSharedInternals.H.useTransition();
637637
};
638-
exports.version = "19.2.0-www-modern-b3d5e907-20250607";
638+
exports.version = "19.2.0-www-modern-4df098c4-20250609";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ exports.useSyncExternalStore = function (
639639
exports.useTransition = function () {
640640
return ReactSharedInternals.H.useTransition();
641641
};
642-
exports.version = "19.2.0-www-classic-b3d5e907-20250607";
642+
exports.version = "19.2.0-www-classic-4df098c4-20250609";
643643
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
644644
"function" ===
645645
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ exports.useSyncExternalStore = function (
639639
exports.useTransition = function () {
640640
return ReactSharedInternals.H.useTransition();
641641
};
642-
exports.version = "19.2.0-www-modern-b3d5e907-20250607";
642+
exports.version = "19.2.0-www-modern-4df098c4-20250609";
643643
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
644644
"function" ===
645645
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19105,10 +19105,10 @@ __DEV__ &&
1910519105
(function () {
1910619106
var internals = {
1910719107
bundleType: 1,
19108-
version: "19.2.0-www-classic-b3d5e907-20250607",
19108+
version: "19.2.0-www-classic-4df098c4-20250609",
1910919109
rendererPackageName: "react-art",
1911019110
currentDispatcherRef: ReactSharedInternals,
19111-
reconcilerVersion: "19.2.0-www-classic-b3d5e907-20250607"
19111+
reconcilerVersion: "19.2.0-www-classic-4df098c4-20250609"
1911219112
};
1911319113
internals.overrideHookState = overrideHookState;
1911419114
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -19142,7 +19142,7 @@ __DEV__ &&
1914219142
exports.Shape = Shape;
1914319143
exports.Surface = Surface;
1914419144
exports.Text = Text;
19145-
exports.version = "19.2.0-www-classic-b3d5e907-20250607";
19145+
exports.version = "19.2.0-www-classic-4df098c4-20250609";
1914619146
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1914719147
"function" ===
1914819148
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)