Files
react/scripts/shared/inlinedHostConfigs.js
Andrew Clark 54f0e0f730 Scaffolding for react-dom/unstable_external-server-runtime (#25482)
* Scaffolding for react-dom/unstable_external-server-runtime

Implements a new bundle type for in our build config called
BROWSER_SCRIPT. This is intended for scripts that get delivered straight
to the browser without needing to be processed by a bundler. (And also
doesn't include any extra UMD crap.)

Right now there's only a single use case so I didn't stress about making
it general purpose.

The use case is: a script that loads the Fizz browser runtime, and sets
up a MutationObserver to receive instructions as HTML streams in. This
will be an alternative option to the default Fizz behavior of sending
the runtime down as inline script tags, to accommodate environments
where inline script tags are not allowed.

There's no development version of this bundle because it doesn't contain
any warnings or run any user code.

None of the actual implementation is in this PR; it just sets up the
build infra.

Co-authored-by: Mofei Zhang <feifei0@fb.com>

* Set BUNDLE_SCRIPT's GCC output format to ES5

This removes the automatic 'use strict' directive, which we don't need.

Co-authored-by: Mofei Zhang <feifei0@fb.com>
2022-10-14 23:29:17 -04:00

179 lines
5.7 KiB
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
module.exports = [
{
shortName: 'dom',
entryPoints: [
'react-dom',
'react-dom/unstable_testing',
'react-dom/src/server/ReactDOMFizzServerNode.js',
'react-dom/static.node',
'react-dom/server-rendering-stub',
'react-dom/src/server/ReactDOMServerExternalRuntime.js',
'react-server-dom-webpack/writer.node.server',
'react-server-dom-webpack',
],
paths: [
'react-dom',
'react-dom-bindings',
'react-dom/client',
'react-dom/server',
'react-dom/server.node',
'react-dom/static',
'react-dom/static.node',
'react-dom/src/server/ReactDOMFizzServerNode.js', // react-dom/server.node
'react-dom/src/server/ReactDOMFizzStaticNode.js',
'react-server-dom-webpack',
'react-server-dom-webpack/writer',
'react-server-dom-webpack/writer.node.server',
'react-server-dom-webpack/src/ReactFlightDOMServerNode.js', // react-server-dom-webpack/writer.node.server
'react-client/src/ReactFlightClientStream.js', // We can only type check this in streaming configurations.
'react-devtools',
'react-devtools-core',
'react-devtools-shell',
'react-devtools-shared',
'react-interactions',
'shared/ReactDOMSharedInternals',
],
isFlowTyped: true,
isServerSupported: true,
},
{
shortName: 'dom-browser',
entryPoints: [
'react-dom',
'react-dom/unstable_testing',
'react-dom/src/server/ReactDOMFizzServerBrowser.js',
'react-dom/static.browser',
'react-dom/server-rendering-stub',
'react-dom/src/server/ReactDOMServerExternalRuntime.js',
'react-server-dom-webpack/writer.browser.server',
'react-server-dom-webpack',
],
paths: [
'react-dom',
'react-dom-bindings',
'react-dom/client',
'react-dom/server.browser',
'react-dom/static.browser',
'react-dom/unstable_testing',
'react-dom/src/server/ReactDOMFizzServerBrowser.js', // react-dom/server.browser
'react-dom/src/server/ReactDOMFizzStaticBrowser.js',
'react-server-dom-webpack',
'react-server-dom-webpack/writer.browser.server',
'react-server-dom-webpack/src/ReactFlightDOMServerBrowser.js', // react-server-dom-webpack/writer.browser.server
'react-client/src/ReactFlightClientStream.js', // We can only type check this in streaming configurations.
'react-devtools',
'react-devtools-core',
'react-devtools-shell',
'react-devtools-shared',
'shared/ReactDOMSharedInternals',
],
isFlowTyped: true,
isServerSupported: true,
},
{
shortName: 'dom-legacy',
entryPoints: [
'react-dom/src/server/ReactDOMLegacyServerBrowser.js', // react-dom/server.browser
'react-dom/src/server/ReactDOMLegacyServerNode.js', // react-dom/server.node
],
paths: [
'react-dom',
'react-dom-bindings',
'react-server-dom-webpack',
'react-dom/src/server/ReactDOMLegacyServerImpl.js', // not an entrypoint, but only usable in *Brower and *Node files
'react-dom/src/server/ReactDOMLegacyServerBrowser.js', // react-dom/server.browser
'react-dom/src/server/ReactDOMLegacyServerNode.js', // react-dom/server.node
'react-dom/src/server/ReactDOMLegacyServerNode.classic.fb.js',
'react-dom/src/server/ReactDOMLegacyServerNodeStream.js', // file indirection to support partial forking of some methods in *Node
'react-client/src/ReactFlightClientStream.js', // We can only type check this in streaming configurations.
'shared/ReactDOMSharedInternals',
],
isFlowTyped: true,
isServerSupported: true,
},
{
shortName: 'art',
entryPoints: ['react-art'],
paths: ['react-art'],
isFlowTyped: false, // TODO: type it.
isServerSupported: false,
},
{
shortName: 'native',
entryPoints: ['react-native-renderer'],
paths: ['react-native-renderer'],
isFlowTyped: true,
isServerSupported: false,
},
{
shortName: 'fabric',
entryPoints: ['react-native-renderer/fabric'],
paths: ['react-native-renderer'],
isFlowTyped: true,
isServerSupported: false,
},
{
shortName: 'test',
entryPoints: ['react-test-renderer'],
paths: ['react-test-renderer'],
isFlowTyped: true,
isServerSupported: false,
},
{
shortName: 'dom-relay',
entryPoints: [
'react-server-dom-relay',
'react-server-dom-relay/server',
'react-server-dom-relay/src/ReactDOMServerFB.js',
],
paths: [
'react-dom',
'react-dom-bindings',
'react-server-dom-relay',
'shared/ReactDOMSharedInternals',
],
isFlowTyped: true,
isServerSupported: true,
},
{
shortName: 'native-relay',
entryPoints: [
'react-server-native-relay',
'react-server-native-relay/server',
],
paths: [
'react-native-renderer',
'react-server-native-relay',
// this is included here so that it's not included in the main native check
// remove this when it's added to the main native renderer.
'react-native-renderer/src/server',
],
isFlowTyped: true,
isServerSupported: true,
},
{
shortName: 'custom',
entryPoints: [
'react-reconciler',
'react-client/flight',
'react-server',
'react-server/flight',
],
paths: [
'react-client/flight',
'react-server/flight',
'react-client/src/ReactFlightClientStream.js', // We can only type check this in streaming configurations.
],
isFlowTyped: true,
isServerSupported: true,
},
];