Skip to content

Commit

Permalink
[compiler][rfc] Hacky retry pipeline for fire (facebook#32164)
Browse files Browse the repository at this point in the history
Hacky retry pipeline for when transforming `fire(...)` calls encounters
validation, todo, or memoization invariant bailouts. Would love feedback
on how we implement this to be extensible to other compiler
non-memoization features (e.g. inlineJSX)

Some observations:
- Compiler "front-end" passes (e.g. lower, type, effect, and mutability
inferences) should be shared for all compiler features -- memo and
otherwise
- Many passes (anything dealing with reactive scope ranges, scope blocks
/ dependencies, and optimizations such as ReactiveIR facebook#31974) can be left
out of the retry pipeline. This PR hackily skips memoization features by
removing reactive scope creation, but we probably should restructure the
pipeline to skip these entirely on a retry
- We should maintain a canonical set of "validation flags"

Note the newly added fixtures are prefixed with `bailout-...` when the
retry fire pipeline is used. These fixture outputs contain correctly
inserted `useFire` calls and no memoization.

DiffTrain build for [152bfe3](facebook@152bfe3)
  • Loading branch information
pull[bot] committed Feb 1, 2025
1 parent 674c6c7 commit d2699eb
Show file tree
Hide file tree
Showing 23 changed files with 86 additions and 122 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.1.0-native-fb-9ff42a87-20250130
19.1.0-native-fb-152bfe37-20250131
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<5e1b815567d096b454e9eaae7bb92825>>
* @generated SignedSource<<e65e27c285e286a4414394e196ebba85>>
*/

"use strict";
Expand Down Expand Up @@ -428,5 +428,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-152bfe37-20250131";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d5327429716017e10daecdc6cd67386c>>
* @generated SignedSource<<cb2932bc6701a2e5317ce3baf8fda071>>
*/

"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.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-152bfe37-20250131";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d5327429716017e10daecdc6cd67386c>>
* @generated SignedSource<<cb2932bc6701a2e5317ce3baf8fda071>>
*/

"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.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-152bfe37-20250131";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<6662cbbb9dbf8b7957351e4fb057887e>>
* @generated SignedSource<<f92d2c65f8cd646b7740fc201380b634>>
*/

/*
Expand Down Expand Up @@ -12422,9 +12422,6 @@ __DEV__ &&
hostParentIsContainer = !1;
break a;
case 3:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
break a;
case 4:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
Expand Down Expand Up @@ -25997,11 +25994,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-native-fb-9ff42a87-20250130" !== isomorphicReactPackageVersion)
if ("19.1.0-native-fb-152bfe37-20250131" !== 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.1.0-native-fb-9ff42a87-20250130\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-native-fb-152bfe37-20250131\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -26038,10 +26035,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-native-fb-9ff42a87-20250130",
version: "19.1.0-native-fb-152bfe37-20250131",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-9ff42a87-20250130"
reconcilerVersion: "19.1.0-native-fb-152bfe37-20250131"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -26187,5 +26184,5 @@ __DEV__ &&
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-152bfe37-20250131";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<cb67a2004533893952c24f6345d8b51f>>
* @generated SignedSource<<569486287d32cb91b6a2105eaf17147e>>
*/

/*
Expand Down Expand Up @@ -8674,9 +8674,6 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
hostParentIsContainer = !1;
break a;
case 3:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
break a;
case 4:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
Expand Down Expand Up @@ -16003,14 +16000,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1786 = React.version;
if (
"19.1.0-native-fb-9ff42a87-20250130" !==
"19.1.0-native-fb-152bfe37-20250131" !==
isomorphicReactPackageVersion$jscomp$inline_1786
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1786,
"19.1.0-native-fb-9ff42a87-20250130"
"19.1.0-native-fb-152bfe37-20250131"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16032,10 +16029,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2242 = {
bundleType: 0,
version: "19.1.0-native-fb-9ff42a87-20250130",
version: "19.1.0-native-fb-152bfe37-20250131",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-9ff42a87-20250130"
reconcilerVersion: "19.1.0-native-fb-152bfe37-20250131"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2243 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16141,4 +16138,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-152bfe37-20250131";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<2123504bcc671c29af3c759339d03e87>>
* @generated SignedSource<<d1a47f5338792b00471d816d5934a3ad>>
*/

/*
Expand Down Expand Up @@ -9068,9 +9068,6 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
hostParentIsContainer = !1;
break a;
case 3:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
break a;
case 4:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
Expand Down Expand Up @@ -16652,14 +16649,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1881 = React.version;
if (
"19.1.0-native-fb-9ff42a87-20250130" !==
"19.1.0-native-fb-152bfe37-20250131" !==
isomorphicReactPackageVersion$jscomp$inline_1881
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1881,
"19.1.0-native-fb-9ff42a87-20250130"
"19.1.0-native-fb-152bfe37-20250131"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16681,10 +16678,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1888 = {
bundleType: 0,
version: "19.1.0-native-fb-9ff42a87-20250130",
version: "19.1.0-native-fb-152bfe37-20250131",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-9ff42a87-20250130",
reconcilerVersion: "19.1.0-native-fb-152bfe37-20250131",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$294 = 0;
Expand Down Expand Up @@ -16805,4 +16802,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-152bfe37-20250131";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<6808ed37fdae0dd8f12efd685843d77e>>
* @generated SignedSource<<5898b742b5121a59ae6a197da3788925>>
*/

/*
Expand Down Expand Up @@ -12430,9 +12430,6 @@ __DEV__ &&
hostParentIsContainer = !1;
break a;
case 3:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
break a;
case 4:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
Expand Down Expand Up @@ -26058,11 +26055,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-native-fb-9ff42a87-20250130" !== isomorphicReactPackageVersion)
if ("19.1.0-native-fb-152bfe37-20250131" !== 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.1.0-native-fb-9ff42a87-20250130\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-native-fb-152bfe37-20250131\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -26099,10 +26096,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-native-fb-9ff42a87-20250130",
version: "19.1.0-native-fb-152bfe37-20250131",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-9ff42a87-20250130"
reconcilerVersion: "19.1.0-native-fb-152bfe37-20250131"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -26564,7 +26561,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-152bfe37-20250131";
"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<<7a5ee1c7dad1a60917fc01b90d6789e6>>
* @generated SignedSource<<8aa47790f7ae6dcec042790f1daac7d1>>
*/

/*
Expand Down Expand Up @@ -8674,9 +8674,6 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
hostParentIsContainer = !1;
break a;
case 3:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
break a;
case 4:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
Expand Down Expand Up @@ -16014,14 +16011,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1787 = React.version;
if (
"19.1.0-native-fb-9ff42a87-20250130" !==
"19.1.0-native-fb-152bfe37-20250131" !==
isomorphicReactPackageVersion$jscomp$inline_1787
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1787,
"19.1.0-native-fb-9ff42a87-20250130"
"19.1.0-native-fb-152bfe37-20250131"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16043,10 +16040,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2245 = {
bundleType: 0,
version: "19.1.0-native-fb-9ff42a87-20250130",
version: "19.1.0-native-fb-152bfe37-20250131",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-9ff42a87-20250130"
reconcilerVersion: "19.1.0-native-fb-152bfe37-20250131"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2246 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16306,4 +16303,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-152bfe37-20250131";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<630c89c1f2bf8d4a15b8b91c28856a08>>
* @generated SignedSource<<dcdd6f0893860771b121687d78b2d802>>
*/

/*
Expand Down Expand Up @@ -9072,9 +9072,6 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
hostParentIsContainer = !1;
break a;
case 3:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
break a;
case 4:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
Expand Down Expand Up @@ -16667,14 +16664,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1882 = React.version;
if (
"19.1.0-native-fb-9ff42a87-20250130" !==
"19.1.0-native-fb-152bfe37-20250131" !==
isomorphicReactPackageVersion$jscomp$inline_1882
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1882,
"19.1.0-native-fb-9ff42a87-20250130"
"19.1.0-native-fb-152bfe37-20250131"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16696,10 +16693,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1889 = {
bundleType: 0,
version: "19.1.0-native-fb-9ff42a87-20250130",
version: "19.1.0-native-fb-152bfe37-20250131",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-9ff42a87-20250130",
reconcilerVersion: "19.1.0-native-fb-152bfe37-20250131",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$294 = 0;
Expand Down Expand Up @@ -16974,7 +16971,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-152bfe37-20250131";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit d2699eb

Please sign in to comment.