Skip to content

Commit

Permalink
updates react.shared-subset to react.react-server
Browse files Browse the repository at this point in the history
  • Loading branch information
gnoff committed Feb 6, 2024
1 parent 6290768 commit cc052d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/next-swc/crates/next-core/src/next_import_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,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
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/build/create-compiler-aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions packages/next/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down Expand Up @@ -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',
Expand All @@ -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`,
},
},
},
Expand Down

0 comments on commit cc052d9

Please sign in to comment.