Skip to content

Commit 5d3ec2c

Browse files
committed
Implements wiring for Flight to have it's own "HostConfig" (#26590)
Part of facebook/react#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 [f4f873f6282e6f2e584990c00fb2aae86db85a8b](facebook/react@f4f873f)
1 parent 0bafd81 commit 5d3ec2c

5 files changed

+13
-13
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fec97ecbc4bc2e0e1407160289a8f5fac5241cbc
1+
f4f873f6282e6f2e584990c00fb2aae86db85a8b

compiled/facebook-www/ReactFlightDOMRelayServer-dev.classic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ function getIteratorFn(maybeIterable) {
189189
return null;
190190
}
191191

192-
// Re-export dynamic flags from the www version.
193-
require("ReactFeatureFlags");
194-
195192
var rendererSigil;
196193

197194
{
@@ -400,6 +397,9 @@ function readContext$1(context) {
400397
return value;
401398
}
402399

400+
// Re-export dynamic flags from the www version.
401+
require("ReactFeatureFlags");
402+
403403
// Corresponds to ReactFiberWakeable and ReactFizzWakeable modules. Generally,
404404
// changes to one module should be reflected in the others.
405405
// TODO: Rename this module and the corresponding Fiber one to "Thenable"

compiled/facebook-www/ReactFlightDOMRelayServer-dev.modern.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ function getIteratorFn(maybeIterable) {
189189
return null;
190190
}
191191

192-
// Re-export dynamic flags from the www version.
193-
require("ReactFeatureFlags");
194-
195192
var rendererSigil;
196193

197194
{
@@ -400,6 +397,9 @@ function readContext$1(context) {
400397
return value;
401398
}
402399

400+
// Re-export dynamic flags from the www version.
401+
require("ReactFeatureFlags");
402+
403403
// Corresponds to ReactFiberWakeable and ReactFizzWakeable modules. Generally,
404404
// changes to one module should be reflected in the others.
405405
// TODO: Rename this module and the corresponding Fiber one to "Thenable"

compiled/facebook-www/ReactFlightDOMRelayServer-prod.classic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
6060
"react.default_value"
6161
),
6262
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
63-
MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
64-
require("ReactFeatureFlags");
65-
var currentActiveSnapshot = null;
63+
MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
64+
currentActiveSnapshot = null;
6665
function popToNearestCommonAncestor(prev, next) {
6766
if (prev !== next) {
6867
prev.context._currentValue = prev.parentValue;
@@ -142,6 +141,7 @@ function pushProvider(context, nextValue) {
142141
value: nextValue
143142
});
144143
}
144+
require("ReactFeatureFlags");
145145
var SuspenseException = Error(
146146
"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`"
147147
);

compiled/facebook-www/ReactFlightDOMRelayServer-prod.modern.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
6060
"react.default_value"
6161
),
6262
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
63-
MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
64-
require("ReactFeatureFlags");
65-
var currentActiveSnapshot = null;
63+
MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
64+
currentActiveSnapshot = null;
6665
function popToNearestCommonAncestor(prev, next) {
6766
if (prev !== next) {
6867
prev.context._currentValue = prev.parentValue;
@@ -142,6 +141,7 @@ function pushProvider(context, nextValue) {
142141
value: nextValue
143142
});
144143
}
144+
require("ReactFeatureFlags");
145145
var SuspenseException = Error(
146146
"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`"
147147
);

0 commit comments

Comments
 (0)