From d233905c0d25de5c9b7ec3cca43c12c48b823b58 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Fri, 26 Apr 2024 21:04:01 +0200 Subject: [PATCH] Use `react-dom` directly instead of server-rendering-stub No longer needed now that https://github.com/facebook/react/pull/28271 exists --- packages/next/src/build/create-compiler-aliases.ts | 5 ----- .../route-modules/app-page/vendored/ssr/entrypoints.ts | 2 +- packages/next/types/react-dom.d.ts | 1 - packages/next/webpack.config.js | 3 +-- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/next/src/build/create-compiler-aliases.ts b/packages/next/src/build/create-compiler-aliases.ts index 58730bb56479e..06451f01788f9 100644 --- a/packages/next/src/build/create-compiler-aliases.ts +++ b/packages/next/src/build/create-compiler-aliases.ts @@ -296,11 +296,6 @@ export function createRSCAliases( alias[ 'react-dom$' ] = `next/dist/compiled/react-dom${bundledReactChannel}/react-dom.react-server` - } else { - // x-ref: https://github.com/facebook/react/pull/25436 - alias[ - 'react-dom$' - ] = `next/dist/compiled/react-dom${bundledReactChannel}/server-rendering-stub` } } diff --git a/packages/next/src/server/future/route-modules/app-page/vendored/ssr/entrypoints.ts b/packages/next/src/server/future/route-modules/app-page/vendored/ssr/entrypoints.ts index 70f432fff4e88..4064bf693e272 100644 --- a/packages/next/src/server/future/route-modules/app-page/vendored/ssr/entrypoints.ts +++ b/packages/next/src/server/future/route-modules/app-page/vendored/ssr/entrypoints.ts @@ -1,5 +1,5 @@ import * as React from 'react' -import * as ReactDOM from 'react-dom/server-rendering-stub' +import * as ReactDOM from 'react-dom' import * as ReactJsxDevRuntime from 'react/jsx-dev-runtime' import * as ReactJsxRuntime from 'react/jsx-runtime' diff --git a/packages/next/types/react-dom.d.ts b/packages/next/types/react-dom.d.ts index a6b75b20a2b33..db0e969c00a28 100644 --- a/packages/next/types/react-dom.d.ts +++ b/packages/next/types/react-dom.d.ts @@ -1,4 +1,3 @@ -declare module 'react-dom/server-rendering-stub' declare module 'react-dom/server.browser' declare module 'react-dom/server.edge' { diff --git a/packages/next/webpack.config.js b/packages/next/webpack.config.js index 6aa204e738680..5737ff591aac0 100644 --- a/packages/next/webpack.config.js +++ b/packages/next/webpack.config.js @@ -33,8 +33,7 @@ function makeAppAliases(reactChannel = '') { return { react$: `next/dist/compiled/react${reactChannel}`, 'react/react.react-server$': `next/dist/compiled/react${reactChannel}/react.react-server`, - 'react-dom/server-rendering-stub$': `next/dist/compiled/react-dom${reactChannel}/server-rendering-stub`, - 'react-dom$': `next/dist/compiled/react-dom${reactChannel}/server-rendering-stub`, + 'react-dom$': `next/dist/compiled/react-dom${reactChannel}`, 'react/jsx-runtime$': `next/dist/compiled/react${reactChannel}/jsx-runtime`, 'react/jsx-dev-runtime$': `next/dist/compiled/react${reactChannel}/jsx-dev-runtime`, 'react-dom/client$': `next/dist/compiled/react-dom${reactChannel}/client`,