Skip to content

Commit ee2f852

Browse files
[compiler][rfc] Hacky retry pipeline for fire (facebook#32164)
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)
1 parent aa102d1 commit ee2f852

27 files changed

+5500
-5311
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.1.0-native-fb-0bf1f39e-20250110
1+
19.1.0-native-fb-152bfe37-20250131

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<b57d260398996604ce144f77869f967c>>
10+
* @generated SignedSource<<e65e27c285e286a4414394e196ebba85>>
1111
*/
1212

1313
"use strict";
@@ -23,12 +23,17 @@ __DEV__ &&
2323
_key2++
2424
)
2525
args[_key2 - 1] = arguments[_key2];
26-
_len2 = format;
27-
ReactSharedInternals.getCurrentStack &&
28-
((_key2 = ReactSharedInternals.getCurrentStack()),
29-
"" !== _key2 && ((_len2 += "%s"), (args = args.concat([_key2]))));
30-
args.unshift(_len2);
31-
Function.prototype.apply.call(console.error, console, args);
26+
if (enableRemoveConsolePatches) {
27+
var _console2;
28+
(_console2 = console).error.apply(_console2, [format].concat(args));
29+
} else
30+
(_len2 = format),
31+
enableRemoveConsolePatches ||
32+
(ReactSharedInternals.getCurrentStack &&
33+
((_key2 = ReactSharedInternals.getCurrentStack()),
34+
"" !== _key2 && ((_len2 += "%s"), (args = args.concat([_key2])))),
35+
args.unshift(_len2),
36+
Function.prototype.apply.call(console.error, console, args));
3237
}
3338
function testStringCoercion(value) {
3439
return "" + value;
@@ -96,6 +101,7 @@ __DEV__ &&
96101
return dispatcher;
97102
}
98103
var React = require("react"),
104+
dynamicFlagsUntyped = require("ReactNativeInternalFeatureFlags"),
99105
Internals = {
100106
d: {
101107
f: noop,
@@ -117,6 +123,8 @@ __DEV__ &&
117123
},
118124
ReactSharedInternals =
119125
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
126+
enableRemoveConsolePatches =
127+
dynamicFlagsUntyped && dynamicFlagsUntyped.enableRemoveConsolePatches,
120128
REACT_PORTAL_TYPE = Symbol.for("react.portal");
121129
("function" === typeof Map &&
122130
null != Map.prototype &&
@@ -420,5 +428,5 @@ __DEV__ &&
420428
exports.useFormStatus = function () {
421429
return resolveDispatcher().useHostTransitionStatus();
422430
};
423-
exports.version = "19.1.0-native-fb-0bf1f39e-20250110";
431+
exports.version = "19.1.0-native-fb-152bfe37-20250131";
424432
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<d68d8f9b1bea78f147f97a6fc1d03018>>
10+
* @generated SignedSource<<cb2932bc6701a2e5317ce3baf8fda071>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.1.0-native-fb-0bf1f39e-20250110";
206+
exports.version = "19.1.0-native-fb-152bfe37-20250131";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<d68d8f9b1bea78f147f97a6fc1d03018>>
10+
* @generated SignedSource<<cb2932bc6701a2e5317ce3baf8fda071>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.1.0-native-fb-0bf1f39e-20250110";
206+
exports.version = "19.1.0-native-fb-152bfe37-20250131";

0 commit comments

Comments
 (0)