Skip to content

Commit

Permalink
Implements wiring for Flight to have it's own "HostConfig" (#26590)
Browse files Browse the repository at this point in the history
Part of #26571

Implements wiring for Flight to have it's own "HostConfig" from Fizz.

Historically the ServerFormatConfigs were supposed to be generic enough
to be used by Fizz and Flight. However with the addition of features
like Float the configs have evolved to be more specific to the renderer.
We may want to get back to a place where there is a pure FormatConfig
which can be shared but for now we are embracing the fact that these
runtimes need very different things and DCE cannot adequately remove the
unused stuff for Fizz when pulling this dep into Flight so we are going
to fork the configs and just maintain separate ones.

At first the Flight config will be almost empty but once Float support
in Flight lands it will have a more complex implementation

Additionally this commit normalizes the component files which make up
FlightServerConfig and FlightClientConfig. Now each file that
participates starts with ReactFlightServerConfig... and
ReactFlightClientConfig...

DiffTrain build for [f4f873f](f4f873f)
  • Loading branch information
gnoff committed Apr 10, 2023
1 parent c608eda commit 6e3e2fd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fec97ecbc4bc2e0e1407160289a8f5fac5241cbc
f4f873f6282e6f2e584990c00fb2aae86db85a8b
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ function getIteratorFn(maybeIterable) {
return null;
}

// Re-export dynamic flags from the www version.
require("ReactFeatureFlags");

var rendererSigil;

{
Expand Down Expand Up @@ -400,6 +397,9 @@ function readContext$1(context) {
return value;
}

// Re-export dynamic flags from the www version.
require("ReactFeatureFlags");

// Corresponds to ReactFiberWakeable and ReactFizzWakeable modules. Generally,
// changes to one module should be reflected in the others.
// TODO: Rename this module and the corresponding Fiber one to "Thenable"
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactFlightDOMRelayServer-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ function getIteratorFn(maybeIterable) {
return null;
}

// Re-export dynamic flags from the www version.
require("ReactFeatureFlags");

var rendererSigil;

{
Expand Down Expand Up @@ -400,6 +397,9 @@ function readContext$1(context) {
return value;
}

// Re-export dynamic flags from the www version.
require("ReactFeatureFlags");

// Corresponds to ReactFiberWakeable and ReactFizzWakeable modules. Generally,
// changes to one module should be reflected in the others.
// TODO: Rename this module and the corresponding Fiber one to "Thenable"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
"react.default_value"
),
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
require("ReactFeatureFlags");
var currentActiveSnapshot = null;
MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
currentActiveSnapshot = null;
function popToNearestCommonAncestor(prev, next) {
if (prev !== next) {
prev.context._currentValue = prev.parentValue;
Expand Down Expand Up @@ -142,6 +141,7 @@ function pushProvider(context, nextValue) {
value: nextValue
});
}
require("ReactFeatureFlags");
var SuspenseException = Error(
"Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
"react.default_value"
),
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
require("ReactFeatureFlags");
var currentActiveSnapshot = null;
MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
currentActiveSnapshot = null;
function popToNearestCommonAncestor(prev, next) {
if (prev !== next) {
prev.context._currentValue = prev.parentValue;
Expand Down Expand Up @@ -142,6 +141,7 @@ function pushProvider(context, nextValue) {
value: nextValue
});
}
require("ReactFeatureFlags");
var SuspenseException = Error(
"Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`"
);
Expand Down

0 comments on commit 6e3e2fd

Please sign in to comment.