Skip to content

Commit

Permalink
Rename ReactServerHostConfig to ReactServerStreamConfig
Browse files Browse the repository at this point in the history
This will be the config specifically for streaming purposes.
There will be other configs for other purposes.
  • Loading branch information
sebmarkbage committed Mar 7, 2020
1 parent d0a23a0 commit cb97e8e
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/react-server/src/ReactDOMServerFormatConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import {convertStringToBuffer} from 'react-server/src/ReactServerHostConfig';
import {convertStringToBuffer} from 'react-server/src/ReactServerStreamConfig';

import {renderToStaticMarkup} from 'react-dom/server';

Expand Down
4 changes: 2 additions & 2 deletions packages/react-server/src/ReactFizzServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import type {Destination} from './ReactServerHostConfig';
import type {Destination} from './ReactServerStreamConfig';
import type {ReactNodeList} from 'shared/ReactTypes';

import {
Expand All @@ -17,7 +17,7 @@ import {
completeWriting,
flushBuffered,
close,
} from './ReactServerHostConfig';
} from './ReactServerStreamConfig';
import {formatChunk} from './ReactServerFormatConfig';
import {REACT_ELEMENT_TYPE} from 'shared/ReactSymbols';

Expand Down
4 changes: 2 additions & 2 deletions packages/react-server/src/ReactFlightServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import type {Destination} from './ReactServerHostConfig';
import type {Destination} from './ReactServerStreamConfig';

import {
scheduleWork,
Expand All @@ -17,7 +17,7 @@ import {
flushBuffered,
close,
convertStringToBuffer,
} from './ReactServerHostConfig';
} from './ReactServerStreamConfig';
import {renderHostChildrenToString} from './ReactServerFormatConfig';
import {REACT_ELEMENT_TYPE} from 'shared/ReactSymbols';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* @flow
*/

export * from '../ReactServerHostConfigBrowser';
export * from '../ReactServerStreamConfigBrowser';
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* @flow
*/

export * from '../ReactServerHostConfigNode';
export * from '../ReactServerStreamConfigNode';
2 changes: 1 addition & 1 deletion scripts/flow/createFlowConfigs.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function writeConfig(renderer, rendererInfo, isServerSupported) {
'%REACT_RENDERER_FLOW_OPTIONS%',
`
module.name_mapper='ReactFiberHostConfig$$' -> 'forks/ReactFiberHostConfig.${renderer}'
module.name_mapper='ReactServerHostConfig$$' -> 'forks/ReactServerHostConfig.${serverRenderer}'
module.name_mapper='ReactServerStreamConfig$$' -> 'forks/ReactServerStreamConfig.${serverRenderer}'
module.name_mapper='ReactServerFormatConfig$$' -> 'forks/ReactServerFormatConfig.${serverRenderer}'
module.name_mapper='ReactFlightClientHostConfig$$' -> 'forks/ReactFlightClientHostConfig.${serverRenderer}'
`.trim(),
Expand Down
8 changes: 4 additions & 4 deletions scripts/jest/setupHostConfigs.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ jest.mock('react-reconciler', () => {
return require.requireActual('react-reconciler');
};
});
const shimServerHostConfigPath = 'react-server/src/ReactServerHostConfig';
const shimServerStreamConfigPath = 'react-server/src/ReactServerStreamConfig';
const shimServerFormatConfigPath = 'react-server/src/ReactServerFormatConfig';
jest.mock('react-server', () => {
return config => {
jest.mock(shimServerHostConfigPath, () => config);
jest.mock(shimServerStreamConfigPath, () => config);
jest.mock(shimServerFormatConfigPath, () => config);
return require.requireActual('react-server');
};
});
jest.mock('react-server/flight', () => {
return config => {
jest.mock(shimServerHostConfigPath, () => config);
jest.mock(shimServerStreamConfigPath, () => config);
jest.mock(shimServerFormatConfigPath, () => config);
return require.requireActual('react-server/flight');
};
Expand All @@ -39,7 +39,7 @@ jest.mock('react-client/flight', () => {
const configPaths = [
'react-reconciler/src/ReactFiberHostConfig',
'react-client/src/ReactFlightClientHostConfig',
'react-server/src/ReactServerHostConfig',
'react-server/src/ReactServerStreamConfig',
'react-server/src/ReactServerFormatConfig',
];

Expand Down
6 changes: 3 additions & 3 deletions scripts/rollup/forks.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ const forks = Object.freeze({
);
},

'react-server/src/ReactServerHostConfig': (
'react-server/src/ReactServerStreamConfig': (
bundleType,
entry,
dependencies,
Expand All @@ -316,11 +316,11 @@ const forks = Object.freeze({
if (!rendererInfo.isServerSupported) {
return null;
}
return `react-server/src/forks/ReactServerHostConfig.${rendererInfo.shortName}.js`;
return `react-server/src/forks/ReactServerStreamConfig.${rendererInfo.shortName}.js`;
}
}
throw new Error(
'Expected ReactServerHostConfig to always be replaced with a shim, but ' +
'Expected ReactServerStreamConfig 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?'
);
Expand Down

0 comments on commit cb97e8e

Please sign in to comment.