Skip to content

Commit

Permalink
[Flight] Allow custom encoding of the form action (#27563)
Browse files Browse the repository at this point in the history
There are three parts to an RSC set up:

- React
- Bundler
- Endpoints

Most customizability is in the bundler configs. We deal with those as
custom builds.

To create a full set up, you need to also configure ways to expose end
points for example to call a Server Action. That's typically not
something the bundler is responsible for even though it's responsible
for gathering the end points that needs generation. Exposing which
endpoints to generate is a responsibility for the bundler.

Typically a meta-framework is responsible for generating the end points.

There's two ways to "call" a Server Action. Through JS and through a
Form. Through JS we expose the `callServer` callback so that the
framework can call the end point.

Forms by default POST back to the current page with an action serialized
into form data, which we have a decoder helper for. However, this is not
something that React is really opinionated about just like we're not
opinionated about the protocol used by callServer.

This exposes an option to configure the encoding of the form props.
`encodeFormAction` is to the SSR is what `callServer` is to the Browser.

DiffTrain build for commit 8d48183.
  • Loading branch information
sebmarkbage committed Feb 13, 2024
1 parent ac5a55d commit acbbf4e
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25917,7 +25917,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-canary-7a32d718b-20240212";
var ReactVersion = "18.3.0-canary-8d4818329-20240212";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9167,7 +9167,7 @@ var devToolsConfig$jscomp$inline_1025 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-7a32d718b-20240212",
version: "18.3.0-canary-8d4818329-20240212",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1206 = {
Expand Down Expand Up @@ -9198,7 +9198,7 @@ var internals$jscomp$inline_1206 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-7a32d718b-20240212"
reconcilerVersion: "18.3.0-canary-8d4818329-20240212"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1207 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9595,7 +9595,7 @@ var devToolsConfig$jscomp$inline_1067 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-7a32d718b-20240212",
version: "18.3.0-canary-8d4818329-20240212",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1247 = {
Expand Down Expand Up @@ -9626,7 +9626,7 @@ var internals$jscomp$inline_1247 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-7a32d718b-20240212"
reconcilerVersion: "18.3.0-canary-8d4818329-20240212"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1248 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-canary-7a32d718b-20240212";
var ReactVersion = "18.3.0-canary-8d4818329-20240212";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,4 +590,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-7a32d718b-20240212";
exports.version = "18.3.0-canary-8d4818329-20240212";
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-7a32d718b-20240212";
exports.version = "18.3.0-canary-8d4818329-20240212";
"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
@@ -1 +1 @@
7a32d718b9ea0eb9ea86e9d21d56a5af6c4ce9ed
8d48183291870898ec42ac1f84482d9d26789424

0 comments on commit acbbf4e

Please sign in to comment.