From 6e3e2fd44ee1568b1bdd9991e8c30742aa648882 Mon Sep 17 00:00:00 2001 From: gnoff Date: Mon, 10 Apr 2023 21:57:51 +0000 Subject: [PATCH] Implements wiring for Flight to have it's own "HostConfig" (#26590) Part of https://github.com/facebook/react/pull/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](https://github.com/facebook/react/commit/f4f873f6282e6f2e584990c00fb2aae86db85a8b) --- compiled/facebook-www/REVISION | 2 +- .../facebook-www/ReactFlightDOMRelayServer-dev.classic.js | 6 +++--- .../facebook-www/ReactFlightDOMRelayServer-dev.modern.js | 6 +++--- .../facebook-www/ReactFlightDOMRelayServer-prod.classic.js | 6 +++--- .../facebook-www/ReactFlightDOMRelayServer-prod.modern.js | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 2c7137467b0d9..8b10ba9221caf 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -fec97ecbc4bc2e0e1407160289a8f5fac5241cbc +f4f873f6282e6f2e584990c00fb2aae86db85a8b diff --git a/compiled/facebook-www/ReactFlightDOMRelayServer-dev.classic.js b/compiled/facebook-www/ReactFlightDOMRelayServer-dev.classic.js index 0116286e4f35d..2a9435b29403e 100644 --- a/compiled/facebook-www/ReactFlightDOMRelayServer-dev.classic.js +++ b/compiled/facebook-www/ReactFlightDOMRelayServer-dev.classic.js @@ -189,9 +189,6 @@ function getIteratorFn(maybeIterable) { return null; } -// Re-export dynamic flags from the www version. -require("ReactFeatureFlags"); - var rendererSigil; { @@ -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" diff --git a/compiled/facebook-www/ReactFlightDOMRelayServer-dev.modern.js b/compiled/facebook-www/ReactFlightDOMRelayServer-dev.modern.js index 0116286e4f35d..2a9435b29403e 100644 --- a/compiled/facebook-www/ReactFlightDOMRelayServer-dev.modern.js +++ b/compiled/facebook-www/ReactFlightDOMRelayServer-dev.modern.js @@ -189,9 +189,6 @@ function getIteratorFn(maybeIterable) { return null; } -// Re-export dynamic flags from the www version. -require("ReactFeatureFlags"); - var rendererSigil; { @@ -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" diff --git a/compiled/facebook-www/ReactFlightDOMRelayServer-prod.classic.js b/compiled/facebook-www/ReactFlightDOMRelayServer-prod.classic.js index 38e7873e5cfe7..411eddc6b920c 100644 --- a/compiled/facebook-www/ReactFlightDOMRelayServer-prod.classic.js +++ b/compiled/facebook-www/ReactFlightDOMRelayServer-prod.classic.js @@ -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; @@ -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`" ); diff --git a/compiled/facebook-www/ReactFlightDOMRelayServer-prod.modern.js b/compiled/facebook-www/ReactFlightDOMRelayServer-prod.modern.js index 38e7873e5cfe7..411eddc6b920c 100644 --- a/compiled/facebook-www/ReactFlightDOMRelayServer-prod.modern.js +++ b/compiled/facebook-www/ReactFlightDOMRelayServer-prod.modern.js @@ -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; @@ -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`" );