From 660ba92e75315ff3a04315ed3dc26567c1e109d3 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Mon, 15 Jan 2024 11:11:40 -0500 Subject: [PATCH] Rename "shared subset" to "server" The internal file ReactSharedSubset is what the `react` module resolves to when imported from a Server Component environment. We gave it this name because, originally, the idea was that Server Components can access a subset of the APIs available on the client. However, since then, we've also added APIs that can _only_ by accessed on the server and not the client. In other words, it's no longer a subset, it's a slightly different overlapping set. So this commit renames ReactSharedSubet to ReactServer and updates all the references. This does not affect the public API, only our internal implementation. --- .../src/__tests__/ReactFlight-test.js | 4 ++-- .../react-dom/npm/react-dom.react-server.js | 7 +++++++ packages/react-dom/npm/react-dom.server.js | 7 +++++++ .../react-dom/npm/react-dom.shared-subset.js | 7 ------- packages/react-dom/package.json | 4 ++-- ...actDOMSharedSubset.js => ReactDOMServer.js} | 0 .../__tests__/ReactDOMInReactServer-test.js | 2 +- .../ReactFlightDOMServerFB-test.internal.js | 2 +- .../__tests__/ReactFlightTurbopackDOM-test.js | 2 +- .../ReactFlightTurbopackDOMBrowser-test.js | 2 +- .../ReactFlightTurbopackDOMEdge-test.js | 2 +- .../ReactFlightTurbopackDOMForm-test.js | 2 +- .../ReactFlightTurbopackDOMNode-test.js | 2 +- .../ReactFlightTurbopackDOMReply-test.js | 2 +- .../ReactFlightTurbopackDOMReplyEdge-test.js | 2 +- .../src/__tests__/ReactFlightDOM-test.js | 2 +- .../__tests__/ReactFlightDOMBrowser-test.js | 2 +- .../src/__tests__/ReactFlightDOMEdge-test.js | 2 +- .../src/__tests__/ReactFlightDOMForm-test.js | 2 +- .../src/__tests__/ReactFlightDOMNode-test.js | 2 +- .../src/__tests__/ReactFlightDOMReply-test.js | 2 +- .../__tests__/ReactFlightDOMReplyEdge-test.js | 2 +- packages/react/npm/react.react-server.js | 7 +++++++ packages/react/npm/react.server.js | 7 +++++++ packages/react/npm/react.shared-subset.js | 7 ------- packages/react/package.json | 4 ++-- ....shared-subset.js => react.react-server.js} | 2 +- ...rimental.js => ReactServer.experimental.js} | 0 .../{ReactSharedSubset.js => ReactServer.js} | 0 ...ReactSharedSubsetFB.js => ReactServerFB.js} | 2 +- .../react/src/__tests__/ReactFetch-test.js | 2 +- .../react/src/__tests__/ReactFetchEdge-test.js | 2 +- scripts/jest/setupHostConfigs.js | 4 ++-- scripts/rollup/bundles.js | 12 ++++++------ scripts/rollup/forks.js | 6 +++--- scripts/shared/inlinedHostConfigs.js | 18 +++++++++--------- 36 files changed, 74 insertions(+), 60 deletions(-) create mode 100644 packages/react-dom/npm/react-dom.react-server.js create mode 100644 packages/react-dom/npm/react-dom.server.js delete mode 100644 packages/react-dom/npm/react-dom.shared-subset.js rename packages/react-dom/src/{ReactDOMSharedSubset.js => ReactDOMServer.js} (100%) create mode 100644 packages/react/npm/react.react-server.js create mode 100644 packages/react/npm/react.server.js delete mode 100644 packages/react/npm/react.shared-subset.js rename packages/react/{react.shared-subset.js => react.react-server.js} (83%) rename packages/react/src/{ReactSharedSubset.experimental.js => ReactServer.experimental.js} (100%) rename packages/react/src/{ReactSharedSubset.js => ReactServer.js} (100%) rename packages/react/src/{ReactSharedSubsetFB.js => ReactServerFB.js} (87%) diff --git a/packages/react-client/src/__tests__/ReactFlight-test.js b/packages/react-client/src/__tests__/ReactFlight-test.js index 45e6d6df5ad4f..fc351132a3135 100644 --- a/packages/react-client/src/__tests__/ReactFlight-test.js +++ b/packages/react-client/src/__tests__/ReactFlight-test.js @@ -43,7 +43,7 @@ let assertLog; describe('ReactFlight', () => { beforeEach(() => { jest.resetModules(); - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); ReactServer = require('react'); ReactNoopFlightServer = require('react-noop-renderer/flight-server'); // This stores the state so we need to preserve it @@ -1465,7 +1465,7 @@ describe('ReactFlight', () => { // Reset all modules, except flight-modules which keeps the registry of Client Components const flightModules = require('react-noop-renderer/flight-modules'); jest.resetModules(); - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-noop-renderer/flight-modules', () => flightModules); ReactServer = require('react'); diff --git a/packages/react-dom/npm/react-dom.react-server.js b/packages/react-dom/npm/react-dom.react-server.js new file mode 100644 index 0000000000000..7ba04f2fec7c0 --- /dev/null +++ b/packages/react-dom/npm/react-dom.react-server.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-dom.react-server.production.min.js'); +} else { + module.exports = require('./cjs/react-dom.react-server.development.js'); +} diff --git a/packages/react-dom/npm/react-dom.server.js b/packages/react-dom/npm/react-dom.server.js new file mode 100644 index 0000000000000..7ba04f2fec7c0 --- /dev/null +++ b/packages/react-dom/npm/react-dom.server.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-dom.react-server.production.min.js'); +} else { + module.exports = require('./cjs/react-dom.react-server.development.js'); +} diff --git a/packages/react-dom/npm/react-dom.shared-subset.js b/packages/react-dom/npm/react-dom.shared-subset.js deleted file mode 100644 index b74e646f9ca17..0000000000000 --- a/packages/react-dom/npm/react-dom.shared-subset.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-dom.shared-subset.production.min.js'); -} else { - module.exports = require('./cjs/react-dom.shared-subset.development.js'); -} diff --git a/packages/react-dom/package.json b/packages/react-dom/package.json index 739e045447ddf..3d71298844dc4 100644 --- a/packages/react-dom/package.json +++ b/packages/react-dom/package.json @@ -42,13 +42,13 @@ "test-utils.js", "unstable_testing.js", "unstable_server-external-runtime.js", - "react-dom.shared-subset.js", + "react-dom.react-server.js", "cjs/", "umd/" ], "exports": { ".": { - "react-server": "./react-dom.shared-subset.js", + "react-server": "./react-dom.react-server.js", "default": "./index.js" }, "./client": "./client.js", diff --git a/packages/react-dom/src/ReactDOMSharedSubset.js b/packages/react-dom/src/ReactDOMServer.js similarity index 100% rename from packages/react-dom/src/ReactDOMSharedSubset.js rename to packages/react-dom/src/ReactDOMServer.js diff --git a/packages/react-dom/src/__tests__/ReactDOMInReactServer-test.js b/packages/react-dom/src/__tests__/ReactDOMInReactServer-test.js index a86dbc3815953..f3bc6ea8aded2 100644 --- a/packages/react-dom/src/__tests__/ReactDOMInReactServer-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMInReactServer-test.js @@ -12,7 +12,7 @@ describe('ReactDOMInReactServer', () => { beforeEach(() => { jest.resetModules(); - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); }); it('can require react-dom', () => { diff --git a/packages/react-server-dom-fb/src/__tests__/ReactFlightDOMServerFB-test.internal.js b/packages/react-server-dom-fb/src/__tests__/ReactFlightDOMServerFB-test.internal.js index 69cc1ff5e52e2..57730807c5c1c 100644 --- a/packages/react-server-dom-fb/src/__tests__/ReactFlightDOMServerFB-test.internal.js +++ b/packages/react-server-dom-fb/src/__tests__/ReactFlightDOMServerFB-test.internal.js @@ -73,7 +73,7 @@ describe('ReactFlightDOM for FB', () => { // condition jest.resetModules(); - jest.mock('react', () => require('react/src/ReactSharedSubsetFB')); + jest.mock('react', () => require('react/src/ReactServerFB')); jest.mock('shared/ReactFeatureFlags', () => { jest.mock( diff --git a/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOM-test.js b/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOM-test.js index 81cd49b6cf19a..f74143b220634 100644 --- a/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOM-test.js +++ b/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOM-test.js @@ -41,7 +41,7 @@ describe('ReactFlightDOM', () => { jest.mock('react-server-dom-turbopack/server', () => require('react-server-dom-turbopack/server.node.unbundled'), ); - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); const TurbopackMock = require('./utils/TurbopackMock'); clientExports = TurbopackMock.clientExports; diff --git a/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMBrowser-test.js b/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMBrowser-test.js index 3aa7f712a0025..d797946a3fd3d 100644 --- a/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMBrowser-test.js +++ b/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMBrowser-test.js @@ -24,7 +24,7 @@ describe('ReactFlightDOMBrowser', () => { jest.resetModules(); // Simulate the condition resolution - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-server-dom-turbopack/server', () => require('react-server-dom-turbopack/server.browser'), ); diff --git a/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMEdge-test.js b/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMEdge-test.js index d0d14915bcda8..67d25c967f472 100644 --- a/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMEdge-test.js +++ b/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMEdge-test.js @@ -33,7 +33,7 @@ describe('ReactFlightDOMEdge', () => { jest.resetModules(); // Simulate the condition resolution - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-server-dom-turbopack/server', () => require('react-server-dom-turbopack/server.edge'), ); diff --git a/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMForm-test.js b/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMForm-test.js index ad7e0d0feed76..3f63222d0ae2d 100644 --- a/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMForm-test.js +++ b/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMForm-test.js @@ -33,7 +33,7 @@ describe('ReactFlightDOMForm', () => { beforeEach(() => { jest.resetModules(); // Simulate the condition resolution - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-server-dom-turbopack/server', () => require('react-server-dom-turbopack/server.edge'), ); diff --git a/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMNode-test.js b/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMNode-test.js index a3068003db864..e06ee0a32f950 100644 --- a/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMNode-test.js +++ b/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMNode-test.js @@ -29,7 +29,7 @@ describe('ReactFlightDOMNode', () => { jest.resetModules(); // Simulate the condition resolution - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-server-dom-turbopack/server', () => require('react-server-dom-turbopack/server.node'), ); diff --git a/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMReply-test.js b/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMReply-test.js index f089789598850..e47352cfe981d 100644 --- a/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMReply-test.js +++ b/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMReply-test.js @@ -24,7 +24,7 @@ describe('ReactFlightDOMReply', () => { beforeEach(() => { jest.resetModules(); // Simulate the condition resolution - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-server-dom-turbopack/server', () => require('react-server-dom-turbopack/server.browser'), ); diff --git a/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMReplyEdge-test.js b/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMReplyEdge-test.js index 4ff2b436f3aaa..0cd8605c7e8d6 100644 --- a/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMReplyEdge-test.js +++ b/packages/react-server-dom-turbopack/src/__tests__/ReactFlightTurbopackDOMReplyEdge-test.js @@ -24,7 +24,7 @@ describe('ReactFlightDOMReply', () => { beforeEach(() => { jest.resetModules(); // Simulate the condition resolution - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-server-dom-turbopack/server', () => require('react-server-dom-turbopack/server.edge'), ); diff --git a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOM-test.js b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOM-test.js index c12c6904b872f..91ba06dd329b9 100644 --- a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOM-test.js +++ b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOM-test.js @@ -50,7 +50,7 @@ describe('ReactFlightDOM', () => { jest.mock('react-server-dom-webpack/server', () => require('react-server-dom-webpack/server.node.unbundled'), ); - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); const WebpackMock = require('./utils/WebpackMock'); clientExports = WebpackMock.clientExports; diff --git a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMBrowser-test.js b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMBrowser-test.js index 779e117627072..efbaba033c3f9 100644 --- a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMBrowser-test.js +++ b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMBrowser-test.js @@ -36,7 +36,7 @@ describe('ReactFlightDOMBrowser', () => { jest.resetModules(); // Simulate the condition resolution - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-server-dom-webpack/server', () => require('react-server-dom-webpack/server.browser'), ); diff --git a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMEdge-test.js b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMEdge-test.js index 2f643fbbfbfa0..1cbac757430f1 100644 --- a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMEdge-test.js +++ b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMEdge-test.js @@ -34,7 +34,7 @@ describe('ReactFlightDOMEdge', () => { jest.resetModules(); // Simulate the condition resolution - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-server-dom-webpack/server', () => require('react-server-dom-webpack/server.edge'), ); diff --git a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMForm-test.js b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMForm-test.js index 89b436907f201..b95a6c824f092 100644 --- a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMForm-test.js +++ b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMForm-test.js @@ -38,7 +38,7 @@ describe('ReactFlightDOMForm', () => { beforeEach(() => { jest.resetModules(); // Simulate the condition resolution - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-server-dom-webpack/server', () => require('react-server-dom-webpack/server.edge'), ); diff --git a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMNode-test.js b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMNode-test.js index 6fd51a5d1fb49..87fc83360018e 100644 --- a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMNode-test.js +++ b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMNode-test.js @@ -29,7 +29,7 @@ describe('ReactFlightDOMNode', () => { jest.resetModules(); // Simulate the condition resolution - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-server-dom-webpack/server', () => require('react-server-dom-webpack/server.node'), ); diff --git a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReply-test.js b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReply-test.js index ed2f8a8f566bb..1162d1d0fe738 100644 --- a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReply-test.js +++ b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReply-test.js @@ -24,7 +24,7 @@ describe('ReactFlightDOMReply', () => { beforeEach(() => { jest.resetModules(); // Simulate the condition resolution - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-server-dom-webpack/server', () => require('react-server-dom-webpack/server.browser'), ); diff --git a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReplyEdge-test.js b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReplyEdge-test.js index e657022f75912..8e45472956294 100644 --- a/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReplyEdge-test.js +++ b/packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMReplyEdge-test.js @@ -24,7 +24,7 @@ describe('ReactFlightDOMReplyEdge', () => { beforeEach(() => { jest.resetModules(); // Simulate the condition resolution - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-server-dom-webpack/server', () => require('react-server-dom-webpack/server.edge'), ); diff --git a/packages/react/npm/react.react-server.js b/packages/react/npm/react.react-server.js new file mode 100644 index 0000000000000..42772dc4ba3c7 --- /dev/null +++ b/packages/react/npm/react.react-server.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react.react-server.production.min.js'); +} else { + module.exports = require('./cjs/react.react-server.development.js'); +} diff --git a/packages/react/npm/react.server.js b/packages/react/npm/react.server.js new file mode 100644 index 0000000000000..42772dc4ba3c7 --- /dev/null +++ b/packages/react/npm/react.server.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react.react-server.production.min.js'); +} else { + module.exports = require('./cjs/react.react-server.development.js'); +} diff --git a/packages/react/npm/react.shared-subset.js b/packages/react/npm/react.shared-subset.js deleted file mode 100644 index 694e966729ff9..0000000000000 --- a/packages/react/npm/react.shared-subset.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react.shared-subset.production.min.js'); -} else { - module.exports = require('./cjs/react.shared-subset.development.js'); -} diff --git a/packages/react/package.json b/packages/react/package.json index ab362a97a4298..39b545825875c 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -16,12 +16,12 @@ "umd/", "jsx-runtime.js", "jsx-dev-runtime.js", - "react.shared-subset.js" + "react.react-server.js" ], "main": "index.js", "exports": { ".": { - "react-server": "./react.shared-subset.js", + "react-server": "./react.react-server.js", "default": "./index.js" }, "./package.json": "./package.json", diff --git a/packages/react/react.shared-subset.js b/packages/react/react.react-server.js similarity index 83% rename from packages/react/react.shared-subset.js rename to packages/react/react.react-server.js index 13d2fae7fa84c..54ab1834fd919 100644 --- a/packages/react/react.shared-subset.js +++ b/packages/react/react.react-server.js @@ -7,4 +7,4 @@ * @flow */ -export * from './src/ReactSharedSubset'; +export * from './src/ReactServer'; diff --git a/packages/react/src/ReactSharedSubset.experimental.js b/packages/react/src/ReactServer.experimental.js similarity index 100% rename from packages/react/src/ReactSharedSubset.experimental.js rename to packages/react/src/ReactServer.experimental.js diff --git a/packages/react/src/ReactSharedSubset.js b/packages/react/src/ReactServer.js similarity index 100% rename from packages/react/src/ReactSharedSubset.js rename to packages/react/src/ReactServer.js diff --git a/packages/react/src/ReactSharedSubsetFB.js b/packages/react/src/ReactServerFB.js similarity index 87% rename from packages/react/src/ReactSharedSubsetFB.js rename to packages/react/src/ReactServerFB.js index b904cfc0e9cd4..1060040c145a6 100644 --- a/packages/react/src/ReactSharedSubsetFB.js +++ b/packages/react/src/ReactServerFB.js @@ -7,5 +7,5 @@ * @flow */ -export * from './ReactSharedSubset'; +export * from './ReactServer'; export {jsx, jsxs, jsxDEV} from './jsx/ReactJSX'; diff --git a/packages/react/src/__tests__/ReactFetch-test.js b/packages/react/src/__tests__/ReactFetch-test.js index e91c6e09941d8..2b42bfdd25a3e 100644 --- a/packages/react/src/__tests__/ReactFetch-test.js +++ b/packages/react/src/__tests__/ReactFetch-test.js @@ -44,7 +44,7 @@ describe('ReactFetch', () => { fetchCount = 0; global.fetch = fetchMock; - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-server-dom-webpack/server', () => require('react-server-dom-webpack/server.browser'), ); diff --git a/packages/react/src/__tests__/ReactFetchEdge-test.js b/packages/react/src/__tests__/ReactFetchEdge-test.js index b4e313faa728f..741306a9a2e4a 100644 --- a/packages/react/src/__tests__/ReactFetchEdge-test.js +++ b/packages/react/src/__tests__/ReactFetchEdge-test.js @@ -48,7 +48,7 @@ describe('ReactFetch', () => { fetchCount = 0; global.fetch = fetchMock; - jest.mock('react', () => require('react/react.shared-subset')); + jest.mock('react', () => require('react/react.react-server')); jest.mock('react-server-dom-webpack/server', () => require('react-server-dom-webpack/server.edge'), ); diff --git a/scripts/jest/setupHostConfigs.js b/scripts/jest/setupHostConfigs.js index b296f65224eb7..5fde144c255e3 100644 --- a/scripts/jest/setupHostConfigs.js +++ b/scripts/jest/setupHostConfigs.js @@ -58,9 +58,9 @@ global.__unmockReact = mockReact; mockReact(); -jest.mock('react/react.shared-subset', () => { +jest.mock('react/react.react-server', () => { const resolvedEntryPoint = resolveEntryFork( - require.resolve('react/src/ReactSharedSubset'), + require.resolve('react/src/ReactServer'), global.__WWW__ ); return jest.requireActual(resolvedEntryPoint); diff --git a/scripts/rollup/bundles.js b/scripts/rollup/bundles.js index 0ce6d052f8ca6..a4f3f08bbd522 100644 --- a/scripts/rollup/bundles.js +++ b/scripts/rollup/bundles.js @@ -96,8 +96,8 @@ const bundles = [ { bundleTypes: [NODE_DEV, NODE_PROD], moduleType: ISOMORPHIC, - entry: 'react/src/ReactSharedSubset.js', - name: 'react.shared-subset', + entry: 'react/src/ReactServer.js', + name: 'react.react-server', global: 'React', minifyWithProdErrorCodes: true, wrapWithModuleBoundaries: false, @@ -108,8 +108,8 @@ const bundles = [ { bundleTypes: __EXPERIMENTAL__ ? [FB_WWW_DEV, FB_WWW_PROD] : [], moduleType: ISOMORPHIC, - entry: 'react/src/ReactSharedSubsetFB.js', - global: 'ReactSharedSubset', + entry: 'react/src/ReactServerFB.js', + global: 'ReactServer', minifyWithProdErrorCodes: true, wrapWithModuleBoundaries: false, externals: [], @@ -180,8 +180,8 @@ const bundles = [ { bundleTypes: [NODE_DEV, NODE_PROD], moduleType: RENDERER, - entry: 'react-dom/src/ReactDOMSharedSubset.js', - name: 'react-dom.shared-subset', + entry: 'react-dom/src/ReactDOMServer.js', + name: 'react-dom.react-server', global: 'ReactDOM', minifyWithProdErrorCodes: false, wrapWithModuleBoundaries: false, diff --git a/scripts/rollup/forks.js b/scripts/rollup/forks.js index 916e857d57631..173ff58379251 100644 --- a/scripts/rollup/forks.js +++ b/scripts/rollup/forks.js @@ -64,8 +64,8 @@ const forks = Object.freeze({ return './packages/react/src/ReactSharedInternalsClient.js'; } if ( - entry === 'react/src/ReactSharedSubset.js' || - entry === 'react/src/ReactSharedSubsetFB.js' + entry === 'react/src/ReactServer.js' || + entry === 'react/src/ReactServerFB.js' ) { return './packages/react/src/ReactSharedInternalsServer.js'; } @@ -93,7 +93,7 @@ const forks = Object.freeze({ if ( entry === 'react-dom' || entry === 'react-dom/server-rendering-stub' || - entry === 'react-dom/src/ReactDOMSharedSubset.js' + entry === 'react-dom/src/ReactDOMServer.js' ) { return './packages/react-dom/src/ReactDOMSharedInternals.js'; } diff --git a/scripts/shared/inlinedHostConfigs.js b/scripts/shared/inlinedHostConfigs.js index 00353682abf23..fa6916cee621b 100644 --- a/scripts/shared/inlinedHostConfigs.js +++ b/scripts/shared/inlinedHostConfigs.js @@ -11,7 +11,7 @@ module.exports = [ shortName: 'dom-node', entryPoints: [ 'react-dom', - 'react-dom/src/ReactDOMSharedSubset.js', + 'react-dom/src/ReactDOMServer.js', 'react-dom/unstable_testing', 'react-dom/src/server/react-dom-server.node.js', 'react-dom/static.node', @@ -22,7 +22,7 @@ module.exports = [ ], paths: [ 'react-dom', - 'react-dom/src/ReactDOMSharedSubset.js', + 'react-dom/src/ReactDOMServer.js', 'react-dom-bindings', 'react-dom/client', 'react-dom/server', @@ -190,7 +190,7 @@ module.exports = [ ], paths: [ 'react-dom', - 'react-dom/src/ReactDOMSharedSubset.js', + 'react-dom/src/ReactDOMServer.js', 'react-dom-bindings', 'react-dom/client', 'react-dom/server.browser', @@ -221,7 +221,7 @@ module.exports = [ entryPoints: ['react-server-dom-esm/client.browser'], paths: [ 'react-dom', - 'react-dom/src/ReactDOMSharedSubset.js', + 'react-dom/src/ReactDOMServer.js', 'react-dom/client', 'react-dom/server', 'react-dom/server.node', @@ -280,7 +280,7 @@ module.exports = [ ], paths: [ 'react-dom', - 'react-dom/src/ReactDOMSharedSubset.js', + 'react-dom/src/ReactDOMServer.js', 'react-dom-bindings', 'react-dom/client', 'react-dom/server.edge', @@ -314,7 +314,7 @@ module.exports = [ ], paths: [ 'react-dom', - 'react-dom/src/ReactDOMSharedSubset.js', + 'react-dom/src/ReactDOMServer.js', 'react-dom-bindings', 'react-dom/client', 'react-dom/server.edge', @@ -348,7 +348,7 @@ module.exports = [ ], paths: [ 'react-dom', - 'react-dom/src/ReactDOMSharedSubset.js', + 'react-dom/src/ReactDOMServer.js', 'react-dom-bindings', 'react-dom/client', 'react-dom/server', @@ -383,7 +383,7 @@ module.exports = [ ], paths: [ 'react-dom', - 'react-dom/src/ReactDOMSharedSubset.js', + 'react-dom/src/ReactDOMServer.js', 'react-dom-bindings', 'react-server-dom-webpack', 'react-dom/src/server/ReactDOMLegacyServerImpl.js', // not an entrypoint, but only usable in *Browser and *Node files @@ -401,7 +401,7 @@ module.exports = [ entryPoints: ['react-server-dom-fb/src/ReactDOMServerFB.js'], paths: [ 'react-dom', - 'react-dom/src/ReactDOMSharedSubset.js', + 'react-dom/src/ReactDOMServer.js', 'react-dom-bindings', 'react-server-dom-fb/src/ReactDOMServerFB.js', 'shared/ReactDOMSharedInternals',