Rename ReactServerFormatConfig to ReactFizzConfig (#26591)
part of https://github.com/facebook/react/pull/26571 merging separately to improve tracking of file renames
This commit is contained in:
parent
f4f873f628
commit
ffb8eaca59
|
@ -12,7 +12,7 @@ import type {
|
|||
FormatContext,
|
||||
StreamingFormat,
|
||||
InstructionState,
|
||||
} from './ReactDOMServerFormatConfig';
|
||||
} from './ReactFizzConfigDOM';
|
||||
|
||||
import {
|
||||
createResponseState as createResponseStateImpl,
|
||||
|
@ -23,7 +23,7 @@ import {
|
|||
writeEndCompletedSuspenseBoundary as writeEndCompletedSuspenseBoundaryImpl,
|
||||
writeEndClientRenderedSuspenseBoundary as writeEndClientRenderedSuspenseBoundaryImpl,
|
||||
HTML_MODE,
|
||||
} from './ReactDOMServerFormatConfig';
|
||||
} from './ReactFizzConfigDOM';
|
||||
|
||||
import type {
|
||||
Destination,
|
||||
|
@ -34,7 +34,7 @@ import type {
|
|||
export const isPrimaryRenderer = false;
|
||||
|
||||
export type ResponseState = {
|
||||
// Keep this in sync with ReactDOMServerFormatConfig
|
||||
// Keep this in sync with ReactFizzConfigDOM
|
||||
bootstrapChunks: Array<Chunk | PrecomputedChunk>,
|
||||
placeholderPrefix: PrecomputedChunk,
|
||||
segmentPrefix: PrecomputedChunk,
|
||||
|
@ -71,7 +71,7 @@ export function createResponseState(
|
|||
externalRuntimeConfig,
|
||||
);
|
||||
return {
|
||||
// Keep this in sync with ReactDOMServerFormatConfig
|
||||
// Keep this in sync with ReactFizzConfigDOM
|
||||
bootstrapChunks: responseState.bootstrapChunks,
|
||||
placeholderPrefix: responseState.placeholderPrefix,
|
||||
segmentPrefix: responseState.segmentPrefix,
|
||||
|
@ -109,7 +109,7 @@ export type {
|
|||
BoundaryResources,
|
||||
FormatContext,
|
||||
SuspenseBoundaryID,
|
||||
} from './ReactDOMServerFormatConfig';
|
||||
} from './ReactFizzConfigDOM';
|
||||
|
||||
export {
|
||||
getChildFormatContext,
|
||||
|
@ -139,7 +139,7 @@ export {
|
|||
setCurrentlyRenderingBoundaryResourcesTarget,
|
||||
prepareToRender,
|
||||
cleanupAfterRender,
|
||||
} from './ReactDOMServerFormatConfig';
|
||||
} from './ReactFizzConfigDOM';
|
||||
|
||||
import {stringToChunk} from 'react-server/src/ReactServerStreamConfig';
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import type {ReactNodeList} from 'shared/ReactTypes';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
import ReactVersion from 'shared/ReactVersion';
|
||||
|
||||
|
@ -22,7 +22,7 @@ import {
|
|||
import {
|
||||
createResponseState,
|
||||
createRootFormatContext,
|
||||
} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
type Options = {
|
||||
identifierPrefix?: string,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import type {ReactNodeList} from 'shared/ReactTypes';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
import ReactVersion from 'shared/ReactVersion';
|
||||
|
||||
|
@ -22,7 +22,7 @@ import {
|
|||
import {
|
||||
createResponseState,
|
||||
createRootFormatContext,
|
||||
} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
type Options = {
|
||||
identifierPrefix?: string,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import type {ReactNodeList} from 'shared/ReactTypes';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
import ReactVersion from 'shared/ReactVersion';
|
||||
|
||||
|
@ -22,7 +22,7 @@ import {
|
|||
import {
|
||||
createResponseState,
|
||||
createRootFormatContext,
|
||||
} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
type Options = {
|
||||
identifierPrefix?: string,
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
import type {Request} from 'react-server/src/ReactFizzServer';
|
||||
import type {ReactNodeList} from 'shared/ReactTypes';
|
||||
import type {Writable} from 'stream';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
import type {Destination} from 'react-server/src/ReactServerStreamConfigNode';
|
||||
|
||||
import ReactVersion from 'shared/ReactVersion';
|
||||
|
@ -25,7 +25,7 @@ import {
|
|||
import {
|
||||
createResponseState,
|
||||
createRootFormatContext,
|
||||
} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
function createDrainHandler(destination: Destination, request: Request) {
|
||||
return () => startFlowing(request, destination);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import type {ReactNodeList} from 'shared/ReactTypes';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
import ReactVersion from 'shared/ReactVersion';
|
||||
|
||||
|
@ -22,7 +22,7 @@ import {
|
|||
import {
|
||||
createResponseState,
|
||||
createRootFormatContext,
|
||||
} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
type Options = {
|
||||
identifierPrefix?: string,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import type {ReactNodeList} from 'shared/ReactTypes';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
import ReactVersion from 'shared/ReactVersion';
|
||||
|
||||
|
@ -22,7 +22,7 @@ import {
|
|||
import {
|
||||
createResponseState,
|
||||
createRootFormatContext,
|
||||
} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
type Options = {
|
||||
identifierPrefix?: string,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
import type {ReactNodeList} from 'shared/ReactTypes';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
import {Writable, Readable} from 'stream';
|
||||
|
||||
|
@ -24,7 +24,7 @@ import {
|
|||
import {
|
||||
createResponseState,
|
||||
createRootFormatContext,
|
||||
} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
type Options = {
|
||||
identifierPrefix?: string,
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
import ReactVersion from 'shared/ReactVersion';
|
||||
|
||||
import type {ReactNodeList} from 'shared/ReactTypes';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
import {
|
||||
createRequest,
|
||||
|
@ -22,7 +22,7 @@ import {
|
|||
import {
|
||||
createResponseState,
|
||||
createRootFormatContext,
|
||||
} from 'react-dom-bindings/src/server/ReactDOMServerLegacyFormatConfig';
|
||||
} from 'react-dom-bindings/src/server/ReactFizzConfigDOMLegacy';
|
||||
|
||||
type ServerOptions = {
|
||||
identifierPrefix?: string,
|
||||
|
|
|
@ -21,7 +21,7 @@ import {
|
|||
import {
|
||||
createResponseState,
|
||||
createRootFormatContext,
|
||||
} from 'react-dom-bindings/src/server/ReactDOMServerLegacyFormatConfig';
|
||||
} from 'react-dom-bindings/src/server/ReactFizzConfigDOMLegacy';
|
||||
|
||||
import {Readable} from 'stream';
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import type {ReactNodeList} from 'shared/ReactTypes';
|
|||
import type {Request} from 'react-server/src/ReactFizzServer';
|
||||
|
||||
import type {Destination} from 'react-server/src/ReactServerStreamConfig';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
||||
|
||||
import {
|
||||
createRequest,
|
||||
|
@ -25,7 +25,7 @@ import {
|
|||
import {
|
||||
createResponseState,
|
||||
createRootFormatContext,
|
||||
} from 'react-server/src/ReactServerFormatConfig';
|
||||
} from 'react-server/src/ReactFizzConfig';
|
||||
|
||||
type Options = {
|
||||
identifierPrefix?: string,
|
||||
|
|
|
@ -19,7 +19,7 @@ import type {
|
|||
Usable,
|
||||
} from 'shared/ReactTypes';
|
||||
|
||||
import type {ResponseState} from './ReactServerFormatConfig';
|
||||
import type {ResponseState} from './ReactFizzConfig';
|
||||
import type {Task} from './ReactFizzServer';
|
||||
import type {ThenableState} from './ReactFizzThenable';
|
||||
|
||||
|
@ -27,7 +27,7 @@ import {readContext as readContextImpl} from './ReactFizzNewContext';
|
|||
import {getTreeId} from './ReactFizzTreeContext';
|
||||
import {createThenableState, trackUsedThenable} from './ReactFizzThenable';
|
||||
|
||||
import {makeId} from './ReactServerFormatConfig';
|
||||
import {makeId} from './ReactFizzConfig';
|
||||
|
||||
import {
|
||||
enableCache,
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
import type {ReactContext} from 'shared/ReactTypes';
|
||||
|
||||
import {REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED} from 'shared/ReactSymbols';
|
||||
import {isPrimaryRenderer} from './ReactServerFormatConfig';
|
||||
import {isPrimaryRenderer} from './ReactFizzConfig';
|
||||
|
||||
let rendererSigil;
|
||||
if (__DEV__) {
|
||||
|
|
|
@ -27,7 +27,7 @@ import type {
|
|||
FormatContext,
|
||||
Resources,
|
||||
BoundaryResources,
|
||||
} from './ReactServerFormatConfig';
|
||||
} from './ReactFizzConfig';
|
||||
import type {ContextSnapshot} from './ReactFizzNewContext';
|
||||
import type {ComponentStackNode} from './ReactFizzComponentStack';
|
||||
import type {TreeContext} from './ReactFizzTreeContext';
|
||||
|
@ -76,7 +76,7 @@ import {
|
|||
setCurrentlyRenderingBoundaryResourcesTarget,
|
||||
createResources,
|
||||
createBoundaryResources,
|
||||
} from './ReactServerFormatConfig';
|
||||
} from './ReactFizzConfig';
|
||||
import {
|
||||
constructClassInstance,
|
||||
mountClassInstance,
|
||||
|
|
|
@ -7,4 +7,4 @@
|
|||
* @flow
|
||||
*/
|
||||
|
||||
export * from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
export * from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
|
@ -7,4 +7,4 @@
|
|||
* @flow
|
||||
*/
|
||||
|
||||
export * from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
export * from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
|
@ -7,4 +7,4 @@
|
|||
* @flow
|
||||
*/
|
||||
|
||||
export * from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
export * from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
|
@ -7,4 +7,4 @@
|
|||
* @flow
|
||||
*/
|
||||
|
||||
export * from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
||||
export * from 'react-dom-bindings/src/server/ReactFizzConfigDOMLegacy';
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
export * from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
export * from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
export * from 'react-dom-bindings/src/server/ReactFizzConfigDOM';
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
export * from 'react-native-renderer/src/server/ReactFizzConfigNative';
|
|
@ -1,10 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
export * from 'react-dom-bindings/src/server/ReactDOMServerLegacyFormatConfig';
|
|
@ -1,10 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
export * from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
|
@ -1,10 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
export * from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig';
|
|
@ -1,10 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
export * from 'react-native-renderer/src/server/ReactNativeServerFormatConfig';
|
|
@ -53,7 +53,7 @@ function writeConfig(renderer, rendererInfo, isServerSupported) {
|
|||
`
|
||||
module.name_mapper='ReactFiberHostConfig$$' -> 'forks/ReactFiberHostConfig.${renderer}'
|
||||
module.name_mapper='ReactServerStreamConfig$$' -> 'forks/ReactServerStreamConfig.${serverRenderer}'
|
||||
module.name_mapper='ReactServerFormatConfig$$' -> 'forks/ReactServerFormatConfig.${serverRenderer}'
|
||||
module.name_mapper='ReactFizzConfig$$' -> 'forks/ReactFizzConfig.${serverRenderer}'
|
||||
module.name_mapper='ReactFlightServerConfig$$' -> 'forks/ReactFlightServerConfig.${serverRenderer}'
|
||||
module.name_mapper='ReactFlightClientConfig$$' -> 'forks/ReactFlightClientConfig.${serverRenderer}'
|
||||
module.name_mapper='react-devtools-feature-flags' -> 'react-devtools-shared/src/config/DevToolsFeatureFlags.default'
|
||||
|
|
|
@ -68,19 +68,19 @@ jest.mock('react-reconciler', () => {
|
|||
};
|
||||
});
|
||||
const shimServerStreamConfigPath = 'react-server/src/ReactServerStreamConfig';
|
||||
const shimServerFormatConfigPath = 'react-server/src/ReactServerFormatConfig';
|
||||
const shimServerConfigPath = 'react-server/src/ReactFizzConfig';
|
||||
const shimFlightServerConfigPath = 'react-server/src/ReactFlightServerConfig';
|
||||
jest.mock('react-server', () => {
|
||||
return config => {
|
||||
jest.mock(shimServerStreamConfigPath, () => config);
|
||||
jest.mock(shimServerFormatConfigPath, () => config);
|
||||
jest.mock(shimServerConfigPath, () => config);
|
||||
return jest.requireActual('react-server');
|
||||
};
|
||||
});
|
||||
jest.mock('react-server/flight', () => {
|
||||
return config => {
|
||||
jest.mock(shimServerStreamConfigPath, () => config);
|
||||
jest.mock(shimServerFormatConfigPath, () => config);
|
||||
jest.mock(shimServerConfigPath, () => config);
|
||||
jest.mock('react-server/src/ReactFlightServerConfigBundlerCustom', () => ({
|
||||
isClientReference: config.isClientReference,
|
||||
isServerReference: config.isServerReference,
|
||||
|
@ -107,7 +107,7 @@ const configPaths = [
|
|||
'react-reconciler/src/ReactFiberHostConfig',
|
||||
'react-client/src/ReactFlightClientConfig',
|
||||
'react-server/src/ReactServerStreamConfig',
|
||||
'react-server/src/ReactServerFormatConfig',
|
||||
'react-server/src/ReactFizzConfig',
|
||||
'react-server/src/ReactFlightServerConfig',
|
||||
];
|
||||
|
||||
|
|
|
@ -299,7 +299,7 @@ const forks = Object.freeze({
|
|||
);
|
||||
},
|
||||
|
||||
'./packages/react-server/src/ReactServerFormatConfig.js': (
|
||||
'./packages/react-server/src/ReactFizzConfig.js': (
|
||||
bundleType,
|
||||
entry,
|
||||
dependencies,
|
||||
|
@ -317,11 +317,11 @@ const forks = Object.freeze({
|
|||
if (!rendererInfo.isServerSupported) {
|
||||
return null;
|
||||
}
|
||||
return `./packages/react-server/src/forks/ReactServerFormatConfig.${rendererInfo.shortName}.js`;
|
||||
return `./packages/react-server/src/forks/ReactFizzConfig.${rendererInfo.shortName}.js`;
|
||||
}
|
||||
}
|
||||
throw new Error(
|
||||
'Expected ReactServerFormatConfig to always be replaced with a shim, but ' +
|
||||
'Expected ReactFizzConfig to always be replaced with a shim, but ' +
|
||||
`found no mention of "${entry}" entry point in ./scripts/shared/inlinedHostConfigs.js. ` +
|
||||
'Did you mean to add it there to associate it with a specific renderer?'
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue