Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
f509de95
Unverified
Commit
f509de95
authored
Mar 25, 2024
by
Janka Uryga
Committed by
GitHub
Mar 25, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix react-dom aliases for edge RSC (#63619)
Follow up to #63588, we missed edge there Closes NEXT-2905
parent
81c6b569
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
next_import_map.rs
packages/next-swc/crates/next-core/src/next_import_map.rs
+6
-4
create-compiler-aliases.ts
packages/next/src/build/create-compiler-aliases.ts
+5
-5
No files found.
packages/next-swc/crates/next-core/src/next_import_map.rs
View file @
f509de95
...
@@ -727,11 +727,13 @@ async fn rsc_aliases(
...
@@ -727,11 +727,13 @@ async fn rsc_aliases(
if
runtime
==
NextRuntime
::
Edge
{
if
runtime
==
NextRuntime
::
Edge
{
if
matches!
(
ty
,
ServerContextType
::
AppRSC
{
..
})
{
if
matches!
(
ty
,
ServerContextType
::
AppRSC
{
..
})
{
alias
[
"react"
]
=
format!
(
"next/dist/compiled/react{react_channel}/react.react-server"
);
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"
);
}
}
// Use server rendering stub for RSC and SSR
// x-ref: https://github.com/facebook/react/pull/25436
alias
[
"react-dom"
]
=
format!
(
"next/dist/compiled/react-dom{react_channel}/server-rendering-stub"
);
}
}
insert_exact_alias_map
(
import_map
,
project_path
,
alias
);
insert_exact_alias_map
(
import_map
,
project_path
,
alias
);
...
...
packages/next/src/build/create-compiler-aliases.ts
View file @
f509de95
...
@@ -299,12 +299,12 @@ export function createRSCAliases(
...
@@ -299,12 +299,12 @@ export function createRSCAliases(
alias
[
alias
[
'react-dom$'
'react-dom$'
]
=
`next/dist/compiled/react-dom
${
bundledReactChannel
}
/react-dom.react-server`
]
=
`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`
}
}
// Use server rendering stub for RSC and SSR
// x-ref: https://github.com/facebook/react/pull/25436
alias
[
'react-dom$'
]
=
`next/dist/compiled/react-dom
${
bundledReactChannel
}
/server-rendering-stub`
}
}
if
(
reactProductionProfiling
)
{
if
(
reactProductionProfiling
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment