diff --git a/packages/react-dom/npm/server.browser.js b/packages/react-dom/npm/server.browser.js index 4b7749d4cd9b7..947e981ffd619 100644 --- a/packages/react-dom/npm/server.browser.js +++ b/packages/react-dom/npm/server.browser.js @@ -15,3 +15,6 @@ exports.renderToStaticMarkup = l.renderToStaticMarkup; exports.renderToNodeStream = l.renderToNodeStream; exports.renderToStaticNodeStream = l.renderToStaticNodeStream; exports.renderToReadableStream = s.renderToReadableStream; +if (s.resume) { + exports.resume = s.resume; +} diff --git a/packages/react-dom/npm/server.bun.js b/packages/react-dom/npm/server.bun.js index aa27124d58a54..adbc56adec022 100644 --- a/packages/react-dom/npm/server.bun.js +++ b/packages/react-dom/npm/server.bun.js @@ -12,6 +12,9 @@ if (process.env.NODE_ENV === 'production') { exports.version = b.version; exports.renderToReadableStream = b.renderToReadableStream; +if (b.resume) { + exports.resume = b.resume; +} exports.renderToNodeStream = b.renderToNodeStream; exports.renderToStaticNodeStream = b.renderToStaticNodeStream; exports.renderToString = l.renderToString; diff --git a/packages/react-dom/npm/server.edge.js b/packages/react-dom/npm/server.edge.js index 9b46751ab208f..ced0fa7a4e553 100644 --- a/packages/react-dom/npm/server.edge.js +++ b/packages/react-dom/npm/server.edge.js @@ -16,3 +16,6 @@ exports.renderToNodeStream = b.renderToNodeStream; exports.renderToStaticNodeStream = b.renderToStaticNodeStream; exports.renderToString = l.renderToString; exports.renderToStaticMarkup = l.renderToStaticMarkup; +if (b.resume) { + exports.resume = b.resume; +} diff --git a/packages/react-dom/npm/server.node.js b/packages/react-dom/npm/server.node.js index 2eb97e80354c8..44dc715efdd92 100644 --- a/packages/react-dom/npm/server.node.js +++ b/packages/react-dom/npm/server.node.js @@ -15,3 +15,6 @@ exports.renderToStaticMarkup = l.renderToStaticMarkup; exports.renderToNodeStream = l.renderToNodeStream; exports.renderToStaticNodeStream = l.renderToStaticNodeStream; exports.renderToPipeableStream = s.renderToPipeableStream; +if (s.resume) { + exports.resume = s.resume; +} diff --git a/packages/react-dom/server.browser.js b/packages/react-dom/server.browser.js index b17e136e5f22a..f617e7ec7e382 100644 --- a/packages/react-dom/server.browser.js +++ b/packages/react-dom/server.browser.js @@ -37,7 +37,14 @@ export function renderToStaticNodeStream() { } export function renderToReadableStream() { - return require('./src/server/ReactDOMFizzServerBrowser').renderToReadableStream.apply( + return require('./src/server/react-dom-server.browser').renderToReadableStream.apply( + this, + arguments, + ); +} + +export function resume() { + return require('./src/server/react-dom-server.browser').resume.apply( this, arguments, ); diff --git a/packages/react-dom/server.bun.js b/packages/react-dom/server.bun.js index 0ac32351ec46d..0776c4a85b0b2 100644 --- a/packages/react-dom/server.bun.js +++ b/packages/react-dom/server.bun.js @@ -12,21 +12,21 @@ import ReactVersion from 'shared/ReactVersion'; export {ReactVersion as version}; export function renderToReadableStream() { - return require('./src/server/ReactDOMFizzServerBun').renderToReadableStream.apply( + return require('./src/server/react-dom-server.bun').renderToReadableStream.apply( this, arguments, ); } export function renderToNodeStream() { - return require('./src/server/ReactDOMFizzServerBun').renderToNodeStream.apply( + return require('./src/server/react-dom-server.bun').renderToNodeStream.apply( this, arguments, ); } export function renderToStaticNodeStream() { - return require('./src/server/ReactDOMFizzServerBun').renderToStaticNodeStream.apply( + return require('./src/server/react-dom-server.bun').renderToStaticNodeStream.apply( this, arguments, ); @@ -45,3 +45,10 @@ export function renderToStaticMarkup() { arguments, ); } + +export function resume() { + return require('./src/server/react-dom-server.bun').resume.apply( + this, + arguments, + ); +} diff --git a/packages/react-dom/server.edge.js b/packages/react-dom/server.edge.js index f45eae21e7d49..a48e6c7e0a459 100644 --- a/packages/react-dom/server.edge.js +++ b/packages/react-dom/server.edge.js @@ -12,21 +12,21 @@ import ReactVersion from 'shared/ReactVersion'; export {ReactVersion as version}; export function renderToReadableStream() { - return require('./src/server/ReactDOMFizzServerEdge').renderToReadableStream.apply( + return require('./src/server/react-dom-server.edge').renderToReadableStream.apply( this, arguments, ); } export function renderToNodeStream() { - return require('./src/server/ReactDOMFizzServerEdge').renderToNodeStream.apply( + return require('./src/server/react-dom-server.edge').renderToNodeStream.apply( this, arguments, ); } export function renderToStaticNodeStream() { - return require('./src/server/ReactDOMFizzServerEdge').renderToStaticNodeStream.apply( + return require('./src/server/react-dom-server.edge').renderToStaticNodeStream.apply( this, arguments, ); @@ -45,3 +45,10 @@ export function renderToStaticMarkup() { arguments, ); } + +export function resume() { + return require('./src/server/react-dom-server.edge').resume.apply( + this, + arguments, + ); +} diff --git a/packages/react-dom/server.node.js b/packages/react-dom/server.node.js index 3ef13b8540ada..713f6ea322e6a 100644 --- a/packages/react-dom/server.node.js +++ b/packages/react-dom/server.node.js @@ -37,7 +37,14 @@ export function renderToStaticNodeStream() { } export function renderToPipeableStream() { - return require('./src/server/ReactDOMFizzServerNode').renderToPipeableStream.apply( + return require('./src/server/react-dom-server.node').renderToPipeableStream.apply( + this, + arguments, + ); +} + +export function resume() { + return require('./src/server/react-dom-server.node').resume.apply( this, arguments, ); diff --git a/packages/react-dom/src/server/ReactDOMFizzServerBrowser.js b/packages/react-dom/src/server/ReactDOMFizzServerBrowser.js index 7722089b0e8fa..f96b2724555cb 100644 --- a/packages/react-dom/src/server/ReactDOMFizzServerBrowser.js +++ b/packages/react-dom/src/server/ReactDOMFizzServerBrowser.js @@ -196,4 +196,4 @@ function resume( }); } -export {renderToReadableStream, ReactVersion as version}; +export {renderToReadableStream, resume, ReactVersion as version}; diff --git a/packages/react-dom/src/server/ReactDOMFizzServerEdge.js b/packages/react-dom/src/server/ReactDOMFizzServerEdge.js index 7722089b0e8fa..f96b2724555cb 100644 --- a/packages/react-dom/src/server/ReactDOMFizzServerEdge.js +++ b/packages/react-dom/src/server/ReactDOMFizzServerEdge.js @@ -196,4 +196,4 @@ function resume( }); } -export {renderToReadableStream, ReactVersion as version}; +export {renderToReadableStream, resume, ReactVersion as version}; diff --git a/packages/react-dom/src/server/ReactDOMFizzServerNode.js b/packages/react-dom/src/server/ReactDOMFizzServerNode.js index 3dfb69b237488..35b125a9d6be7 100644 --- a/packages/react-dom/src/server/ReactDOMFizzServerNode.js +++ b/packages/react-dom/src/server/ReactDOMFizzServerNode.js @@ -188,4 +188,8 @@ function resumeToPipeableStream( }; } -export {renderToPipeableStream, ReactVersion as version}; +export { + renderToPipeableStream, + resumeToPipeableStream, + ReactVersion as version, +}; diff --git a/packages/react-dom/src/server/react-dom-server.browser.js b/packages/react-dom/src/server/react-dom-server.browser.js new file mode 100644 index 0000000000000..c26a0e96901ae --- /dev/null +++ b/packages/react-dom/src/server/react-dom-server.browser.js @@ -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 './ReactDOMFizzServerBrowser.js'; diff --git a/packages/react-dom/src/server/react-dom-server.browser.stable.js b/packages/react-dom/src/server/react-dom-server.browser.stable.js new file mode 100644 index 0000000000000..3471bba15ac94 --- /dev/null +++ b/packages/react-dom/src/server/react-dom-server.browser.stable.js @@ -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 {renderToReadableStream, version} from './ReactDOMFizzServerBrowser.js'; diff --git a/packages/react-dom/src/server/react-dom-server.bun.js b/packages/react-dom/src/server/react-dom-server.bun.js new file mode 100644 index 0000000000000..5ca420c2305ec --- /dev/null +++ b/packages/react-dom/src/server/react-dom-server.bun.js @@ -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 './ReactDOMFizzServerBun.js'; diff --git a/packages/react-dom/src/server/react-dom-server.bun.stable.js b/packages/react-dom/src/server/react-dom-server.bun.stable.js new file mode 100644 index 0000000000000..b5c1fd02d3638 --- /dev/null +++ b/packages/react-dom/src/server/react-dom-server.bun.stable.js @@ -0,0 +1,15 @@ +/** + * 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 { + renderToReadableStream, + renderToNodeStream, + renderToStaticNodeStream, + version, +} from './ReactDOMFizzServerBun.js'; diff --git a/packages/react-dom/src/server/react-dom-server.edge.js b/packages/react-dom/src/server/react-dom-server.edge.js new file mode 100644 index 0000000000000..515bb10b175ec --- /dev/null +++ b/packages/react-dom/src/server/react-dom-server.edge.js @@ -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 './ReactDOMFizzServerEdge.js'; diff --git a/packages/react-dom/src/server/react-dom-server.edge.stable.js b/packages/react-dom/src/server/react-dom-server.edge.stable.js new file mode 100644 index 0000000000000..b2f0278099ce3 --- /dev/null +++ b/packages/react-dom/src/server/react-dom-server.edge.stable.js @@ -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 {renderToReadableStream, version} from './ReactDOMFizzServerEdge.js'; diff --git a/packages/react-dom/src/server/react-dom-server.node.js b/packages/react-dom/src/server/react-dom-server.node.js new file mode 100644 index 0000000000000..6959b7e3f9e29 --- /dev/null +++ b/packages/react-dom/src/server/react-dom-server.node.js @@ -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 './ReactDOMFizzServerNode.js'; diff --git a/packages/react-dom/src/server/react-dom-server.node.stable.js b/packages/react-dom/src/server/react-dom-server.node.stable.js new file mode 100644 index 0000000000000..bd17b91a9602a --- /dev/null +++ b/packages/react-dom/src/server/react-dom-server.node.stable.js @@ -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 {renderToPipeableStream, version} from './ReactDOMFizzServerNode.js'; diff --git a/scripts/rollup/bundles.js b/scripts/rollup/bundles.js index b3c5484c282c0..db57c4b1dc367 100644 --- a/scripts/rollup/bundles.js +++ b/scripts/rollup/bundles.js @@ -233,7 +233,7 @@ const bundles = [ { bundleTypes: [NODE_DEV, NODE_PROD, UMD_DEV, UMD_PROD], moduleType: RENDERER, - entry: 'react-dom/src/server/ReactDOMFizzServerBrowser.js', + entry: 'react-dom/src/server/react-dom-server.browser', name: 'react-dom-server.browser', global: 'ReactDOMServer', minifyWithProdErrorCodes: true, @@ -243,7 +243,7 @@ const bundles = [ { bundleTypes: [NODE_DEV, NODE_PROD], moduleType: RENDERER, - entry: 'react-dom/src/server/ReactDOMFizzServerNode.js', + entry: 'react-dom/src/server/react-dom-server.node', name: 'react-dom-server.node', global: 'ReactDOMServer', minifyWithProdErrorCodes: false, @@ -264,7 +264,7 @@ const bundles = [ { bundleTypes: [NODE_DEV, NODE_PROD], moduleType: RENDERER, - entry: 'react-dom/src/server/ReactDOMFizzServerEdge.js', + entry: 'react-dom/src/server/react-dom-server.edge', name: 'react-dom-server.edge', // 'node_modules/react/*.js', global: 'ReactDOMServer', @@ -277,7 +277,7 @@ const bundles = [ { bundleTypes: [BUN_DEV, BUN_PROD], moduleType: RENDERER, - entry: 'react-dom/src/server/ReactDOMFizzServerBun.js', + entry: 'react-dom/src/server/react-dom-server.bun', name: 'react-dom-server.bun', // 'node_modules/react/*.js', global: 'ReactDOMServer', diff --git a/scripts/shared/inlinedHostConfigs.js b/scripts/shared/inlinedHostConfigs.js index a6c1772f11c72..33fd26ed8b7e1 100644 --- a/scripts/shared/inlinedHostConfigs.js +++ b/scripts/shared/inlinedHostConfigs.js @@ -12,7 +12,7 @@ module.exports = [ entryPoints: [ 'react-dom', 'react-dom/unstable_testing', - 'react-dom/src/server/ReactDOMFizzServerNode.js', + 'react-dom/src/server/react-dom-server.node', 'react-dom/static.node', 'react-dom/server-rendering-stub', 'react-dom/unstable_server-external-runtime', @@ -27,6 +27,7 @@ module.exports = [ 'react-dom/server.node', 'react-dom/static', 'react-dom/static.node', + 'react-dom/src/server/react-dom-server.node', 'react-dom/src/server/ReactDOMFizzServerNode.js', // react-dom/server.node 'react-dom/src/server/ReactDOMFizzStaticNode.js', 'react-server-dom-webpack', @@ -46,10 +47,11 @@ module.exports = [ }, { shortName: 'dom-bun', - entryPoints: ['react-dom', 'react-dom/src/server/ReactDOMFizzServerBun.js'], + entryPoints: ['react-dom', 'react-dom/src/server/react-dom-server.bun'], paths: [ 'react-dom', 'react-dom/server.bun', + 'react-dom/src/server/react-dom-server.bun', 'react-dom/src/server/ReactDOMFizzServerBun.js', 'react-dom-bindings', 'shared/ReactDOMSharedInternals', @@ -62,7 +64,7 @@ module.exports = [ entryPoints: [ 'react-dom', 'react-dom/unstable_testing', - 'react-dom/src/server/ReactDOMFizzServerBrowser.js', + 'react-dom/src/server/react-dom-server.browser', 'react-dom/static.browser', 'react-dom/server-rendering-stub', 'react-dom/unstable_server-external-runtime', @@ -76,6 +78,7 @@ module.exports = [ 'react-dom/server.browser', 'react-dom/static.browser', 'react-dom/unstable_testing', + 'react-dom/src/server/react-dom-server.browser', 'react-dom/src/server/ReactDOMFizzServerBrowser.js', // react-dom/server.browser 'react-dom/src/server/ReactDOMFizzStaticBrowser.js', 'react-server-dom-webpack', @@ -118,7 +121,7 @@ module.exports = [ { shortName: 'dom-edge-webpack', entryPoints: [ - 'react-dom/src/server/ReactDOMFizzServerEdge.js', + 'react-dom/src/server/react-dom-server.edge', 'react-dom/static.edge', 'react-server-dom-webpack/server.edge', 'react-server-dom-webpack/client.edge', @@ -130,6 +133,7 @@ module.exports = [ 'react-dom/server.edge', 'react-dom/static.edge', 'react-dom/unstable_testing', + 'react-dom/src/server/react-dom-server.edge', 'react-dom/src/server/ReactDOMFizzServerEdge.js', // react-dom/server.edge 'react-dom/src/server/ReactDOMFizzStaticEdge.js', 'react-server-dom-webpack', @@ -160,6 +164,7 @@ module.exports = [ 'react-dom/server.node', 'react-dom/static', 'react-dom/static.node', + 'react-dom/src/server/react-dom-server.node', 'react-dom/src/server/ReactDOMFizzServerNode.js', // react-dom/server.node 'react-dom/src/server/ReactDOMFizzStaticNode.js', 'react-server-dom-webpack', @@ -193,6 +198,7 @@ module.exports = [ 'react-dom/server.node', 'react-dom/static', 'react-dom/static.node', + 'react-dom/src/server/react-dom-server.node', 'react-dom/src/server/ReactDOMFizzServerNode.js', // react-dom/server.node 'react-dom/src/server/ReactDOMFizzStaticNode.js', 'react-server-dom-esm',