Repository: facebook/react
Pull request: [ServerRenderer] Move fizz external runtime implementation to react-dom-bindings

<!--
  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](https://github.com/facebook/react/pull/25437#discussion_r1010944983) 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.
-->


Changed files:
filename: packages/react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js
patch: @@ -11,7 +11,7 @@ import {
   completeBoundaryWithStyles,
   completeBoundary,
   completeSegment,
-} from '../../../react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSet';
+} from './fizz-instruction-set/ReactDOMFizzInstructionSet';
 
 // Intentionally does nothing. Implementation will be added in future PR.
 // eslint-disable-next-line no-unused-vars

filename: packages/react-dom/package.json
patch: @@ -65,6 +65,7 @@
     "./profiling": "./profiling.js",
     "./test-utils": "./test-utils.js",
     "./unstable_testing": "./unstable_testing.js",
+    "./unstable_server-external-runtime": "./unstable_server-external-runtime.js",
     "./src/*": "./src/*",
     "./package.json": "./package.json"
   },

filename: packages/react-dom/unstable_server-external-runtime.js
patch: @@ -7,4 +7,4 @@
  * @flow
  */
 
-export * from 'react-dom/src/server/ReactDOMServerExternalRuntime';
+export * from 'react-dom-bindings/src/server/ReactDOMServerExternalRuntime';

filename: scripts/rollup/bundles.js
patch: @@ -291,7 +291,7 @@ const bundles = [
   {
     bundleTypes: [BROWSER_SCRIPT],
     moduleType: RENDERER,
-    entry: 'react-dom/src/server/ReactDOMServerExternalRuntime.js',
+    entry: 'react-dom/unstable_server-external-runtime',
     outputPath: 'unstable_server-external-runtime.js',
     global: 'ReactDOMServerExternalRuntime',
     minifyWithProdErrorCodes: false,

filename: scripts/shared/inlinedHostConfigs.js
patch: @@ -15,7 +15,7 @@ module.exports = [
       'react-dom/src/server/ReactDOMFizzServerNode.js',
       'react-dom/static.node',
       'react-dom/server-rendering-stub',
-      'react-dom/src/server/ReactDOMServerExternalRuntime.js',
+      'react-dom/unstable_server-external-runtime',
       'react-server-dom-webpack/server.node',
       'react-server-dom-webpack/client',
     ],
@@ -53,7 +53,7 @@ module.exports = [
       'react-dom/src/server/ReactDOMFizzServerBrowser.js',
       'react-dom/static.browser',
       'react-dom/server-rendering-stub',
-      'react-dom/src/server/ReactDOMServerExternalRuntime.js',
+      'react-dom/unstable_server-external-runtime',
       'react-server-dom-webpack/server.browser',
       'react-server-dom-webpack/client',
     ],