Skip to content

Commit 9da7d30

Browse files
mofeiZrickhanlonii
authored andcommitted
[ServerRenderer] Move fizz external runtime implementation to react-dom-bindings (#25617)
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory. Before submitting a pull request, please make sure the following is done: 1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`. 2. Run `yarn` in the repository root. 3. If you've fixed a bug or added code that should be tested, add tests! 4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development. 5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`. 6. If you need a debugger, run `yarn debug-test --watch TestName`, open `chrome://inspect`, and press "Inspect". 7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`). 8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files. 9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`). 10. If you haven't already, complete the CLA. Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html --> Following [comment](#25437 (comment)) in #25437 , the external runtime implementation should be moved from `react-dom` to `react-dom-bindings`. I did have a question here: I set the entrypoint to `react-dom/unstable_server-external-runtime.js`, since a.) I was following #25436 as an example and b.) `react-dom-bindings` was missing a `README.md` and `npm/`. This also involved adding the external runtime to `package.json`. However, the external runtime isn't really a `react-dom` entrypoint. Is this change alright, or should I change the bundling code instead? ## How did you test this change? <!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. How exactly did you verify that your PR solves the issue you wanted to solve? If you leave this empty, your PR will very likely be closed. -->
1 parent 2a01cd0 commit 9da7d30

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

packages/react-dom/src/server/ReactDOMServerExternalRuntime.js renamed to packages/react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
completeBoundaryWithStyles,
1212
completeBoundary,
1313
completeSegment,
14-
} from '../../../react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSet';
14+
} from './fizz-instruction-set/ReactDOMFizzInstructionSet';
1515

1616
// Intentionally does nothing. Implementation will be added in future PR.
1717
// eslint-disable-next-line no-unused-vars

packages/react-dom/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"./profiling": "./profiling.js",
6666
"./test-utils": "./test-utils.js",
6767
"./unstable_testing": "./unstable_testing.js",
68+
"./unstable_server-external-runtime": "./unstable_server-external-runtime.js",
6869
"./src/*": "./src/*",
6970
"./package.json": "./package.json"
7071
},

packages/react-dom/unstable_server-external-runtime.js

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

10-
export * from 'react-dom/src/server/ReactDOMServerExternalRuntime';
10+
export * from 'react-dom-bindings/src/server/ReactDOMServerExternalRuntime';

scripts/rollup/bundles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ const bundles = [
291291
{
292292
bundleTypes: [BROWSER_SCRIPT],
293293
moduleType: RENDERER,
294-
entry: 'react-dom/src/server/ReactDOMServerExternalRuntime.js',
294+
entry: 'react-dom/unstable_server-external-runtime',
295295
outputPath: 'unstable_server-external-runtime.js',
296296
global: 'ReactDOMServerExternalRuntime',
297297
minifyWithProdErrorCodes: false,

scripts/shared/inlinedHostConfigs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = [
1515
'react-dom/src/server/ReactDOMFizzServerNode.js',
1616
'react-dom/static.node',
1717
'react-dom/server-rendering-stub',
18-
'react-dom/src/server/ReactDOMServerExternalRuntime.js',
18+
'react-dom/unstable_server-external-runtime',
1919
'react-server-dom-webpack/server.node',
2020
'react-server-dom-webpack/client',
2121
],
@@ -53,7 +53,7 @@ module.exports = [
5353
'react-dom/src/server/ReactDOMFizzServerBrowser.js',
5454
'react-dom/static.browser',
5555
'react-dom/server-rendering-stub',
56-
'react-dom/src/server/ReactDOMServerExternalRuntime.js',
56+
'react-dom/unstable_server-external-runtime',
5757
'react-server-dom-webpack/server.browser',
5858
'react-server-dom-webpack/client',
5959
],

0 commit comments

Comments
 (0)