@samitouri / QOS-React-1 / commits / d23b8b5dbf

[Flight] use opaque config for flight in `dom-legacy` renderer (#27313)

`dom-legacy` does not make sense for Flight. we could still type check the files but it adds maintenance burden in the inlinedHostConfigs whenever things change there. Going to make these configs opaque mixed types to quiet flow since no entrypoints use the flight code

Josh Story committed Aug 30, 2023 at 10:32 UTC d23b8b5dbf72cd0a3a1a85e22af19772b32feacd
2 files changed +12 -2
packages/react-client/src/forks/ReactFlightClientConfig.dom-legacy.js
+11 -1
@@ -8,6 +8,16 @@
8 */
9
10 export * from 'react-client/src/ReactFlightClientConfigBrowser';
11 -export * from 'react-server-dom-webpack/src/ReactFlightClientConfigWebpackBundler';
11 export * from 'react-dom-bindings/src/shared/ReactFlightClientConfigDOM';
12 +
13 +export type Response = any;
14 +export opaque type SSRManifest = mixed;
15 +export opaque type ServerManifest = mixed;
16 +export opaque type ServerReferenceId = string;
17 +export opaque type ClientReferenceMetadata = mixed;
18 +export opaque type ClientReference<T> = mixed; // eslint-disable-line no-unused-vars
19 +export const resolveClientReference: any = null;
20 +export const resolveServerReference: any = null;
21 +export const preloadModule: any = null;
22 +export const requireModule: any = null;
23 export const usedWithSSR = true;
packages/react-server/src/forks/ReactFlightServerConfig.dom-legacy.js
+1 -1
@@ -9,7 +9,7 @@
9
10 import type {Request} from 'react-server/src/ReactFlightServer';
11
12 -export * from 'react-server-dom-webpack/src/ReactFlightServerConfigWebpackBundler';
12 +export * from '../ReactFlightServerConfigBundlerCustom';
13 export * from 'react-dom-bindings/src/server/ReactFlightServerConfigDOM';
14
15 export const supportsRequestStorage = false;