Skip to content

Commit 1cff685

Browse files
committed
[Flight] Unify plain Server Component and forwardRef under one function (#28261)
This used to be trivial but it's no longer trivial. In Fizz and Fiber this is split into renderWithHooks and finishFunctionComponent since they also support indeterminate components. Interestingly thanks to this unification we always call functions with an arity of 2 which is a bit weird - with the second argument being undefined in everything except forwardRef and legacy context consumers. This makes Flight makes the same thing but we could also call it with an arity of 1. Since Flight errors early if you try to pass it a ref, and there's no legacy context, the second arg is always undefined. The practical change in this PR is that returning a Promise from a forwardRef now turns it into a lazy. We previously didn't support async forwardRef since it wasn't supported on the client. However, since eventually this will be supported by child-as-a-promise it seems fine to support it. DiffTrain build for commit f07ac1e.
1 parent 571a247 commit 1cff685

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25725,7 +25725,7 @@ if (__DEV__) {
2572525725
return root;
2572625726
}
2572725727

25728-
var ReactVersion = "18.3.0-canary-1beb94133-20240206";
25728+
var ReactVersion = "18.3.0-canary-f07ac1e26-20240206";
2572925729

2573025730
// Might add PROFILE later.
2573125731

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9157,7 +9157,7 @@ var devToolsConfig$jscomp$inline_1012 = {
91579157
throw Error("TestRenderer does not support findFiberByHostInstance()");
91589158
},
91599159
bundleType: 0,
9160-
version: "18.3.0-canary-1beb94133-20240206",
9160+
version: "18.3.0-canary-f07ac1e26-20240206",
91619161
rendererPackageName: "react-test-renderer"
91629162
};
91639163
var internals$jscomp$inline_1190 = {
@@ -9188,7 +9188,7 @@ var internals$jscomp$inline_1190 = {
91889188
scheduleRoot: null,
91899189
setRefreshHandler: null,
91909190
getCurrentFiber: null,
9191-
reconcilerVersion: "18.3.0-canary-1beb94133-20240206"
9191+
reconcilerVersion: "18.3.0-canary-f07ac1e26-20240206"
91929192
};
91939193
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
91949194
var hook$jscomp$inline_1191 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9585,7 +9585,7 @@ var devToolsConfig$jscomp$inline_1054 = {
95859585
throw Error("TestRenderer does not support findFiberByHostInstance()");
95869586
},
95879587
bundleType: 0,
9588-
version: "18.3.0-canary-1beb94133-20240206",
9588+
version: "18.3.0-canary-f07ac1e26-20240206",
95899589
rendererPackageName: "react-test-renderer"
95909590
};
95919591
var internals$jscomp$inline_1231 = {
@@ -9616,7 +9616,7 @@ var internals$jscomp$inline_1231 = {
96169616
scheduleRoot: null,
96179617
setRefreshHandler: null,
96189618
getCurrentFiber: null,
9619-
reconcilerVersion: "18.3.0-canary-1beb94133-20240206"
9619+
reconcilerVersion: "18.3.0-canary-f07ac1e26-20240206"
96209620
};
96219621
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
96229622
var hook$jscomp$inline_1232 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-canary-1beb94133-20240206";
27+
var ReactVersion = "18.3.0-canary-f07ac1e26-20240206";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,4 +550,4 @@ exports.useSyncExternalStore = function (
550550
exports.useTransition = function () {
551551
return ReactCurrentDispatcher.current.useTransition();
552552
};
553-
exports.version = "18.3.0-canary-1beb94133-20240206";
553+
exports.version = "18.3.0-canary-f07ac1e26-20240206";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ exports.useSyncExternalStore = function (
546546
exports.useTransition = function () {
547547
return ReactCurrentDispatcher.current.useTransition();
548548
};
549-
exports.version = "18.3.0-canary-1beb94133-20240206";
549+
exports.version = "18.3.0-canary-f07ac1e26-20240206";
550550
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
551551
"function" ===
552552
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1beb94133a93a433669a893aef02dd5afec07394
1+
f07ac1e2680a26c5b3bf9c651d62c792de71d46d

0 commit comments

Comments
 (0)