Skip to content

Commit 9896555

Browse files
committed
Implements wiring for Flight to have it's own "HostConfig" separate 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...
1 parent 657698e commit 9896555

53 files changed

Lines changed: 154 additions & 103 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/react-client/src/ReactFlightClient.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ import type {
1616
UninitializedModel,
1717
Response,
1818
SSRManifest,
19-
} from './ReactFlightClientHostConfig';
19+
} from './ReactFlightClientConfig';
2020

2121
import {
2222
resolveClientReference,
2323
preloadModule,
2424
requireModule,
2525
parseModel,
26-
} from './ReactFlightClientHostConfig';
26+
} from './ReactFlightClientConfig';
2727

2828
import {knownServerReferences} from './ReactFlightServerReferenceRegistry';
2929

packages/react-client/src/ReactFlightClientHostConfig.js renamed to packages/react-client/src/ReactFlightClientConfig.js

File renamed without changes.

packages/react-client/src/ReactFlightClientHostConfigBrowser.js renamed to packages/react-client/src/ReactFlightClientConfigBrowser.js

File renamed without changes.

packages/react-client/src/ReactFlightClientHostConfigNoStream.js renamed to packages/react-client/src/ReactFlightClientConfigNoStream.js

File renamed without changes.

packages/react-client/src/ReactFlightClientHostConfigNode.js renamed to packages/react-client/src/ReactFlightClientConfigNode.js

File renamed without changes.

packages/react-client/src/ReactFlightClientHostConfigStream.js renamed to packages/react-client/src/ReactFlightClientConfigStream.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
import type {ResponseBase} from './ReactFlightClient';
11-
import type {StringDecoder} from './ReactFlightClientHostConfig';
11+
import type {StringDecoder} from './ReactFlightClientConfig';
1212

1313
export type Response = ResponseBase & {
1414
_partialRow: string,

packages/react-client/src/ReactFlightClientStream.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
*/
99

1010
import type {CallServerCallback} from './ReactFlightClient';
11-
import type {Response} from './ReactFlightClientHostConfigStream';
12-
import type {SSRManifest} from './ReactFlightClientHostConfig';
11+
import type {Response} from './ReactFlightClientConfigStream';
12+
import type {SSRManifest} from './ReactFlightClientConfig';
1313

1414
import {
1515
resolveModule,
@@ -26,7 +26,7 @@ import {
2626
readFinalStringChunk,
2727
supportsBinaryStreams,
2828
createStringDecoder,
29-
} from './ReactFlightClientHostConfig';
29+
} from './ReactFlightClientConfig';
3030

3131
export type {Response};
3232

packages/react-client/src/forks/ReactFlightClientHostConfig.custom.js renamed to packages/react-client/src/forks/ReactFlightClientConfig.custom.js

File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @flow
8+
*/
9+
10+
export * from 'react-client/src/ReactFlightClientConfigBrowser';
11+
export * from 'react-client/src/ReactFlightClientConfigStream';
12+
export * from 'react-server-dom-webpack/src/ReactFlightClientConfigWebpackBundler';
13+
export * from 'react-dom-bindings/src/shared/ReactFlightClientConfigDOM';

packages/react-client/src/forks/ReactFlightClientHostConfig.dom-bun.js renamed to packages/react-client/src/forks/ReactFlightClientConfig.dom-bun.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
* @flow
88
*/
99

10-
export * from 'react-client/src/ReactFlightClientHostConfigBrowser';
11-
export * from 'react-client/src/ReactFlightClientHostConfigStream';
10+
export * from 'react-client/src/ReactFlightClientConfigBrowser';
11+
export * from 'react-client/src/ReactFlightClientConfigStream';
12+
export * from 'react-dom-bindings/src/shared/ReactFlightClientConfigDOM';
1213

1314
export type Response = any;
1415
export opaque type SSRManifest = mixed;

0 commit comments

Comments
 (0)