Skip to content

Commit

Permalink
[compiler] Infer deps configuration (facebook#31616)
Browse files Browse the repository at this point in the history
Adds a way to configure how we insert deps for experimental purposes.

```
[
  {
    module: 'react',
    imported: 'useEffect',
    numRequiredArgs: 1,
  },
  {
    module: 'MyExperimentalEffectHooks',
    imported: 'useExperimentalEffect',
    numRequiredArgs: 2,
  },
]
```

would insert dependencies for calls of `useEffect` imported from `react`
if they have 1 argument and calls of useExperimentalEffect` from
`MyExperimentalEffectHooks` if they have 2 arguments. The pushed dep
array is appended to the arg list.

DiffTrain build for [2a9f4c0](facebook@2a9f4c0)
  • Loading branch information
pull[bot] committed Nov 23, 2024
1 parent a058ee7 commit 9d91828
Show file tree
Hide file tree
Showing 23 changed files with 137 additions and 137 deletions.
2 changes: 1 addition & 1 deletion compiled-rn/VERSION_NATIVE_FB
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19.0.0-native-fb-aba370f1-20241122
19.0.0-native-fb-2a9f4c04-20241122
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<712b04c3a26023e4bea59df930cf674a>>
* @generated SignedSource<<ddd246bb691d4a72856ff58c8e84e9ab>>
*/

"use strict";
Expand Down Expand Up @@ -420,5 +420,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-aba370f1-20241122";
exports.version = "19.0.0-native-fb-2a9f4c04-20241122";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<81c01fe21e27672bef833613e7a3e25c>>
* @generated SignedSource<<6333fffa5ab523cc9687eb23bac28b0b>>
*/

"use strict";
Expand Down Expand Up @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-aba370f1-20241122";
exports.version = "19.0.0-native-fb-2a9f4c04-20241122";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<81c01fe21e27672bef833613e7a3e25c>>
* @generated SignedSource<<6333fffa5ab523cc9687eb23bac28b0b>>
*/

"use strict";
Expand Down Expand Up @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-aba370f1-20241122";
exports.version = "19.0.0-native-fb-2a9f4c04-20241122";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<0d89e6bc8382f0cef2e9d75790b40d5e>>
* @generated SignedSource<<1e98b76270c22a71e1c2d5a81da0dba0>>
*/

/*
Expand Down Expand Up @@ -25768,11 +25768,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-native-fb-aba370f1-20241122" !== isomorphicReactPackageVersion)
if ("19.0.0-native-fb-2a9f4c04-20241122" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-native-fb-aba370f1-20241122\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-native-fb-2a9f4c04-20241122\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -25809,11 +25809,11 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-native-fb-aba370f1-20241122",
version: "19.0.0-native-fb-2a9f4c04-20241122",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-aba370f1-20241122"
reconcilerVersion: "19.0.0-native-fb-2a9f4c04-20241122"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -25957,5 +25957,5 @@ __DEV__ &&
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-native-fb-aba370f1-20241122";
exports.version = "19.0.0-native-fb-2a9f4c04-20241122";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<bbe9c9df4aeffbacb96929a845d03786>>
* @generated SignedSource<<58c64b2e053860b621da1479bbbcedc7>>
*/

/*
Expand Down Expand Up @@ -15838,14 +15838,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1735 = React.version;
if (
"19.0.0-native-fb-aba370f1-20241122" !==
"19.0.0-native-fb-2a9f4c04-20241122" !==
isomorphicReactPackageVersion$jscomp$inline_1735
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1735,
"19.0.0-native-fb-aba370f1-20241122"
"19.0.0-native-fb-2a9f4c04-20241122"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -15867,11 +15867,11 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2193 = {
bundleType: 0,
version: "19.0.0-native-fb-aba370f1-20241122",
version: "19.0.0-native-fb-2a9f4c04-20241122",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-aba370f1-20241122"
reconcilerVersion: "19.0.0-native-fb-2a9f4c04-20241122"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2194 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -15975,4 +15975,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-native-fb-aba370f1-20241122";
exports.version = "19.0.0-native-fb-2a9f4c04-20241122";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<4646449a1fbaa134be54e6ac1df8a36f>>
* @generated SignedSource<<9ea983f5caede381e85e1f5ef2f4e939>>
*/

/*
Expand Down Expand Up @@ -16491,14 +16491,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1825 = React.version;
if (
"19.0.0-native-fb-aba370f1-20241122" !==
"19.0.0-native-fb-2a9f4c04-20241122" !==
isomorphicReactPackageVersion$jscomp$inline_1825
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1825,
"19.0.0-native-fb-aba370f1-20241122"
"19.0.0-native-fb-2a9f4c04-20241122"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16520,11 +16520,11 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1832 = {
bundleType: 0,
version: "19.0.0-native-fb-aba370f1-20241122",
version: "19.0.0-native-fb-2a9f4c04-20241122",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-aba370f1-20241122",
reconcilerVersion: "19.0.0-native-fb-2a9f4c04-20241122",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$292 = 0;
Expand Down Expand Up @@ -16643,4 +16643,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-native-fb-aba370f1-20241122";
exports.version = "19.0.0-native-fb-2a9f4c04-20241122";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<fdb540f0caca4805185f18de2b75187e>>
* @generated SignedSource<<eca4f892a960722494d0cd319140c9c5>>
*/

/*
Expand Down Expand Up @@ -25829,11 +25829,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-native-fb-aba370f1-20241122" !== isomorphicReactPackageVersion)
if ("19.0.0-native-fb-2a9f4c04-20241122" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-native-fb-aba370f1-20241122\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-native-fb-2a9f4c04-20241122\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -25870,11 +25870,11 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-native-fb-aba370f1-20241122",
version: "19.0.0-native-fb-2a9f4c04-20241122",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-aba370f1-20241122"
reconcilerVersion: "19.0.0-native-fb-2a9f4c04-20241122"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -26334,7 +26334,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-aba370f1-20241122";
exports.version = "19.0.0-native-fb-2a9f4c04-20241122";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<a8312aba3bffe7b81caa9bbf68d4dfb0>>
* @generated SignedSource<<53977baed22ee43971b1d0f3577105df>>
*/

/*
Expand Down Expand Up @@ -15849,14 +15849,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1736 = React.version;
if (
"19.0.0-native-fb-aba370f1-20241122" !==
"19.0.0-native-fb-2a9f4c04-20241122" !==
isomorphicReactPackageVersion$jscomp$inline_1736
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1736,
"19.0.0-native-fb-aba370f1-20241122"
"19.0.0-native-fb-2a9f4c04-20241122"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -15878,11 +15878,11 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2196 = {
bundleType: 0,
version: "19.0.0-native-fb-aba370f1-20241122",
version: "19.0.0-native-fb-2a9f4c04-20241122",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-aba370f1-20241122"
reconcilerVersion: "19.0.0-native-fb-2a9f4c04-20241122"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2197 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16140,4 +16140,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-aba370f1-20241122";
exports.version = "19.0.0-native-fb-2a9f4c04-20241122";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<86fce667118c0d10a972b2051d4ef079>>
* @generated SignedSource<<28e7d40d420bf23c038e1fb7dafaabb8>>
*/

/*
Expand Down Expand Up @@ -16506,14 +16506,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1826 = React.version;
if (
"19.0.0-native-fb-aba370f1-20241122" !==
"19.0.0-native-fb-2a9f4c04-20241122" !==
isomorphicReactPackageVersion$jscomp$inline_1826
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1826,
"19.0.0-native-fb-aba370f1-20241122"
"19.0.0-native-fb-2a9f4c04-20241122"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16535,11 +16535,11 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1833 = {
bundleType: 0,
version: "19.0.0-native-fb-aba370f1-20241122",
version: "19.0.0-native-fb-2a9f4c04-20241122",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-aba370f1-20241122",
reconcilerVersion: "19.0.0-native-fb-2a9f4c04-20241122",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$292 = 0;
Expand Down Expand Up @@ -16812,7 +16812,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-aba370f1-20241122";
exports.version = "19.0.0-native-fb-2a9f4c04-20241122";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<33022617ec42fdf4f87bd382eb7ea5df>>
* @generated SignedSource<<096ddbd42ce07c23383f6df67ed14e0a>>
*/

"use strict";
Expand Down Expand Up @@ -15552,11 +15552,11 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-native-fb-aba370f1-20241122",
version: "19.0.0-native-fb-2a9f4c04-20241122",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-aba370f1-20241122"
reconcilerVersion: "19.0.0-native-fb-2a9f4c04-20241122"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -15701,5 +15701,5 @@ __DEV__ &&
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.0.0-native-fb-aba370f1-20241122";
exports.version = "19.0.0-native-fb-2a9f4c04-20241122";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<80cfdc1a2704d3397ca947f8b4c0a288>>
* @generated SignedSource<<25731fecf7109528aa5251463dbe96b3>>
*/

"use strict";
Expand Down Expand Up @@ -9715,14 +9715,14 @@ function wrapFiber(fiber) {
}
var internals$jscomp$inline_1390 = {
bundleType: 0,
version: "19.0.0-native-fb-aba370f1-20241122",
version: "19.0.0-native-fb-2a9f4c04-20241122",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: function (mockNode) {
mockNode = nodeToInstanceMap.get(mockNode);
return void 0 !== mockNode ? mockNode.internalInstanceHandle : null;
},
reconcilerVersion: "19.0.0-native-fb-aba370f1-20241122"
reconcilerVersion: "19.0.0-native-fb-2a9f4c04-20241122"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1391 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -9858,4 +9858,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.0.0-native-fb-aba370f1-20241122";
exports.version = "19.0.0-native-fb-2a9f4c04-20241122";
Loading

0 comments on commit 9d91828

Please sign in to comment.