[Flight] Client and Server Reference Creation into Runtime (#27033)

We already did this for Server References on the Client so this brings
us parity with that. This gives us some more flexibility with changing
the runtime implementation without having to affect the loaders.

We can also do more in the runtime such as adding `.bind()` support to
Server References.

I also moved the CommonJS Proxy creation into the runtime helper from
the register so that it can be handled in one place.

This lets us remove the forks from Next.js since the loaders can be
simplified there to just use these helpers.

This PR doesn't change the protocol or shape of the objects. They're
still specific to each bundler but ideally we should probably move this
to shared helpers that can be used by multiple bundler implementations.

DiffTrain build for commit https://github.com/facebook/react/commit/fdc8c81e07e9b3b49604afe524ee6d130fd3e03e.
This commit is contained in:
sebmarkbage
2023-07-07 15:15:30 +00:00
parent 4880e36f1c
commit f8d29c239e
7 changed files with 9 additions and 9 deletions
@@ -23982,7 +23982,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-canary-eb2c2f7c2-20230706";
var ReactVersion = "18.3.0-canary-fdc8c81e0-20230707";
// Might add PROFILE later.
@@ -8630,7 +8630,7 @@ var devToolsConfig$jscomp$inline_1032 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-eb2c2f7c2-20230706",
version: "18.3.0-canary-fdc8c81e0-20230707",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1231 = {
@@ -8661,7 +8661,7 @@ var internals$jscomp$inline_1231 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-eb2c2f7c2-20230706"
reconcilerVersion: "18.3.0-canary-fdc8c81e0-20230707"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1232 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -9056,7 +9056,7 @@ var devToolsConfig$jscomp$inline_1074 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-eb2c2f7c2-20230706",
version: "18.3.0-canary-fdc8c81e0-20230707",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1272 = {
@@ -9087,7 +9087,7 @@ var internals$jscomp$inline_1272 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-eb2c2f7c2-20230706"
reconcilerVersion: "18.3.0-canary-fdc8c81e0-20230707"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1273 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -27,7 +27,7 @@ if (
}
"use strict";
var ReactVersion = "18.3.0-canary-eb2c2f7c2-20230706";
var ReactVersion = "18.3.0-canary-fdc8c81e0-20230707";
// ATTENTION
// When adding new symbols to this file,
@@ -616,4 +616,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-eb2c2f7c2-20230706";
exports.version = "18.3.0-canary-fdc8c81e0-20230707";
@@ -619,7 +619,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-eb2c2f7c2-20230706";
exports.version = "18.3.0-canary-fdc8c81e0-20230707";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
@@ -1 +1 @@
eb2c2f7c2cf2652a168c2b433d2989131c69754b
fdc8c81e07e9b3b49604afe524ee6d130fd3e03e