Skip to content

Commit

Permalink
Use react-dom directly instead of server-rendering-stub
Browse files Browse the repository at this point in the history
No longer needed now that facebook/react#28271 exists
  • Loading branch information
eps1lon committed May 6, 2024
1 parent 0e8f51e commit 987743c
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 13 deletions.
4 changes: 0 additions & 4 deletions packages/next-swc/crates/next-core/src/next_import_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,10 +733,6 @@ async fn rsc_aliases(
alias["react"] = format!("next/dist/compiled/react{react_channel}/react.react-server");
alias["react-dom"] =
format!("next/dist/compiled/react-dom{react_channel}/react-dom.react-server");
} else {
// x-ref: https://github.com/facebook/react/pull/25436
alias["react-dom"] =
format!("next/dist/compiled/react-dom{react_channel}/server-rendering-stub");
}
}

Expand Down
5 changes: 0 additions & 5 deletions packages/next/src/build/create-compiler-aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
1 change: 0 additions & 1 deletion packages/next/types/react-dom.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
declare module 'react-dom/server-rendering-stub'
declare module 'react-dom/server.browser'

declare module 'react-dom/server.edge' {
Expand Down
3 changes: 1 addition & 2 deletions packages/next/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down

0 comments on commit 987743c

Please sign in to comment.