From a2cb0ef16ef7849a1a4020c2765a26ae511fc9d9 Mon Sep 17 00:00:00 2001 From: Josh Story Date: Thu, 1 Feb 2024 10:14:43 -0800 Subject: [PATCH] updates react.shared-subset to react.react-server --- .../next-swc/crates/next-core/src/next_import_map.rs | 2 +- packages/next/src/build/create-compiler-aliases.ts | 2 +- packages/next/webpack.config.js | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/next-swc/crates/next-core/src/next_import_map.rs b/packages/next-swc/crates/next-core/src/next_import_map.rs index 467858cd0de42f..e23ed276994566 100644 --- a/packages/next-swc/crates/next-core/src/next_import_map.rs +++ b/packages/next-swc/crates/next-core/src/next_import_map.rs @@ -660,7 +660,7 @@ async fn rsc_aliases( if runtime == NextRuntime::Edge { if matches!(ty, ServerContextType::AppRSC { .. }) { - alias["react"] = format!("next/dist/compiled/react{react_channel}/react.shared-subset"); + alias["react"] = format!("next/dist/compiled/react{react_channel}/react.react-server"); } // Use server rendering stub for RSC and SSR // x-ref: https://github.com/facebook/react/pull/25436 diff --git a/packages/next/src/build/create-compiler-aliases.ts b/packages/next/src/build/create-compiler-aliases.ts index 66870560675258..68b06a3f827b3f 100644 --- a/packages/next/src/build/create-compiler-aliases.ts +++ b/packages/next/src/build/create-compiler-aliases.ts @@ -290,7 +290,7 @@ export function createRSCAliases( if (layer === WEBPACK_LAYERS.reactServerComponents) { alias[ 'react$' - ] = `next/dist/compiled/react${bundledReactChannel}/react.shared-subset` + ] = `next/dist/compiled/react${bundledReactChannel}/react.react-server` } // Use server rendering stub for RSC and SSR // x-ref: https://github.com/facebook/react/pull/25436 diff --git a/packages/next/webpack.config.js b/packages/next/webpack.config.js index e995e7f9d634bd..4849bf759c5e58 100644 --- a/packages/next/webpack.config.js +++ b/packages/next/webpack.config.js @@ -32,7 +32,7 @@ const appExternals = [ function makeAppAliases(reactChannel = '') { return { react$: `next/dist/compiled/react${reactChannel}`, - 'react/shared-subset$': `next/dist/compiled/react${reactChannel}/react.shared-subset`, + '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/jsx-runtime$': `next/dist/compiled/react${reactChannel}/jsx-runtime`, @@ -235,10 +235,10 @@ module.exports = ({ dev, turbo, bundleType, experimental }) => { alias: { react$: `next/dist/compiled/react${ experimental ? '-experimental' : '' - }/react.shared-subset`, + }/react.react-server`, 'next/dist/compiled/react$': `next/dist/compiled/react${ experimental ? '-experimental' : '' - }/react.shared-subset`, + }/react.react-server`, }, }, layer: 'react-server', @@ -250,10 +250,10 @@ module.exports = ({ dev, turbo, bundleType, experimental }) => { alias: { react$: `next/dist/compiled/react${ experimental ? '-experimental' : '' - }/react.shared-subset`, + }/react.react-server`, 'next/dist/compiled/react$': `next/dist/compiled/react${ experimental ? '-experimental' : '' - }/react.shared-subset`, + }/react.react-server`, }, }, },